Contiki-NG
|
The power management module is composed by a nano-watt (gating) timer and an ultra-low power MCU, driving the RE-Mote power supply when connected to an external battery, and allowing an application to enter a so-called "shutdown mode". More...
Files | |
file | power-mgmt.h |
Header file for the RE-Mote Power Management driver. | |
Power Management return values | |
#define | PM_SUCCESS 0 |
#define | PM_ERROR (-1) |
#define | PM_MAX_BITS 8 |
Power Management "done" signal | |
#define | PM_SHUTDOWN_NOW GPIO_SET_PIN(PM_DONE_PORT_BASE, PM_DONE_PIN_MASK) |
Power Management timing values | |
#define | PM_1_MILISECOND 1000L |
#define | PM_2_2_MILISECOND 2200L |
#define | PM_3_MILISECOND 3000L |
#define | PM_10_MILISECOND 10000L |
Power Management commands | |
enum | pm_cmd_t |
Power Management status and masks | |
enum | pm_state_t |
#define | PM_SYSOFF_ON_MASK 0x01 |
#define | PM_TIMER_ENABLED_MASK 0x02 |
#define | PM_AWAITING_RTC_EVENT_MASK 0x04 |
Power Management functions | |
int8_t | pm_init (void) |
Initializes the Power Management driver. More... | |
int8_t | pm_enable_timer (void) |
Enable the shutdown mode, periodically driven by the Nano Timer. More... | |
int8_t | pm_disable_timer (void) |
Disable the Nano Timer. More... | |
int8_t | pm_get_state (uint8_t *state) |
Get the current state of the power management module. More... | |
int8_t | pm_get_firmware_version (uint8_t *state) |
Get the firmware version of the power management module. More... | |
The power management module is composed by a nano-watt (gating) timer and an ultra-low power MCU, driving the RE-Mote power supply when connected to an external battery, and allowing an application to enter a so-called "shutdown mode".
RE-Mote power management and shutdown mode.
While in shutdown mode, only the RTCC and the power management block is on, effectively reducing the RE-Mote power consumption down to <~200nA. The nano Timer allows the RE-Mote to be awaken off shutdown mode after a given period (from 100ms to 2 hours, default is 1 minute). To change the shutdown period, the R47 resistor (at the DELAY input pin, see the RE-Mote datasheet) has to be changed. See the TPL5110 datasheet ((Table 2 and 3) for more information about the R47 resistor value, below is a table resuming most common periods:
+---------—+---------—+ | R47 (Ohm) | Time | +---------—+---------—+ | 500 | 100ms | +---------—+---------—+ | 2.5K | 500ms | +---------—+---------—+ | 5.202K | 1s | +---------—+---------—+ | 22.021K | 1min | +---------—+---------—+ | 42.887K | 5min | +---------—+---------—+ | 57.434K | 10min | +---------—+---------—+ | 92.233K | 30min | +---------—+---------—+ | 170K | 2h | +---------—+---------—+
An application can enter the shutdown mode before the shutdown period expires by invoking the PM_SHUTDOWN_NOW macro. The on-board RTCC can also be used to drive the CC2538 off PM3 power mode, if the application requires to retain RAM. Note that while in shutdown mode the RE-Mote will be powered off.
int8_t pm_disable_timer | ( | void | ) |
Disable the Nano Timer.
Definition at line 174 of file power-mgmt.c.
int8_t pm_enable_timer | ( | void | ) |
Enable the shutdown mode, periodically driven by the Nano Timer.
Definition at line 161 of file power-mgmt.c.
int8_t pm_get_firmware_version | ( | uint8_t * | state | ) |
Get the firmware version of the power management module.
state | Pointer to a variable to save the state |
Definition at line 203 of file power-mgmt.c.
int8_t pm_get_state | ( | uint8_t * | state | ) |
Get the current state of the power management module.
state | Pointer to a variable to save the state |
Definition at line 187 of file power-mgmt.c.
int8_t pm_init | ( | void | ) |
Initializes the Power Management driver.
Definition at line 134 of file power-mgmt.c.
References GPIO_SOFTWARE_CONTROL.