Contiki-NG
Files | Macros | Functions
CC13xx/CC26xx Low-Power management

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...
 

Detailed Description

CC13xx/CC26xx low-power operation.

Implementation of CC13xx/CC26xx low-power operation functionality.

Macro Definition Documentation

◆ LPM_MODULE

#define LPM_MODULE (   n,
  m,
  s,
  w,
 
)
Value:
static lpm_registered_module_t n = \
{ NULL, m, s, w, l }

Declare a variable to be used in order to get notifications from LPM.

Parameters
nthe variable name to be declared
mA 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
sA 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.
wA 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.
lPower 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.

Definition at line 92 of file lpm.h.

Function Documentation

◆ lpm_drop()

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().

◆ lpm_pin_set_default_state()

void lpm_pin_set_default_state ( uint32_t  ioid)

Sets an IOID to a default state.

Parameters
ioidIOID_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.

Definition at line 566 of file lpm.c.

◆ lpm_register_module()

void lpm_register_module ( lpm_registered_module_t *  module)

Register a module for LPM notifications.

Parameters
moduleA 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.

Definition at line 545 of file lpm.c.

◆ lpm_shutdown()

void lpm_shutdown ( uint32_t  wakeup_pin,
uint32_t  io_pull,
uint32_t  wake_on 
)

Put the chip in shutdown power mode.

Parameters
wakeup_pinThe GPIO pin which will wake us up. Must be IOID_0 etc...
io_pullPull configuration for the shutdown pin: IOC_NO_IOPULL, IOC_IOPULL_UP or IOC_IOPULL_DOWN
wake_onHigh or Low (IOC_WAKE_ON_LOW or IOC_WAKE_ON_HIGH)

Definition at line 83 of file lpm.c.

◆ lpm_unregister_module()

void lpm_unregister_module ( lpm_registered_module_t *  module)

Unregister a module from LPM notifications.

Parameters
moduleA pointer to the data structure with the module definition

When a previously registered module is no longer interested in LPM notifications, this function can be used to unregister it.

Definition at line 551 of file lpm.c.