Contiki-NG
Loading...
Searching...
No Matches

Driver for the cc2538 power modes. More...

Files

file  arch/cpu/cc2538/lpm.c
 Implementation of low power modes ofr the cc2538.
file  arch/cpu/cc2538/lpm.h
 Header file with register, macro and function declarations for the cc2538 low power module.

Functions

void clock_adjust (void)
 Adjust the clock following missed SysTick ISRs.
static void enter_pm0 (void)
static void select_32_mhz_xosc (void)
static void select_16_mhz_rcosc (void)
void lpm_exit ()
void lpm_enter ()
void lpm_init ()

Detailed Description

Driver for the cc2538 power modes.

Function Documentation

◆ clock_adjust()

void clock_adjust ( void )

Adjust the clock following missed SysTick ISRs.

This function is useful when coming out of PM1/2, during which the system clock is stopped. We adjust the clock counters like after any SysTick ISR.

Note
This function is only meant to be used by lpm_exit(). Applications should really avoid calling this

Definition at line 224 of file clock.c.

References update_ticks().

Referenced by lpm_exit().

◆ enter_pm0()

void enter_pm0 ( void )
static

< Set to 1 to enable LPM-related stats

Definition at line 117 of file lpm.c.

References LPM_CONF_STATS, and RTIMER_NOW.

Referenced by lpm_enter().

◆ lpm_enter()

void lpm_enter ( )

< Radio status register

< FIFO and FFCTRL status

< Power Mode Control

< PM2

< Power Mode Control

< PM1

< Set to 1 to enable LPM-related stats

< Power Mode Control

< PM0

< Power Mode Control

< PM3

< PM1

Definition at line 226 of file lpm.c.

References enter_pm0(), LPM_CONF_STATS, process_nevents(), RFCORE_XREG_FSMSTAT0, RFCORE_XREG_FSMSTAT0_FSM_FFCTRL_STATE, rtimer_arch_next_trigger(), RTIMER_NOW, select_16_mhz_rcosc(), select_32_mhz_xosc(), SYS_CTRL_PMCTL, SYS_CTRL_PMCTL_PM0, SYS_CTRL_PMCTL_PM1, SYS_CTRL_PMCTL_PM2, and SYS_CTRL_PMCTL_PM3.

Referenced by platform_idle().

◆ lpm_exit()

void lpm_exit ( )

< Power Mode Control

< PM3

< PM0

< Clock status register

< Clock status register

< Power Mode Control

< PM3

< PM1

< Power Mode Control

< PM0

Definition at line 187 of file lpm.c.

References clock_adjust(), RTIMER_NOW, select_32_mhz_xosc(), SYS_CTRL_CLOCK_STA, SYS_CTRL_PMCTL, SYS_CTRL_PMCTL_PM0, SYS_CTRL_PMCTL_PM1, and SYS_CTRL_PMCTL_PM3.

Referenced by gpio_port_isr(), and rtimer_isr().

◆ lpm_init()

void lpm_init ( void )

< Power Mode Control

< PM0

Definition at line 356 of file lpm.c.

References LPM_CONF_MAX_PM, SYS_CTRL_PMCTL, and SYS_CTRL_PMCTL_PM0.

Referenced by platform_init_stage_one(), and soc_init().

◆ select_16_mhz_rcosc()

void select_16_mhz_rcosc ( void )
static

< Clock control register

< Clock control register

< Clock status register

< Clock control register

< Clock status register

Definition at line 158 of file lpm.c.

References SYS_CTRL_CLOCK_CTRL, and SYS_CTRL_CLOCK_STA.

Referenced by lpm_enter().

◆ select_32_mhz_xosc()

void select_32_mhz_xosc ( void )
static

< Clock status register

< Clock control register

< Clock status register

< Clock control register

< Clock control register

Definition at line 135 of file lpm.c.

References SYS_CTRL_CLOCK_CTRL, and SYS_CTRL_CLOCK_STA.

Referenced by lpm_enter(), and lpm_exit().