XBee Firmware Library  1.6.0
Functions
Power Management (PM)

Functions

pm_mode_t pm_get_cpu_mode (void)
 Function that returns the CPU operational mode. More...
 
pm_mode_t pm_get_radio_mode (void)
 Function that returns the radio operational mode. We consider radio operative when On/Sleep pin is high and CTS# is low. More...
 
uint8_t pm_get_wakeup_source (void)
 Function that returns which was the last wake up source for the CPU. More...
 
int pm_set_cpu_mode (pm_mode_t mode, uint32_t sleep_seconds)
 Function that configures the CPU operation mode to mode. More...
 
void pm_set_radio_mode (pm_mode_t mode)
 Function that configures the radio operation mode to mode. More...
 

Detailed Description

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.

Function Documentation

pm_mode_t pm_get_cpu_mode ( void  )

Function that returns the CPU operational mode.

Return values
pm_mode_tThe current CPU operational mode.
pm_mode_t pm_get_radio_mode ( void  )

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_tThe 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_tThe current wakeup source. Possible values:
  • WAKEUP_UNKNOWN
    • WAKEUP_UART
    • WAKEUP_PERIODIC_TASK
    • WAKEUP_TIMEOUT
    • WAKEUP_ALARM
    • WAKEUP_GPIO
    • WAKEUP_RADIO
int pm_set_cpu_mode ( pm_mode_t  mode,
uint32_t  sleep_seconds 
)

Function that configures the CPU operation mode to mode.

Parameters
[in]modeThe 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_secondsThe number of seconds the device will sleep before waking waking up. Use WAIT_INFINITE (0) to wake up only by IRQs.
Return values
EINVALincorrect mode
0on success.
void pm_set_radio_mode ( pm_mode_t  mode)

Function that configures the radio operation mode to mode.

Parameters
[in]modeThe 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
nothing.