RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
pm.h 文件参考
#include <stdint.h>
#include <rtthread.h>
#include <drivers/lptimer.h>
+ pm.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  rt_pm_ops
 
struct  rt_device_pm_ops
 
struct  rt_device_pm
 
struct  rt_pm_module
 
struct  rt_pm
 
struct  rt_pm_notify
 

宏定义

#define PM_SLEEP_MODE_NAMES
 
#define PM_RUN_MODE_NAMES
 
#define RT_PM_DEFAULT_SLEEP_MODE   PM_SLEEP_MODE_NONE
 
#define RT_PM_DEFAULT_DEEPSLEEP_MODE   PM_SLEEP_MODE_DEEP
 
#define RT_PM_DEFAULT_RUN_MODE   PM_RUN_MODE_NORMAL_SPEED
 
#define RT_PM_DEVICE_CTRL_RELEASE   (RT_DEVICE_CTRL_BASE(PM) + 0x00)
 
#define RT_PM_DEVICE_CTRL_REQUEST   (RT_DEVICE_CTRL_BASE(PM) + 0x01)
 

枚举

enum  {
  PM_SLEEP_MODE_NONE = 0 , PM_SLEEP_MODE_IDLE , PM_SLEEP_MODE_LIGHT , PM_SLEEP_MODE_DEEP ,
  PM_SLEEP_MODE_STANDBY , PM_SLEEP_MODE_SHUTDOWN , PM_SLEEP_MODE_MAX
}
 
enum  {
  PM_RUN_MODE_HIGH_SPEED = 0 , PM_RUN_MODE_NORMAL_SPEED , PM_RUN_MODE_MEDIUM_SPEED , PM_RUN_MODE_LOW_SPEED ,
  PM_RUN_MODE_MAX
}
 
enum  { RT_PM_FREQUENCY_PENDING = 0x01 }
 
enum  pm_module_id {
  PM_NONE_ID = 0 , PM_POWER_ID , PM_BOARD_ID , PM_BSP_ID ,
  PM_MAIN_ID , PM_PMS_ID , PM_PMC_ID , PM_TASK_ID ,
  PM_SPI_ID , PM_I2C_ID , PM_UART_ID , PM_CAN_ID ,
  PM_ETH_ID , PM_SENSOR_ID , PM_LCD_ID , PM_KEY_ID ,
  PM_TP_ID , PM_MODULE_MAX_ID
}
 
enum  { RT_PM_ENTER_SLEEP = 0 , RT_PM_EXIT_SLEEP }
 

函数

rt_err_t rt_pm_request (rt_uint8_t sleep_mode)
 
rt_err_t rt_pm_release (rt_uint8_t sleep_mode)
 
rt_err_t rt_pm_release_all (rt_uint8_t sleep_mode)
 
rt_err_t rt_pm_run_enter (rt_uint8_t run_mode)
 
void rt_pm_device_register (struct rt_device *device, const struct rt_device_pm_ops *ops)
 
void rt_pm_device_unregister (struct rt_device *device)
 
void rt_pm_notify_set (void(*notify)(rt_uint8_t event, rt_uint8_t mode, void *data), void *data)
 
void rt_pm_default_set (rt_uint8_t sleep_mode)
 
void rt_system_pm_init (const struct rt_pm_ops *ops, rt_uint8_t timer_mask, void *user_data)
 
rt_err_t rt_pm_module_request (uint8_t module_id, rt_uint8_t sleep_mode)
 
rt_err_t rt_pm_module_release (uint8_t module_id, rt_uint8_t sleep_mode)
 
rt_err_t rt_pm_module_release_all (uint8_t module_id, rt_uint8_t sleep_mode)
 
void rt_pm_module_delay_sleep (rt_uint8_t module_id, rt_tick_t timeout)
 
rt_uint32_t rt_pm_module_get_status (void)
 
rt_uint8_t rt_pm_get_sleep_mode (void)
 
struct rt_pmrt_pm_get_handle (void)
 
rt_err_t rt_pm_sleep_request (rt_uint16_t module_id, rt_uint8_t mode)
 
rt_err_t rt_pm_sleep_release (rt_uint16_t module_id, rt_uint8_t mode)
 
rt_err_t rt_pm_sleep_none_request (rt_uint16_t module_id)
 
rt_err_t rt_pm_sleep_none_release (rt_uint16_t module_id)
 
rt_err_t rt_pm_sleep_idle_request (rt_uint16_t module_id)
 
rt_err_t rt_pm_sleep_idle_release (rt_uint16_t module_id)
 
rt_err_t rt_pm_sleep_light_request (rt_uint16_t module_id)
 
rt_err_t rt_pm_sleep_light_release (rt_uint16_t module_id)
 

宏定义说明

◆ PM_SLEEP_MODE_NAMES

#define PM_SLEEP_MODE_NAMES
值:
{ \
"None Mode", \
"Idle Mode", \
"LightSleep Mode", \
"DeepSleep Mode", \
"Standby Mode", \
"Shutdown Mode", \
}

在文件 pm.h52 行定义.

52#define PM_SLEEP_MODE_NAMES \
53{ \
54 "None Mode", \
55 "Idle Mode", \
56 "LightSleep Mode", \
57 "DeepSleep Mode", \
58 "Standby Mode", \
59 "Shutdown Mode", \
60}

◆ PM_RUN_MODE_NAMES

#define PM_RUN_MODE_NAMES
值:
{ \
"High Speed", \
"Normal Speed", \
"Medium Speed", \
"Low Mode", \
}

在文件 pm.h62 行定义.

62#define PM_RUN_MODE_NAMES \
63{ \
64 "High Speed", \
65 "Normal Speed", \
66 "Medium Speed", \
67 "Low Mode", \
68}

◆ RT_PM_DEFAULT_SLEEP_MODE

#define RT_PM_DEFAULT_SLEEP_MODE   PM_SLEEP_MODE_NONE

在文件 pm.h105 行定义.

◆ RT_PM_DEFAULT_DEEPSLEEP_MODE

#define RT_PM_DEFAULT_DEEPSLEEP_MODE   PM_SLEEP_MODE_DEEP

在文件 pm.h109 行定义.

◆ RT_PM_DEFAULT_RUN_MODE

#define RT_PM_DEFAULT_RUN_MODE   PM_RUN_MODE_NORMAL_SPEED

在文件 pm.h113 行定义.

◆ RT_PM_DEVICE_CTRL_RELEASE

#define RT_PM_DEVICE_CTRL_RELEASE   (RT_DEVICE_CTRL_BASE(PM) + 0x00)

device control flag to request or release power

在文件 pm.h119 行定义.

◆ RT_PM_DEVICE_CTRL_REQUEST

#define RT_PM_DEVICE_CTRL_REQUEST   (RT_DEVICE_CTRL_BASE(PM) + 0x01)

在文件 pm.h120 行定义.

枚举类型说明

◆ anonymous enum

anonymous enum
枚举值
PM_SLEEP_MODE_NONE 
PM_SLEEP_MODE_IDLE  
PM_SLEEP_MODE_LIGHT  
PM_SLEEP_MODE_DEEP  
PM_SLEEP_MODE_STANDBY  
PM_SLEEP_MODE_SHUTDOWN  
PM_SLEEP_MODE_MAX  

在文件 pm.h24 行定义.

25{
26 /* sleep modes */
34};
@ PM_SLEEP_MODE_STANDBY
定义 pm.h:31
@ PM_SLEEP_MODE_NONE
定义 pm.h:27
@ PM_SLEEP_MODE_LIGHT
定义 pm.h:29
@ PM_SLEEP_MODE_DEEP
定义 pm.h:30
@ PM_SLEEP_MODE_SHUTDOWN
定义 pm.h:32
@ PM_SLEEP_MODE_IDLE
定义 pm.h:28
@ PM_SLEEP_MODE_MAX
定义 pm.h:33

◆ anonymous enum

anonymous enum
枚举值
PM_RUN_MODE_HIGH_SPEED 
PM_RUN_MODE_NORMAL_SPEED  
PM_RUN_MODE_MEDIUM_SPEED  
PM_RUN_MODE_LOW_SPEED  
PM_RUN_MODE_MAX  

在文件 pm.h36 行定义.

37{
38 /* run modes*/
44};
@ PM_RUN_MODE_LOW_SPEED
定义 pm.h:42
@ PM_RUN_MODE_MAX
定义 pm.h:43
@ PM_RUN_MODE_HIGH_SPEED
定义 pm.h:39
@ PM_RUN_MODE_NORMAL_SPEED
定义 pm.h:40
@ PM_RUN_MODE_MEDIUM_SPEED
定义 pm.h:41

◆ anonymous enum

anonymous enum
枚举值
RT_PM_FREQUENCY_PENDING 0x01 

在文件 pm.h46 行定义.

47{
49};
@ RT_PM_FREQUENCY_PENDING
定义 pm.h:48

◆ pm_module_id

Modules used for pm_module_request(PM_BOARD_ID, PM_SLEEP_MODE_IDLE) pm_module_release(PM_BOARD_ID, PM_SLEEP_MODE_IDLE) pm_module_release_all(PM_BOARD_ID, PM_SLEEP_MODE_IDLE)

枚举值
PM_NONE_ID 
PM_POWER_ID  
PM_BOARD_ID  
PM_BSP_ID  
PM_MAIN_ID  
PM_PMS_ID  
PM_PMC_ID  
PM_TASK_ID  
PM_SPI_ID  
PM_I2C_ID  
PM_UART_ID  
PM_CAN_ID  
PM_ETH_ID  
PM_SENSOR_ID  
PM_LCD_ID  
PM_KEY_ID  
PM_TP_ID  
PM_MODULE_MAX_ID  

在文件 pm.h77 行定义.

77 {
78 PM_NONE_ID = 0,
95 PM_MODULE_MAX_ID, /* enum must! */
96};
@ PM_PMC_ID
定义 pm.h:84
@ PM_PMS_ID
定义 pm.h:83
@ PM_LCD_ID
定义 pm.h:92
@ PM_ETH_ID
定义 pm.h:90
@ PM_SPI_ID
定义 pm.h:86
@ PM_KEY_ID
定义 pm.h:93
@ PM_POWER_ID
定义 pm.h:79
@ PM_BSP_ID
定义 pm.h:81
@ PM_MAIN_ID
定义 pm.h:82
@ PM_SENSOR_ID
定义 pm.h:91
@ PM_NONE_ID
定义 pm.h:78
@ PM_I2C_ID
定义 pm.h:87
@ PM_CAN_ID
定义 pm.h:89
@ PM_TASK_ID
定义 pm.h:85
@ PM_UART_ID
定义 pm.h:88
@ PM_MODULE_MAX_ID
定义 pm.h:95
@ PM_BOARD_ID
定义 pm.h:80
@ PM_TP_ID
定义 pm.h:94

◆ anonymous enum

anonymous enum
枚举值
RT_PM_ENTER_SLEEP 
RT_PM_EXIT_SLEEP  

在文件 pm.h187 行定义.

188{
191};
@ RT_PM_EXIT_SLEEP
定义 pm.h:190
@ RT_PM_ENTER_SLEEP
定义 pm.h:189

函数说明

◆ rt_pm_request()

rt_err_t rt_pm_request ( rt_uint8_t sleep_mode)

◆ rt_pm_release()

rt_err_t rt_pm_release ( rt_uint8_t sleep_mode)

◆ rt_pm_release_all()

rt_err_t rt_pm_release_all ( rt_uint8_t sleep_mode)

◆ rt_pm_run_enter()

rt_err_t rt_pm_run_enter ( rt_uint8_t run_mode)

◆ rt_pm_device_register()

void rt_pm_device_register ( struct rt_device * device,
const struct rt_device_pm_ops * ops )

◆ rt_pm_device_unregister()

void rt_pm_device_unregister ( struct rt_device * device)

◆ rt_pm_notify_set()

void rt_pm_notify_set ( void(* notify )(rt_uint8_t event, rt_uint8_t mode, void *data),
void * data )

◆ rt_pm_default_set()

void rt_pm_default_set ( rt_uint8_t sleep_mode)

◆ rt_system_pm_init()

void rt_system_pm_init ( const struct rt_pm_ops * ops,
rt_uint8_t timer_mask,
void * user_data )

◆ rt_pm_module_request()

rt_err_t rt_pm_module_request ( uint8_t module_id,
rt_uint8_t sleep_mode )

◆ rt_pm_module_release()

rt_err_t rt_pm_module_release ( uint8_t module_id,
rt_uint8_t sleep_mode )

◆ rt_pm_module_release_all()

rt_err_t rt_pm_module_release_all ( uint8_t module_id,
rt_uint8_t sleep_mode )

◆ rt_pm_module_delay_sleep()

void rt_pm_module_delay_sleep ( rt_uint8_t module_id,
rt_tick_t timeout )

◆ rt_pm_module_get_status()

rt_uint32_t rt_pm_module_get_status ( void )

◆ rt_pm_get_sleep_mode()

rt_uint8_t rt_pm_get_sleep_mode ( void )

◆ rt_pm_get_handle()

struct rt_pm * rt_pm_get_handle ( void )

◆ rt_pm_sleep_request()

rt_err_t rt_pm_sleep_request ( rt_uint16_t module_id,
rt_uint8_t mode )

◆ rt_pm_sleep_release()

rt_err_t rt_pm_sleep_release ( rt_uint16_t module_id,
rt_uint8_t mode )

◆ rt_pm_sleep_none_request()

rt_err_t rt_pm_sleep_none_request ( rt_uint16_t module_id)

◆ rt_pm_sleep_none_release()

rt_err_t rt_pm_sleep_none_release ( rt_uint16_t module_id)

◆ rt_pm_sleep_idle_request()

rt_err_t rt_pm_sleep_idle_request ( rt_uint16_t module_id)

◆ rt_pm_sleep_idle_release()

rt_err_t rt_pm_sleep_idle_release ( rt_uint16_t module_id)

◆ rt_pm_sleep_light_request()

rt_err_t rt_pm_sleep_light_request ( rt_uint16_t module_id)

◆ rt_pm_sleep_light_release()

rt_err_t rt_pm_sleep_light_release ( rt_uint16_t module_id)