72 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/****************************************************************************
 | 
						|
 | 
						|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
 | 
						|
 | 
						|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
 | 
						|
be copied by any method or incorporated into another program without
 | 
						|
the express written consent of Aerospace C.Power. This Information or any portion
 | 
						|
thereof remains the property of Aerospace C.Power. The Information contained herein
 | 
						|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
 | 
						|
liability for its use in any way and conveys no license or title under
 | 
						|
any patent or copyright and makes no representation or warranty that this
 | 
						|
Information is free from patent or copyright infringement.
 | 
						|
 | 
						|
****************************************************************************/
 | 
						|
#ifndef IOT_PLC_PM_H
 | 
						|
#define IOT_PLC_PM_H
 | 
						|
 | 
						|
#include "iot_config.h"
 | 
						|
#include "iot_plc_pm_api.h"
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
/* define supported internal pm request */
 | 
						|
/* plc led init status */
 | 
						|
#define IOT_PLC_PM_REQ_OFF_TRIG           0x00
 | 
						|
/* timer message request */
 | 
						|
#define IOT_PLC_PM_REQ_OFF_STATUS         0x01
 | 
						|
 | 
						|
/* pack for the structures */
 | 
						|
#pragma pack(push)  /* save the pack status */
 | 
						|
#pragma pack(1)     /* 1 byte align */
 | 
						|
 | 
						|
/* pm message header */
 | 
						|
typedef struct _pm_msg_hdr {
 | 
						|
    /* request id */
 | 
						|
    uint8_t req_id;
 | 
						|
    /* message id */
 | 
						|
    uint8_t msg_id;
 | 
						|
} pm_msg_hdr_t;
 | 
						|
 | 
						|
#pragma pack(pop)    /* restore the pack status */
 | 
						|
 | 
						|
#if PLC_SUPPORT_PM
 | 
						|
 | 
						|
/* @brief   init plc pm module */
 | 
						|
void iot_plc_pm_init();
 | 
						|
 | 
						|
/* @brief get power recover time
 | 
						|
 * @retval:   0 - invalid, other - the os time for power recover, unit is ms.
 | 
						|
 */
 | 
						|
uint64_t iot_plc_pm_get_power_recover_time(void);
 | 
						|
 | 
						|
#else /* PLC_SUPPORT_PM */
 | 
						|
 | 
						|
#define iot_plc_pm_init()
 | 
						|
 | 
						|
/* @brief get power recover time
 | 
						|
 * @retval:   0 - invalid, other - the os time for power recover, unit is ms.
 | 
						|
 */
 | 
						|
uint64_t iot_plc_pm_get_power_recover_time(void);
 | 
						|
 | 
						|
#endif /* PLC_SUPPORT_PM */
 | 
						|
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif /* IOT_PLC_PM_H */
 |