A31G11x F/W Packages  2.5.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31G11x_hal_sculv.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _SCULV_H_
36 #define _SCULV_H_
37 
38 #include "A31G11x.h"
39 #include "A31G11x_hal_aa_types.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 //******************************************************************************
46 // Constant
47 //******************************************************************************
48 
49 // LVI Enable/Disable Control
50 /*
51 #define LVI_DIS (0x00uL << 7)
52 #define LVI_EN (0x01uL << 7)
53 */
54 #define LVIEN_Disable (SCULV_LVICR_LVIEN_Disable << SCULV_LVICR_LVIEN_Pos)
55 #define LVIEN_Enable (SCULV_LVICR_LVIEN_Enable << SCULV_LVICR_LVIEN_Pos)
56 
57 // LVI Interrupt Enable/Disable Control
58 /*
59 #define LVI_INT_DIS (0x00uL << 5)
60 #define LVI_INT_EN (0x01uL << 5)
61 */
62 #define LVINTEN_Disable (SCULV_LVICR_LVINTEN_Disable << SCULV_LVICR_LVINTEN_Pos)
63 #define LVINTEN_Enable (SCULV_LVICR_LVINTEN_Enable << SCULV_LVICR_LVINTEN_Pos)
64 
65 // LVI Voltage Selection Control
66 /*
67 #define LV_1DOT88 (0x03uL)
68 #define LV_2DOT00 (0x04uL)
69 #define LV_2DOT13 (0x05uL)
70 #define LV_2DOT28 (0x06uL)
71 #define LV_2DOT46 (0x07uL)
72 #define LV_2DOT67 (0x08uL)
73 #define LV_3DOT04 (0x09uL)
74 #define LV_3DOT20 (0x0AuL)
75 #define LV_3DOT55 (0x0BuL)
76 #define LV_3DOT75 (0x0CuL)
77 #define LV_3DOT99 (0x0DuL)
78 #define LV_4DOT25 (0x0EuL)
79 #define LV_4DOT55 (0x0FuL)
80 */
81 #define LVIVS_2p00V (SCULV_LVICR_LVIVS_2p00V << SCULV_LVICR_LVIVS_Pos) // 2.00V */
82 #define LVIVS_2p13V (SCULV_LVICR_LVIVS_2p13V << SCULV_LVICR_LVIVS_Pos) // 2.13V */
83 #define LVIVS_2p28V (SCULV_LVICR_LVIVS_2p28V << SCULV_LVICR_LVIVS_Pos) // 2.28V */
84 #define LVIVS_2p46V (SCULV_LVICR_LVIVS_2p46V << SCULV_LVICR_LVIVS_Pos) // 2.46V */
85 #define LVIVS_2p67V (SCULV_LVICR_LVIVS_2p67V << SCULV_LVICR_LVIVS_Pos) // 2.67V */
86 #define LVIVS_3p04V (SCULV_LVICR_LVIVS_3p04V << SCULV_LVICR_LVIVS_Pos) // 3.04V */
87 #define LVIVS_3p20V (SCULV_LVICR_LVIVS_3p20V << SCULV_LVICR_LVIVS_Pos) // 3.20V */
88 #define LVIVS_3p55V (SCULV_LVICR_LVIVS_3p55V << SCULV_LVICR_LVIVS_Pos) // 3.55V */
89 #define LVIVS_3p75V (SCULV_LVICR_LVIVS_3p75V << SCULV_LVICR_LVIVS_Pos) // 3.75V */
90 #define LVIVS_3p99V (SCULV_LVICR_LVIVS_3p99V << SCULV_LVICR_LVIVS_Pos) // 3.99V */
91 #define LVIVS_4p25V (SCULV_LVICR_LVIVS_4p25V << SCULV_LVICR_LVIVS_Pos) // 4.25V */
92 #define LVIVS_4p55V (SCULV_LVICR_LVIVS_4p55V << SCULV_LVICR_LVIVS_Pos) // 4.55V */
93 
94 //******************************************************************************
95 // Macro
96 //******************************************************************************
97 
98 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
102 #define SCULV_DisLVR() (SCULV->LVRCR_b.LVREN = 0x55)
103 #define SCULV_EnLVR() (SCULV->LVRCR_b.LVREN = 0x8A)
104 
105 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
109 #define SCULV_EnLviInt() (SCULV->LVICR_b.LVINTEN = 1)
110 #define SCULV_DisLviInt() (SCULV->LVICR_b.LVINTEN = 0)
111 
112 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
116 #define SCULV_GetLviFlag() (SCULV->LVICR_b.LVIFLAG)
117 #define SCULV_ClrLviFlag() (SCULV->LVICR_b.LVIFLAG = 1)
118 
119 //******************************************************************************
120 // Function
121 //******************************************************************************
122 
123 void HAL_LVI_Init( uint32_t u32LviEnBit, uint32_t u32LviIntEnBit, uint32_t u32LviLevel );
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* _SCULV_H_ */
130 
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
void HAL_LVI_Init(uint32_t u32LviEnBit, uint32_t u32LviIntEnBit, uint32_t u32LviLevel)
Set LVI Block Enable/Disable and Voltage Level.