Can we program our smartphone camera to detect the frequency and time period of IR light?
It depends on whether the smartphone camera actually sees IR. Most seem to these days.
More here: https://petapixel.com/2019/08/22/how-i-shoot-infrared-photography-with-a-smartphone/
This article shows the Samsung S10E, which apparently works. I looked into whether iPhones can see IR; it seems only the front camera can, but not the back, due to the back camera having an IR filter as part of its optics.
At any rate, you can test this on your own phone with just an IR TV remote and smartphone video: if the camera can see IR you will see flashing when the remote is pressed.