Q: I would like to include a hardware wakeup/sleep button on my Graphics Client Plus device. I know that if I connect a momentary pushbutton to J1, I can wake the system up, but how can I put the system to sleep using the same button?
ADS CE builds since November 2001 include a driver that can put the system to sleep based on J1 activity.
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Power]
"PowerOffByGPIO1"=dword:1 ; 1 enable built-in driver
"PowerOffFromApps"=dword:0 ; 1 application, 0 built-in driver
When the PowerOffFromApps key is set to 1, the interrupt handler issues the "PWROFF" event, which must be trapped by your application. See the current release of your product's registry for details.
You can also poll the status of the sleep/wake line with CE driver GPI5: on the GC Plus and GPI4: on the Bitsy and Graphics Master.