CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
类型定义 | 函数 | 变量
ci130x_lowpower.c 文件参考
#include "ci130x_lowpower.h"
#include "ci130x_scu.h"
#include "ci_log.h"
#include "ci_assert.h"
#include <stdbool.h>
#include "FreeRTOS.h"
#include "task.h"
#include "sdk_default_config.h"
#include "ci130x_uart.h"

类型定义

typedef int32_t(* exit_low_power_mode) (void)
 
typedef void(* lower_hook_fn) (void)
 

函数

static void push_device_status (void)
 保存外设时钟gata以及NVIC 更多...
 
static void pop_device_status (void)
 恢复外设时钟gata以及NVIC 更多...
 
static int32_t switch_normal_mode (void)
 切换到正常模式 更多...
 
static int32_t exit_down_frequency_mode (void)
 
static int32_t switch_down_frequency_mode (void)
 
static int32_t exit_osc_frequency_mode (void)
 
static int32_t switch_osc_frequency_mode (void)
 
void register_lowpower_user_fn (void *enter_lowpower_fn, void *exit_lowpower_fn)
 注册进出低功耗模式切换用户扩展函数 更多...
 
static uint32_t enter_critical (void)
 
static void exit_critical (uint32_t base_pri)
 
power_mode_t power_mode_switch (power_mode_t power_mode)
 切换电源模式 更多...
 
power_mode_t get_curr_power_mode (void)
 查询当前所处的模式 更多...
 

变量

static exit_low_power_mode g_switch_to_normal = NULL
 
static power_mode_t g_curr_power_mode = POWER_MODE_NORMAL
 
static volatile bool g_scu_int = false
 
static unsigned char backup_int [32]
 
static unsigned int clkgate_state [4] = {0}
 
lower_hook_fn user_enter_lowpower = NULL
 
lower_hook_fn user_exit_lowpower = NULL
 

类型定义说明

◆ exit_low_power_mode

typedef int32_t(* exit_low_power_mode) (void)

◆ lower_hook_fn

typedef void(* lower_hook_fn) (void)

函数说明

◆ enter_critical()

static uint32_t enter_critical ( void  )
static

◆ exit_critical()

static void exit_critical ( uint32_t  base_pri)
static

◆ exit_down_frequency_mode()

static int32_t exit_down_frequency_mode ( void  )
static

◆ exit_osc_frequency_mode()

static int32_t exit_osc_frequency_mode ( void  )
static

◆ pop_device_status()

static void pop_device_status ( void  )
static

恢复外设时钟gata以及NVIC

◆ push_device_status()

static void push_device_status ( void  )
static

保存外设时钟gata以及NVIC

注意
不能重复保存调用push前必须调用pop,目前由power_mode_switch保证

◆ switch_down_frequency_mode()

static int32_t switch_down_frequency_mode ( void  )
static

◆ switch_normal_mode()

static int32_t switch_normal_mode ( void  )
static

切换到正常模式

返回
int32_t

◆ switch_osc_frequency_mode()

static int32_t switch_osc_frequency_mode ( void  )
static

变量说明

◆ backup_int

unsigned char backup_int[32]
static

◆ clkgate_state

unsigned int clkgate_state[4] = {0}
static

◆ g_curr_power_mode

power_mode_t g_curr_power_mode = POWER_MODE_NORMAL
static

◆ g_scu_int

volatile bool g_scu_int = false
static

◆ g_switch_to_normal

exit_low_power_mode g_switch_to_normal = NULL
static

◆ user_enter_lowpower

lower_hook_fn user_enter_lowpower = NULL

◆ user_exit_lowpower

lower_hook_fn user_exit_lowpower = NULL