All imps have at least one Wake pin for this task: check out the pin mux for the imp you’re using to find out which one — it’s usually pin W.
The pin is not enabled for waking by default – not everyone needs it. You enable it using the hardware.pin.configure() imp API call to set it up as a digital input:
onPinStateChangeCallback is reference to a function that may be triggered when the wake pin is asserted. Waking the imp from deep sleep restarts Squirrel afresh, so any callback registered with the method will not be called. However, if the pin is triggered while the imp is awake, the callback will be called.
You should note that this is not a true interrupt: on the event, the callback execution is queued and will be run when any current code finishes executing (and any previously queued callbacks complete).