3 Replies Latest reply on Jul 20, 2016 8:36 AM by cjoachim_1597296

    A library called EasySleep

    cjoachim_1597296

      I found the low power handling on PSoC4BLE difficult so I tried to create a more user friendly function: void sleep_ble(BLESleepT request). It it based on documentation I've found, see comments in the source code. The function takes one of the following requests:

         
            
      • BLE_SLEEP: put BLE into Sleep
      •     
      • BLE_DEEPSLEEP: put BLE into DeepSleep, which takes some longer time to wake up than Sleep
      •     
      • BLE_SLEEP_CPU_SLEEP: put BLE into Sleep, put CPU into Sleep
      •     
      • BLE_DEEPSLEEP_CPU_SLEEP: put BLE into DeepSleep, put CPU into Sleep
      •     
      • BLE_DEEPSLEEP_CPU_DEEPSLEEP: put BLE into DeepSleep, put CPU into DeepSleep
      •    
         

      and tries to to it's best. The typical usage will probably use one of BLE_DEEPSLEEP, BLE_DEEPSLEEP_CPU_SLEEP or BLE_DEEPSLEEP_CPU_DEEPSLEEP.

         

      Enjoy! And please add comments if parts of the code must be fixed.