/** | |
* @file : gsw_pm_interface.h | |
* @brief : sleep and wakeup | |
* @date : | |
* @author : wind | |
* @version : v1.0 | |
* @copyright | |
*/ | |
#ifndef _GSW_PMYKSDK_H | |
#define _GSW_PMYKSDK_H | |
#include "gsw_hal_errcode.h" | |
#define GSW_PM_SUCCESS GSW_HAL_SUCCESS | |
#define GSW_PM_FAIL GSW_HAL_NORMAL_FAIL | |
typedef enum | |
{ | |
GSW_PM_LPM_FALLING = 0, /**< falling edge,modem go to sleep*/ | |
GSW_PM_LPM_RISING = 1, /**< rising edge,modem exit sleep*/ | |
}GSW_PM_WAKEUP_IN_STATUS_T; | |
/** | |
* @brief when modem wakeup callback | |
* @param [in] int wakeup_in IO state, 0:sleep,1:exit sleep | |
* @retval 0: success | |
* @retval other: fail | |
*/ | |
typedef void (* gsw_pm_wakeup_handler)(int); | |
/** | |
* @brief lpm sdk init | |
* @param [in] gswPmCallBack modem wakeup callback | |
* @retval 0: success | |
* @retval other: fail | |
*/ | |
int gswPmSDKInit(gsw_pm_wakeup_handler gswPmCallBack); | |
/** | |
* @brief enable system autosleep | |
* @details E02 and E06 unused | |
* | |
* @param | |
* @retval 0: success | |
* @retval other: fail | |
*/ | |
int gswAutoSleepEnable(void); | |
/** | |
* @brief disable system autosleep | |
* @details E02 and E06 unused | |
* | |
* @param | |
* @retval 0: success | |
* @retval other: fail | |
*/ | |
int gswAutoSleepDisable(void); | |
/** | |
* @brief release system sleeplock then canbe sleep | |
* @param | |
* @retval void | |
*/ | |
void gswPMStartSleep(void); | |
/** | |
* @brief keep system sleeplock to avoid sleep | |
* @param | |
* @retval 0: success | |
* @retval other: fail | |
*/ | |
int gswPMStopSleep(void); | |
#endif | |