PAN1080 Peripheral API
pan_lp.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Panchip Technology Corp. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef __PAN_LP_H__
16#define __PAN_LP_H__
17
23#ifdef __cplusplus
24extern "C"
25{
26#endif
27
28
29#define LP_EXT_P56_WK_EN (1)
30#define LP_EXT_P56_WK_DISABLE (0)
35#define LP_EXT_P56_WK_EDGE_LOW (0)
36#define LP_EXT_P56_WK_EDGE_HIGH (1)
42#define LP_WKUP_MODE_SEL_GPIO_P56 (0)
43#define LP_WKUP_MODE_SEL_32K (1)
44#define LP_WKUP_MODE_SEL_GPIO (2)
45#define LP_WKUP_MODE_SEL_WDT (3)
46#define LP_WKUP_MODE_SEL_TIMER (4)
47#define LP_WKUP_MODE_SEL_KSCAN (5)
48#define LP_WKUP_MODE_SEL_QDEC (6)
59__STATIC_INLINE void LP_EnableInt(ANA_T *ana,uint32_t u32Mask)
60{
61 ana->LP_INT_CTRL |= u32Mask;
62}
63
70__STATIC_INLINE void LP_ClearWakeFlag(ANA_T *ana,uint32_t u32Mask)
71{
72 ana->LP_INT_CTRL = (ana->LP_INT_CTRL & (~(ANAC_INT_STANDBY_INT_FLG_Msk |
73 ANAC_INT_SLEEP_INT_FLG_Msk | ANAC_INT_P56_WKUP_FLG_Msk |
74 ANAC_INT_TMR32K_WKUP_FLG_Msk | ANAC_SRAM_RETENTION_FLG_Msk))) | u32Mask;
75}
76
82__STATIC_INLINE void LP_RequestDeepSleep(ANA_T *ana)
83{
84 ana->LP_FL_CTRL |= ANAC_FL_DEEPSLEEP_REQUEST_Msk;
85}
86
93__STATIC_INLINE void LP_ResetDigital(ANA_T *ana,FunctionalState NewState)
94{
95 (NewState)?(ana->LP_RST_CTRL |= ANAC_DIG_RST_EN_Msk):(ana->LP_RST_CTRL &= ~ANAC_DIG_RST_EN_Msk);
96}
97
105void LP_SetExternalWake(ANA_T *ana,FunctionalState NewState,uint8_t WkEdge);
106
113void LP_SetSleepTime(ANA_T *ana,uint32_t u32ClkCnt);
114
121void LP_SetDigitalDelay(ANA_T *ana,uint16_t u16Clk32Cnt);
122
131void LP_SetSleepModeConfig(ANA_T *ana,uint32_t wkMode,bool enterCyclically);
140void LP_SetDeepSleepConfig(ANA_T *ana,uint32_t wkMode,bool enterCyclically);
148void LP_SetStandbyConfig(ANA_T *ana,uint32_t wkMode, uint8_t PowerCtrl);
149
156void LP_SetStandbyMode0Config(ANA_T *ana,uint32_t wkMode);
157
164void LP_SetStandbyMode1Config(ANA_T *ana,uint32_t wkMode);
165
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* __PAN_LP_H__ */
172
__STATIC_INLINE void LP_RequestDeepSleep(ANA_T *ana)
This function request to enter deepsleep.
Definition: pan_lp.h:82
void LP_SetDeepSleepConfig(ANA_T *ana, uint32_t wkMode, bool enterCyclically)
This function set deep sleep mode config.
__STATIC_INLINE void LP_EnableInt(ANA_T *ana, uint32_t u32Mask)
This function enable lowpower intterrupt.
Definition: pan_lp.h:59
void LP_SetDigitalDelay(ANA_T *ana, uint16_t u16Clk32Cnt)
This function used to set digital reset time.
void LP_SetSleepModeConfig(ANA_T *ana, uint32_t wkMode, bool enterCyclically)
This function set sleep mode config.
__STATIC_INLINE void LP_ResetDigital(ANA_T *ana, FunctionalState NewState)
This function request to reset digital.
Definition: pan_lp.h:93
__STATIC_INLINE void LP_ClearWakeFlag(ANA_T *ana, uint32_t u32Mask)
This function wait to clear wake up flag.
Definition: pan_lp.h:70
void LP_SetStandbyConfig(ANA_T *ana, uint32_t wkMode, uint8_t PowerCtrl)
This function set standby mode config.
void LP_SetStandbyMode1Config(ANA_T *ana, uint32_t wkMode)
This function set standby mode1 config.
void LP_SetSleepTime(ANA_T *ana, uint32_t u32ClkCnt)
This function set sleep time.
void LP_SetStandbyMode0Config(ANA_T *ana, uint32_t wkMode)
This function set standby mode0 config.
void LP_SetExternalWake(ANA_T *ana, FunctionalState NewState, uint8_t WkEdge)
This function enable gpio p56 wake up.