How do I compile for sleep on PSoC5 | Cypress Semiconductor
How do I compile for sleep on PSoC5
I'm moving up from PSoC1 to PSoC5 for the first time. I'm trying to make the PSoC5 sleep repeatedly in a simple loop.
Currently, I'm trying:
CyPmSaveClocks(); // Save clock configuration before entering sleep
CyPmSleep(PM_SLEEP_TIME_CTW_16MS, PM_SLEEP_SRC_NONE); // Go to sleep for 16ms. Wakeup source implied by sleep time setting
CyPmRestoreClocks(); // Restore clock configuration after exiting sleep
but it won't compile because it can't find PM_SLEEP_TIME_CTW_16MS. I look in cyPm.h and discover that none of the times are defined for PSoC5.
So how do I put the PSoC5 to sleep for some regular interval?
Please note I'll have a followup question later. I intend to do some SPI communication each time a wake up. Will that continue to clock if I go back to sleep before the transmission is finished? Or do I need to poll completion of the transmission before I go to sleep? (This assumes the sleep interval is longer than the transmission time, and I haven't addressed the type or deptch of sleep yet.)