You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
software/kkk/los_lowpower.h

382 lines
13 KiB

12 months ago
/* ----------------------------------------------------------------------------
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
* Description: Low-power Framework.
* Author: Huawei LiteOS Team
* Create: 2020-09-19
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --------------------------------------------------------------------------- */
/* *
* @defgroup los_lowpower lowpower_framework
* @ingroup kernel
*/
#ifndef _LOS_LOWPOWER_H
#define _LOS_LOWPOWER_H
#include "los_base.h"
#include "los_sys.h"
#include "los_err.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
/**
* @ingroup los_lowpower
*
* Intermit modes
*/
typedef enum LOS_INTERMIT_MODE {
LOS_INTERMIT_NONE = 0,
LOS_INTERMIT_LIGHT_SLEEP, /**< Light sleep mode */
LOS_INTERMIT_DEEP_SLEEP, /**< Deep sleep mode */
LOS_INTERMIT_STANDBY, /**< Standby mode */
LOS_INTERMIT_SHUTDOWN, /**< Shutdown mode */
LOS_INTERMIT_MAX,
} LosIntermitMode;
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOS_INTERMIT_MODE <20>Ķ<EFBFBD><C4B6><EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC><EFBFBD>ö<EFBFBD>ٳ<EFBFBD><D9B3><EFBFBD><EFBFBD><EFBFBD>
LOS_INTERMIT_NONE<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ģʽ
LOS_INTERMIT_LIGHT_SLEEP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ģʽ
LOS_INTERMIT_DEEP_SLEEP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ģʽ
LOS_INTERMIT_STANDBY<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
LOS_INTERMIT_SHUTDOWN<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ػ<EFBFBD>ģʽ
LOS_INTERMIT_MAX<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ķ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
*
* System main frequency modes
*/
typedef enum LOS_FREQ_MODE {
LOS_SYS_FREQ_SUPER = 0, /**< Super high freq */
LOS_SYS_FREQ_HIGH, /**< High freq */
LOS_SYS_FREQ_NORMAL, /**< Normal freq */
LOS_SYS_FREQ_LOW, /**< Low freq */
LOS_SYS_FREQ_MAX,
} LosFreqMode;
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOS_FREQ_MODE <20>Ķ<EFBFBD><C4B6><EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC><EFBFBD>ö<EFBFBD>ٳ<EFBFBD><D9B3><EFBFBD><EFBFBD><EFBFBD>
LOS_SYS_FREQ_SUPER<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶģʽ
LOS_SYS_FREQ_HIGH<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ƶģʽ
LOS_SYS_FREQ_NORMAL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD>ģʽ
LOS_SYS_FREQ_LOW<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ƶģʽ
LOS_SYS_FREQ_MAX<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ķ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
typedef UINT32 (*LowpowerExternalVoterHandle)(VOID);
STATIC INLINE BOOL FreqHigher(LosFreqMode freq1, LosFreqMode freq2)
{
return freq1 < freq2;
}
/**
* @ingroup los_lowpower
*
* Define the structure of the power manager operations.
*/
typedef struct {
VOID (*process)(VOID); /**< Power manager framework entry interface */
VOID (*wakeupFromReset)(VOID); /**< Recovery interface used to wakeup from image */
VOID (*resumeFromInterrupt)(UINT32); /**< Recovery interface used to wakeup from interrupt */
VOID (*changeFreq)(LosFreqMode); /**< System frequency tuning interface, the param is LosFreqMode */
VOID (*deepSleepVoteBegin)(VOID); /**< Deep sleep vote mark interface */
VOID (*deepSleepVoteEnd)(VOID); /**< Deep sleep vote erase interface */
VOID (*deepSleepVoteDelay)(UINT32 tick); /**< Deep sleep vote delay interface, the param is the delayed ticks */
VOID (*registerExternalVoter)(UINT32 (*handler)(VOID)); /**< External voter registration interface */
UINT32 (*getDeepSleepVoteCount)(VOID); /**< Get deep sleep vote count interface */
UINT32 (*getSleepMode)(VOID); /**< Get sleep mode interface, the retval type is LosIntermitMode */
VOID (*setSleepMode)(UINT32 mode); /**< Set sleep mode interface, the param type is LosIntermitMode */
} PowerMgrOps;
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PowerMgrOps <20>Ķ<EFBFBD><C4B6><EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>
process<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽӿ<EFBFBD>
wakeupFromReset<EFBFBD><EFBFBD><EFBFBD>Ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>ѵĻָ<EFBFBD><EFBFBD>ӿ<EFBFBD>
resumeFromInterrupt<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>ѵĻָ<EFBFBD><EFBFBD>ӿ<EFBFBD>
changeFreq<EFBFBD><EFBFBD>ϵͳƵ<EFBFBD>ʵ<EFBFBD><EFBFBD>ڽӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ LosFreqMode
deepSleepVoteBegin<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱ<EFBFBD><EFBFBD><EFBFBD>ǽӿ<EFBFBD>
deepSleepVoteEnd<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱȡ<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
deepSleepVoteDelay<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱ<EFBFBD>ӳٽӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ӳٵ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
registerExternalVoter<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>ⲿͶƱ<EFBFBD>߽ӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ UINT32
getDeepSleepVoteCount<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UINT32
getSleepMode<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ˯<EFBFBD><EFBFBD>ģʽ<EFBFBD>ӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ LosIntermitMode
setSleepMode<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ģʽ<EFBFBD>ӿڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ LosIntermitMode*/
/**
* @ingroup los_lowpower
* @brief System main frequency tuning.
*
* @par Description:
* This API is used to tune the system main frequency.
*
* @attention None.
*
* @param freq [IN] The system frequency, corresponding to LosFreqMode.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_PowerMgrChangeFreq(LosFreqMode freq);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_PowerMgrChangeFreq<65><71>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> LosFreqMode <EFBFBD><EFBFBD><EFBFBD>͵IJ<EFBFBD><EFBFBD><EFBFBD> freq<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸı<EFBFBD>ϵͳ<EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ʡ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Vote to enter deep sleep.
*
* @par Description:
* This API is used to mark the deep sleep vote. Called when the current state is idle.
*
* @attention None.
*
* @param None.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_PowerMgrDeepSleepVoteBegin(VOID);
/**
* @ingroup los_lowpower
* @brief Erase the deep sleep vote.
*
* @par Description:
* This API is used to erase the deep sleep vote. Called when the current state is busy.
*
* @attention None.
*
* @param None.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_PowerMgrDeepSleepVoteEnd(VOID);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_PowerMgrDeepSleepVoteEnd<6E><64><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>κβ<CEBA><CEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ VOID<49><44><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>֮ǰ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>ͶƱ<EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Sleep delay vote.
*
* @par Description:
* This API is used to delay sleep vote. Called when the current state busy, but can enter sleep later.
*
* @attention None.
*
* @param tick [IN] The sleeptime.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_PowerMgrSleepDelay(UINT32 tick);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_PowerMgrSleepDelay<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> UINT32 <20><><EFBFBD>͵IJ<CDB5><C4B2><EFBFBD> tick<63><6B>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD><EFBFBD>ӳ٣<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ˯<EFBFBD><EFBFBD><EFBFBD>ӳ١<EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Register the external voter.
*
* @par Description:
* This API is used to register the external voter, provided for developers with special needs.
*
* @attention None.
*
* @param UINT32 (*)(VOID) [IN] The external voter.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_PowerMgrRegisterExtVoter(UINT32 (*)(VOID));
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_PowerMgrRegisterExtVoter<65><72>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κβ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UINT32 <EFBFBD><EFBFBD><EFBFBD>͵ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>ⲿͶƱ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>Ϊ<EFBFBD>ⲿͶƱ<EFBFBD>ߵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Get the sleep mode.
*
* @par Description:
* This API is used to get sleep mode. Developers can set different corresponding modes.
* according to the actual scene, then perform follow-up operations.
*
* @attention None.
*
* @param None.
*
* @retval #UINT32 Sleep mode, corresponding to LosIntermitMode.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern UINT32 LOS_PowerMgrGetSleepMode(VOID);
/**
* @ingroup los_lowpower
* @brief Get the deep sleep vote count.
*
* @par Description:
* This API is used to get the deep sleep vote count.
*
* @attention None.
*
* @param None.
*
* @retval #UINT32 Deep sleep vote count.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern UINT32 LOS_PowerMgrGetDeepSleepVoteCount(VOID);
/**
* @ingroup los_lowpower
* @brief Register power manager operations.
*
*
* @par Description:
* This API is used to register power manager operations or customized power manager by developers.
*
* @attention None.
*
* @param pmOps [IN] The power manager operations.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_LowpowerInit(const PowerMgrOps *pmOps);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_LowpowerInit<69><74>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> const PowerMgrOps * <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> pmOps<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD>µ<EFBFBD>ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صIJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ָ<EFBFBD>ϵͳ<EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Define the lowpower framework process function type.
*
* @par Description:
* This API is used to define the lowpower framework entry function type.
*
* @attention None.
*
* @param None.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
typedef VOID (*LowPowerHookFn)(VOID);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ LowPowerHookFn <20>ĺ<EFBFBD><C4BA><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>͡<EFBFBD>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κβ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VOID <EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ĺ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD>µĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>Ա<EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽʱִ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Register a hook to enter lowpower framework process.
*
* @par Description:
* This API is used to register lowpower framework entry function.
*
* @attention None.
*
* @param hook [IN] The lowpower framework hook.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_LowpowerHookReg(LowPowerHookFn hook);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_LowpowerHookReg<65><67>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> LowPowerHookFn <EFBFBD><EFBFBD><EFBFBD>͵IJ<EFBFBD><EFBFBD><EFBFBD> hook<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD>µĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD>µĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>Ա<EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD>͹<EFBFBD><EFBFBD><EFBFBD>ģʽʱִ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
/**
* @ingroup los_lowpower
* @brief Define the lowpower framework wakup function type.
*
* @par Description:
* This API is used to define the lowpower framework wakup function type.
*
* @attention None.
*
* @param hwiNum [IN] The interrupt number.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
typedef VOID (*IntWakeupHookFn)(HWI_HANDLE_T hwiNum);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ IntWakeupHookFn <20>ĺ<EFBFBD><C4BA><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>͡<EFBFBD>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HWI_HANDLE_T <EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VOID <EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ĺ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>жϻ<EFBFBD><EFBFBD>ѵĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>жϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱִ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
/**
* @ingroup los_lowpower
* @brief Register a hook to wakeup from interrupt.
*
* @par Description:
* This API is used to register a recovery function after wakeup from interrupt
*
* @attention None.
*
* @param hook [IN] The lowpower wakeup hook.
*
* @retval None.
* @par Dependency:
* <ul><li>los_lowpower.h: the header file that contains the API declaration.</li></ul>
* @see None.
* @since Huawei LiteOS V200R005C10
*/
extern VOID LOS_IntWakeupHookReg(IntWakeupHookFn hook);
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>extern<72><6E><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD> LOS_IntWakeupHookReg<65><67>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> IntWakeupHookFn <EFBFBD><EFBFBD><EFBFBD>͵IJ<EFBFBD><EFBFBD><EFBFBD> hook<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>жϻ<EFBFBD><EFBFBD>ѵĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>жϻ<EFBFBD><EFBFBD>ѵĹ<EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>жϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱִ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* _LOS_LOWPOWER_H */