Platform-specific layer provides a consistent Power Management API to upper layers of the driver.
Power Management API Overview
This API contains the code to configure the operational mode of the programmable XBee devices. Allows to set the mode of the CPU and of the radio chip.
- Power Management configuration functions:
Function that returns the CPU operational mode.
- Return values
-
pm_mode_t | The current CPU operational mode. |
Function that returns the radio operational mode. We consider radio operative when On/Sleep pin is high and CTS# is low.
- Return values
-
pm_mode_t | The current radio operational mode. |
uint8_t pm_get_wakeup_source |
( |
void |
| ) |
|
Function that returns which was the last wake up source for the CPU.
- Return values
-
uint8_t | The current wakeup source. Possible values:
- WAKEUP_UNKNOWN
- WAKEUP_UART
- WAKEUP_PERIODIC_TASK
- WAKEUP_TIMEOUT
- WAKEUP_ALARM
- WAKEUP_GPIO
- WAKEUP_RADIO
|
Function that configures the CPU operation mode to mode.
- Parameters
-
[in] | mode | The operating mode. Valid modes are: PM_MODE_RUN to set the CPU in the normal operational mode PM_MODE_WAIT to set the CPU in wait mode (CPU is shutdown but the system clocks are running and the full regulation is maintained PM_MODE_STOP_2 to set the CPU in Stop2 mode (system clocks are stopped and voltage regulator is in standby), partial power down of internal ciruits. PM_MODE_STOP_3 to set the CPU in Stop3 mode (system clocks are stopped and voltage regulator is in standby), all internal circuits are powered for fast recovery. |
[in] | sleep_seconds | The number of seconds the device will sleep before waking waking up. Use WAIT_INFINITE (0) to wake up only by IRQs. |
- Return values
-
EINVAL | incorrect mode |
0 | on success. |
Function that configures the radio operation mode to mode.
- Parameters
-
[in] | mode | The operating mode. Valid modes are: PM_MODE_RUN if the SLEEP_RQ pin is enabled, wakes up the radio using that pin. PM_MODE_STOP sends a Sleep Immediately command to put the radio in low power mode, entering automatically in cyclic sleep, independently of the ST timer value. |
- Return values
-