Contiki-NG
|
CC13xx/CC26xx low-power operation. More...
Files | |
file | lpm.c |
Driver for CC13xx/CC26xx low-power operation. | |
file | lpm.h |
Header file for the management of CC13xx/CC26xx low-power operation. | |
Macros | |
#define | LPM_MODULE(n, m, s, w, l) |
Declare a variable to be used in order to get notifications from LPM. More... | |
Functions | |
void | lpm_shutdown (uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on) |
Put the chip in shutdown power mode. More... | |
void | lpm_sleep (void) |
Enter sleep mode. | |
void | lpm_drop (void) |
Drop the cortex to sleep / deep sleep and shut down peripherals. More... | |
void | lpm_register_module (lpm_registered_module_t *module) |
Register a module for LPM notifications. More... | |
void | lpm_unregister_module (lpm_registered_module_t *module) |
Unregister a module from LPM notifications. More... | |
void | lpm_init (void) |
Initialise the low-power mode management module. | |
void | lpm_pin_set_default_state (uint32_t ioid) |
Sets an IOID to a default state. More... | |
CC13xx/CC26xx low-power operation.
Implementation of CC13xx/CC26xx low-power operation functionality.
#define LPM_MODULE | ( | n, | |
m, | |||
s, | |||
w, | |||
l | |||
) |
Declare a variable to be used in order to get notifications from LPM.
n | the variable name to be declared |
m | A pointer to a function which will tell the LPM module the max PM this module is willing to handle. This function will return LPM_MODE_SLEEP, LPM_MODE_DEEP_SLEEP etc. The LPM module will ask all registered modules and will trigger the highest LPM permitted |
s | A pointer to a function which will receive a notification just before entering the low power mode. The callee can prepare for the imminent LPM state. The argument to this function will be the upcoming low power mode. This function can e.g. turn off a peripheral before the LPM module shuts down the power domain. |
w | A pointer to a function which will be called just after we have woken up. This can be used to e.g. turn a peripheral back on. This function is in charge of turning power domains back on. This function will normally be called within an interrupt context. |
l | Power domain locks, if any are required. The module can request that the SERIAL or PERIPH PD be kept powered up at the transition to deep sleep. This field can be a bitwise OR of LPM_DOMAIN_x, so if required multiple domains can be kept powered. |
void lpm_drop | ( | void | ) |
Drop the cortex to sleep / deep sleep and shut down peripherals.
Whether the cortex will drop to sleep or deep sleep is configurable. The exact peripherals which will be shut down is also configurable
Definition at line 525 of file lpm.c.
Referenced by platform_idle().
void lpm_pin_set_default_state | ( | uint32_t | ioid | ) |
Sets an IOID to a default state.
ioid | IOID_0... |
This will set ioid to sw control, input, no pull. Input buffer and output driver will both be disabled
The function will do nothing if ioid == IOID_UNUSED, so the caller does not have to check board configuration before calling this.
void lpm_register_module | ( | lpm_registered_module_t * | module | ) |
Register a module for LPM notifications.
module | A pointer to the data structure with the module definition |
When the LPM module is about to drop to some low power mode, it will first notify all modules about this.
This function must not be called before the module has been initialised with lpm_init(). The code does not perform checks: This is the caller's responsibility.
void lpm_shutdown | ( | uint32_t | wakeup_pin, |
uint32_t | io_pull, | ||
uint32_t | wake_on | ||
) |
Put the chip in shutdown power mode.
wakeup_pin | The GPIO pin which will wake us up. Must be IOID_0 etc... |
io_pull | Pull configuration for the shutdown pin: IOC_NO_IOPULL, IOC_IOPULL_UP or IOC_IOPULL_DOWN |
wake_on | High or Low (IOC_WAKE_ON_LOW or IOC_WAKE_ON_HIGH) |
void lpm_unregister_module | ( | lpm_registered_module_t * | module | ) |