| NANO102/112 BSP V3.04.000 The Board Support Package for Nano102/112 Series

sys.h
Go to the documentation of this file.
1/**************************************************************************/
12#ifndef __SYS_H__
13#define __SYS_H__
14
15#ifdef __cplusplus
16 extern "C"
17{
18#endif
19
32/*---------------------------------------------------------------------------------------------------------*/
33/* Module Reset Control Resister constant definitions. */
34/*---------------------------------------------------------------------------------------------------------*/
35#define CPU_RST ((0x0<<24) | SYS_IPRST_CTL1_CPU_RST_Pos )
36#define CHIP_RST ((0x0<<24) | SYS_IPRST_CTL1_CHIP_RST_Pos )
37#define DMA_RST ((0x0<<24) | SYS_IPRST_CTL1_DMA_RST_Pos )
38#define SC1_RST ((0x4<<24) | SYS_IPRST_CTL2_SC1_RST_Pos )
39#define SC0_RST ((0x4<<24) | SYS_IPRST_CTL2_SC0_RST_Pos )
40#define ADC_RST ((0x4<<24) | SYS_IPRST_CTL2_ADC_RST_Pos )
41#define LCD_RST ((0x4<<24) | SYS_IPRST_CTL2_LCD_RST_Pos )
42#define ACMP01_RST ((0x4<<24) | SYS_IPRST_CTL2_ACMP01_RST_Pos )
43#define PWM0_RST ((0x4<<24) | SYS_IPRST_CTL2_PWM0_RST_Pos )
44#define UART1_RST ((0x4<<24) | SYS_IPRST_CTL2_UART1_RST_Pos )
45#define UART0_RST ((0x4<<24) | SYS_IPRST_CTL2_UART0_RST_Pos )
46#define SPI1_RST ((0x4<<24) | SYS_IPRST_CTL2_SPI1_RST_Pos )
47#define SPI0_RST ((0x4<<24) | SYS_IPRST_CTL2_SPI0_RST_Pos )
48#define I2C1_RST ((0x4<<24) | SYS_IPRST_CTL2_I2C1_RST_Pos )
49#define I2C0_RST ((0x4<<24) | SYS_IPRST_CTL2_I2C0_RST_Pos )
50#define TMR3_RST ((0x4<<24) | SYS_IPRST_CTL2_TMR3_RST_Pos )
51#define TMR2_RST ((0x4<<24) | SYS_IPRST_CTL2_TMR2_RST_Pos )
52#define TMR1_RST ((0x4<<24) | SYS_IPRST_CTL2_TMR1_RST_Pos )
53#define TMR0_RST ((0x4<<24) | SYS_IPRST_CTL2_TMR0_RST_Pos )
54#define GPIO_RST ((0x4<<24) | SYS_IPRST_CTL2_GPIO_RST_Pos )
56/*---------------------------------------------------------------------------------------------------------*/
57/* Multi-Function constant definitions. */
58/*---------------------------------------------------------------------------------------------------------*/
59
60/********************* Bit definition of VREFCTL register **********************/
61#define SYS_VREFCTL_BGP_EN ((uint32_t)0x00000001)
62#define SYS_VREFCTL_REG_EN ((uint32_t)0x00000002)
63#define SYS_VREFCTL_SEL25 ((uint32_t)0x00000008)
64#define SYS_VREFCTL_SEL18 ((uint32_t)0x00000004)
65#define SYS_VREFCTL_SEL15 ((uint32_t)0x00000000)
66#define SYS_VREFCTL_EXTMODE ((uint32_t)0x00000010)
69/********************* Bit definition of LDOCTL register **********************/
70#define SYS_LDOCTL_LDO_PD ((uint32_t)0x00000001)
71#define SYS_LDOCTL_LDO_LEVEL16 ((uint32_t)0x00000004)
72#define SYS_LDOCTL_LDO_LEVEL18 ((uint32_t)0x00000008)
75/********************* Bit definition of IRCTRIMCTL register **********************/
76#define SYS_IRCTRIMCTL_TRIM_11_0592M ((uint32_t)0x00000001)
77#define SYS_IRCTRIMCTL_TRIM_12M ((uint32_t)0x00000002)
78#define SYS_IRCTRIMCTL_TRIM_16M ((uint32_t)0x00000003)
80#define SYS_IRCTRIMCTL_LOOP_4CLK ((uint32_t)0x00000000)
81#define SYS_IRCTRIMCTL_LOOP_8CLK ((uint32_t)0x00000010)
82#define SYS_IRCTRIMCTL_LOOP_16CLK ((uint32_t)0x00000020)
83#define SYS_IRCTRIMCTL_LOOP_32CLK ((uint32_t)0x00000030)
85#define SYS_IRCTRIMCTL_RETRY_64 ((uint32_t)0x00000000)
86#define SYS_IRCTRIMCTL_RETRY_128 ((uint32_t)0x00000040)
87#define SYS_IRCTRIMCTL_RETRY_256 ((uint32_t)0x00000080)
88#define SYS_IRCTRIMCTL_RETRY_512 ((uint32_t)0x000000C0)
90#define SYS_IRCTRIMCTL_CLKERR_STOP ((uint32_t)0x00000100)
92/********************* Bit definition of IRCTRIMIEN register **********************/
93#define SYS_IRCTRIMIEN_DISABLE ((uint32_t)0x00000000)
94#define SYS_IRCTRIMIEN_FAIL_EN ((uint32_t)0x00000002)
95#define SYS_IRCTRIMIEN_32KERR_EN ((uint32_t)0x00000004)
97/********************* Bit definition of IRCTRIMINT register **********************/
98#define SYS_IRCTRIMINT_FREQLOCK ((uint32_t)0x00000001)
99#define SYS_IRCTRIMINT_FAIL_INT ((uint32_t)0x00000002)
100#define SYS_IRCTRIMINT_32KERR_INT ((uint32_t)0x00000004)
102/********************* Bit definition of PA_L_MFP register **********************/
103#define SYS_PA_L_MFP_PA7_MFP_GPA7 (0UL<<SYS_PA_L_MFP_PA7_MFP_Pos)
104#define SYS_PA_L_MFP_PA7_MFP_ADC_CH7 (2UL<<SYS_PA_L_MFP_PA7_MFP_Pos)
105#define SYS_PA_L_MFP_PA7_MFP_SC1_CD (4UL<<SYS_PA_L_MFP_PA7_MFP_Pos)
108#define SYS_PA_L_MFP_PA6_MFP_GPA6 (0UL<<SYS_PA_L_MFP_PA6_MFP_Pos)
109#define SYS_PA_L_MFP_PA6_MFP_ADC_CH6 (2UL<<SYS_PA_L_MFP_PA6_MFP_Pos)
110#define SYS_PA_L_MFP_PA6_MFP_ACMP0_O (3UL<<SYS_PA_L_MFP_PA6_MFP_Pos)
111#define SYS_PA_L_MFP_PA6_MFP_SC0_RST (4UL<<SYS_PA_L_MFP_PA6_MFP_Pos)
112#define SYS_PA_L_MFP_PA6_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA6_MFP_Pos)
115#define SYS_PA_L_MFP_PA5_MFP_GPA5 (0UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
116#define SYS_PA_L_MFP_PA5_MFP_ADC_CH5 (2UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
117#define SYS_PA_L_MFP_PA5_MFP_ACMP0_N (3UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
118#define SYS_PA_L_MFP_PA5_MFP_SC0_PWR (4UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
119#define SYS_PA_L_MFP_PA5_MFP_I2C1_SDA (5UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
120#define SYS_PA_L_MFP_PA5_MFP_SPI1_SS0 (6UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
121#define SYS_PA_L_MFP_PA5_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA5_MFP_Pos)
123#define SYS_PA_L_MFP_PA4_MFP_GPA4 (0UL<<SYS_PA_L_MFP_PA4_MFP_Pos)
124#define SYS_PA_L_MFP_PA4_MFP_ADC_CH4 (2UL<<SYS_PA_L_MFP_PA4_MFP_Pos)
125#define SYS_PA_L_MFP_PA4_MFP_ACMP0_P (3UL<<SYS_PA_L_MFP_PA4_MFP_Pos)
126#define SYS_PA_L_MFP_PA4_MFP_SC0_CD (4UL<<SYS_PA_L_MFP_PA4_MFP_Pos)
127#define SYS_PA_L_MFP_PA4_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA4_MFP_Pos)
129#define SYS_PA_L_MFP_PA3_MFP_GPA3 (0UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
130#define SYS_PA_L_MFP_PA3_MFP_EINT1 (1UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
131#define SYS_PA_L_MFP_PA3_MFP_ADC_CH3 (2UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
132#define SYS_PA_L_MFP_PA3_MFP_ACMP0_P (3UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
133#define SYS_PA_L_MFP_PA3_MFP_SC0_DAT (4UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
134#define SYS_PA_L_MFP_PA3_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA3_MFP_Pos)
136#define SYS_PA_L_MFP_PA2_MFP_GPA2 (0UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
137#define SYS_PA_L_MFP_PA2_MFP_EINT0 (1UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
138#define SYS_PA_L_MFP_PA2_MFP_ADC_CH2 (2UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
139#define SYS_PA_L_MFP_PA2_MFP_ACMP0_P (3UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
140#define SYS_PA_L_MFP_PA2_MFP_SC0_CLK (4UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
141#define SYS_PA_L_MFP_PA2_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA2_MFP_Pos)
143#define SYS_PA_L_MFP_PA1_MFP_GPA1 (0UL<<SYS_PA_L_MFP_PA1_MFP_Pos)
144#define SYS_PA_L_MFP_PA1_MFP_ADC_CH1 (2UL<<SYS_PA_L_MFP_PA1_MFP_Pos)
145#define SYS_PA_L_MFP_PA1_MFP_ACMP0_P (3UL<<SYS_PA_L_MFP_PA1_MFP_Pos)
146#define SYS_PA_L_MFP_PA1_MFP_ACMP0_C (9UL<<SYS_PA_L_MFP_PA1_MFP_Pos)
148#define SYS_PA_L_MFP_PA0_MFP_GPA0 (0UL<<SYS_PA_L_MFP_PA0_MFP_Pos)
149#define SYS_PA_L_MFP_PA0_MFP_ADC_CH0 (2UL<<SYS_PA_L_MFP_PA0_MFP_Pos)
151/********************* Bit definition of PA_H_MFP register **********************/
152#define SYS_PA_H_MFP_PA15_MFP_GPA15 (0UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
153#define SYS_PA_H_MFP_PA15_MFP_TMR3_CAP (2UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
154#define SYS_PA_H_MFP_PA15_MFP_ACMP1_O (3UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
155#define SYS_PA_H_MFP_PA15_MFP_I2C1_SDA (5UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
156#define SYS_PA_H_MFP_PA15_MFP_SPI1_SS0 (6UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
157#define SYS_PA_H_MFP_PA15_MFP_LCD_S16 (8UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
158#define SYS_PA_H_MFP_PA15_MFP_LCD_S30 (8UL<<SYS_PA_H_MFP_PA15_MFP_Pos)
160#define SYS_PA_H_MFP_PA14_MFP_GPA14 (0UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
161#define SYS_PA_H_MFP_PA14_MFP_I2C1_SCL (5UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
162#define SYS_PA_H_MFP_PA14_MFP_SPI1_SCLK (6UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
163#define SYS_PA_H_MFP_PA14_MFP_LCD_S17 (8UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
164#define SYS_PA_H_MFP_PA14_MFP_LCD_S31 (8UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
165#define SYS_PA_H_MFP_PA14_MFP_ACMP0_C (9UL<<SYS_PA_H_MFP_PA14_MFP_Pos)
167#define SYS_PA_H_MFP_PA13_MFP_GPA13 (0UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
168#define SYS_PA_H_MFP_PA13_MFP_ACMP1_N (3UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
169#define SYS_PA_H_MFP_PA13_MFP_I2C0_SDA (5UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
170#define SYS_PA_H_MFP_PA13_MFP_SPI1_MISO0 (6UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
171#define SYS_PA_H_MFP_PA13_MFP_UART0_RX (7UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
172#define SYS_PA_H_MFP_PA13_MFP_LCD_S18 (8UL<<SYS_PA_H_MFP_PA13_MFP_Pos)
174#define SYS_PA_H_MFP_PA12_MFP_GPA12 (0UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
175#define SYS_PA_H_MFP_PA12_MFP_ACMP1_P (3UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
176#define SYS_PA_H_MFP_PA12_MFP_I2C0_SCL (5UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
177#define SYS_PA_H_MFP_PA12_MFP_SPI1_MOSI0 (6UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
178#define SYS_PA_H_MFP_PA12_MFP_UART0_TX (7UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
179#define SYS_PA_H_MFP_PA12_MFP_LCD_S19 (8UL<<SYS_PA_H_MFP_PA12_MFP_Pos)
181#define SYS_PA_H_MFP_PA11_MFP_GPA11 (0UL<<SYS_PA_H_MFP_PA11_MFP_Pos)
182#define SYS_PA_H_MFP_PA11_MFP_ADC_EXT (2UL<<SYS_PA_H_MFP_PA11_MFP_Pos)
183#define SYS_PA_H_MFP_PA11_MFP_SC0_DAT (4UL<<SYS_PA_H_MFP_PA11_MFP_Pos)
185#define SYS_PA_H_MFP_PA10_MFP_GPA10 (0UL<<SYS_PA_H_MFP_PA10_MFP_Pos)
186#define SYS_PA_H_MFP_PA10_MFP_SC0_CLK (4UL<<SYS_PA_H_MFP_PA10_MFP_Pos)
188#define SYS_PA_H_MFP_PA9_MFP_GPA9 (0UL<<SYS_PA_H_MFP_PA9_MFP_Pos)
189#define SYS_PA_H_MFP_PA9_MFP_SC0_RST (4UL<<SYS_PA_H_MFP_PA9_MFP_Pos)
191#define SYS_PA_H_MFP_PA8_MFP_GPA8 (0UL<<SYS_PA_H_MFP_PA8_MFP_Pos)
192#define SYS_PA_H_MFP_PA8_MFP_SC0_PWR (4UL<<SYS_PA_H_MFP_PA8_MFP_Pos)
194/********************* Bit definition of PB_L_MFP register **********************/
195#define SYS_PB_L_MFP_PB7_MFP_GPB7 (0UL<<SYS_PB_L_MFP_PB7_MFP_Pos)
196#define SYS_PB_L_MFP_PB7_MFP_SC0_CD (4UL<<SYS_PB_L_MFP_PB7_MFP_Pos)
197#define SYS_PB_L_MFP_PB7_MFP_UART1_CTS (7UL<<SYS_PB_L_MFP_PB7_MFP_Pos)
198#define SYS_PB_L_MFP_PB7_MFP_LCD_S33 (8UL<<SYS_PB_L_MFP_PB7_MFP_Pos)
200#define SYS_PB_L_MFP_PB6_MFP_GPB6 (0UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
201#define SYS_PB_L_MFP_PB6_MFP_CKO0 (1UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
202#define SYS_PB_L_MFP_PB6_MFP_SPI1_SS1 (6UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
203#define SYS_PB_L_MFP_PB6_MFP_UART1_TX (7UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
204#define SYS_PB_L_MFP_PB6_MFP_LCD_S25 (8UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
205#define SYS_PB_L_MFP_PB6_MFP_LCD_S34 (8UL<<SYS_PB_L_MFP_PB6_MFP_Pos)
207#define SYS_PB_L_MFP_PB5_MFP_GPB5 (0UL<<SYS_PB_L_MFP_PB5_MFP_Pos)
208#define SYS_PB_L_MFP_PB5_MFP_SPI1_MOSI1 (6UL<<SYS_PB_L_MFP_PB5_MFP_Pos)
209#define SYS_PB_L_MFP_PB5_MFP_UART1_RX (7UL<<SYS_PB_L_MFP_PB5_MFP_Pos)
210#define SYS_PB_L_MFP_PB5_MFP_LCD_S35 (8UL<<SYS_PB_L_MFP_PB5_MFP_Pos)
212#define SYS_PB_L_MFP_PB4_MFP_GPB4 (0UL<<SYS_PB_L_MFP_PB4_MFP_Pos)
213#define SYS_PB_L_MFP_PB4_MFP_SPI1_MISO1 (6UL<<SYS_PB_L_MFP_PB4_MFP_Pos)
214#define SYS_PB_L_MFP_PB4_MFP_UART1_RTS (7UL<<SYS_PB_L_MFP_PB4_MFP_Pos)
216#define SYS_PB_L_MFP_PB3_MFP_GPB3 (0UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
217#define SYS_PB_L_MFP_PB3_MFP_TMR2_CNT (2UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
218#define SYS_PB_L_MFP_PB3_MFP_I2C0_SDA (5UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
219#define SYS_PB_L_MFP_PB3_MFP_SPI1_MISO1 (6UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
220#define SYS_PB_L_MFP_PB3_MFP_UART0_CTS (7UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
221#define SYS_PB_L_MFP_PB3_MFP_LCD_S26 (8UL<<SYS_PB_L_MFP_PB3_MFP_Pos)
222#define SYS_PB_L_MFP_PB3_MFP_TMR2_OUT (0xAUL<<SYS_PB_L_MFP_PB3_MFP_Pos)
224#define SYS_PB_L_MFP_PB2_MFP_GPB2 (0UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
225#define SYS_PB_L_MFP_PB2_MFP_TMR3_CNT (2UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
226#define SYS_PB_L_MFP_PB2_MFP_I2C0_SCL (5UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
227#define SYS_PB_L_MFP_PB2_MFP_SPI1_MOSI1 (6UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
228#define SYS_PB_L_MFP_PB2_MFP_UART0_RTS (7UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
229#define SYS_PB_L_MFP_PB2_MFP_LCD_S27 (8UL<<SYS_PB_L_MFP_PB2_MFP_Pos)
230#define SYS_PB_L_MFP_PB2_MFP_TMR3_OUT (0xAUL<<SYS_PB_L_MFP_PB2_MFP_Pos)
232#define SYS_PB_L_MFP_PB1_MFP_GPB1 (0UL<<SYS_PB_L_MFP_PB1_MFP_Pos)
233#define SYS_PB_L_MFP_PB1_MFP_EINT1 (1UL<<SYS_PB_L_MFP_PB1_MFP_Pos)
234#define SYS_PB_L_MFP_PB1_MFP_TMR2_CAP (2UL<<SYS_PB_L_MFP_PB1_MFP_Pos)
235#define SYS_PB_L_MFP_PB1_MFP_UART0_RX (7UL<<SYS_PB_L_MFP_PB1_MFP_Pos)
236#define SYS_PB_L_MFP_PB1_MFP_LCD_S28 (8UL<<SYS_PB_L_MFP_PB1_MFP_Pos)
238#define SYS_PB_L_MFP_PB0_MFP_GPB0 (0UL<<SYS_PB_L_MFP_PB0_MFP_Pos)
239#define SYS_PB_L_MFP_PB0_MFP_CKO1 (1UL<<SYS_PB_L_MFP_PB0_MFP_Pos)
240#define SYS_PB_L_MFP_PB0_MFP_UART0_TX (7UL<<SYS_PB_L_MFP_PB0_MFP_Pos)
241#define SYS_PB_L_MFP_PB0_MFP_LCD_S29 (8UL<<SYS_PB_L_MFP_PB0_MFP_Pos)
243/********************* Bit definition of PB_H_MFP register **********************/
244#define SYS_PB_H_MFP_PB15_MFP_GPB15 (0UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
245#define SYS_PB_H_MFP_PB15_MFP_SPI0_SS0 (6UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
246#define SYS_PB_H_MFP_PB15_MFP_UART0_CTS (7UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
247#define SYS_PB_H_MFP_PB15_MFP_LCD_S12 (8UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
248#define SYS_PB_H_MFP_PB15_MFP_LCD_S19 (8UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
249#define SYS_PB_H_MFP_PB15_MFP_LCD_S23 (8UL<<SYS_PB_H_MFP_PB15_MFP_Pos)
251#define SYS_PB_H_MFP_PB14_MFP_GPB14 (0UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
252#define SYS_PB_H_MFP_PB14_MFP_SPI0_SCLK (6UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
253#define SYS_PB_H_MFP_PB14_MFP_UART0_TX (7UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
254#define SYS_PB_H_MFP_PB14_MFP_LCD_S13 (8UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
255#define SYS_PB_H_MFP_PB14_MFP_LCD_S20 (8UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
256#define SYS_PB_H_MFP_PB14_MFP_LCD_S24 (8UL<<SYS_PB_H_MFP_PB14_MFP_Pos)
258#define SYS_PB_H_MFP_PB13_MFP_GPB13 (0UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
259#define SYS_PB_H_MFP_PB13_MFP_SPI0_MISO0 (6UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
260#define SYS_PB_H_MFP_PB13_MFP_UART0_RX (7UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
261#define SYS_PB_H_MFP_PB13_MFP_LCD_S14 (8UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
262#define SYS_PB_H_MFP_PB13_MFP_LCD_S21 (8UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
263#define SYS_PB_H_MFP_PB13_MFP_LCD_S25 (8UL<<SYS_PB_H_MFP_PB13_MFP_Pos)
265#define SYS_PB_H_MFP_PB12_MFP_GPB12 (0UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
266#define SYS_PB_H_MFP_PB12_MFP_CKO0 (1UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
267#define SYS_PB_H_MFP_PB12_MFP_TMR0_CNT (2UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
268#define SYS_PB_H_MFP_PB12_MFP_SPI0_MOSI0 (6UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
269#define SYS_PB_H_MFP_PB12_MFP_UART0_RTS (7UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
270#define SYS_PB_H_MFP_PB12_MFP_LCD_S15 (8UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
271#define SYS_PB_H_MFP_PB12_MFP_LCD_S22 (8UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
272#define SYS_PB_H_MFP_PB12_MFP_LCD_S26 (8UL<<SYS_PB_H_MFP_PB12_MFP_Pos)
273#define SYS_PB_H_MFP_PB12_MFP_TMR0_OUT (0xAUL<<SYS_PB_H_MFP_PB12_MFP_Pos)
275#define SYS_PB_H_MFP_PB11_MFP_GPB11 (0UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
276#define SYS_PB_H_MFP_PB11_MFP_TMR1_CNT (2UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
277#define SYS_PB_H_MFP_PB11_MFP_SPI0_MISO1 (6UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
278#define SYS_PB_H_MFP_PB11_MFP_UART1_RTS (7UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
279#define SYS_PB_H_MFP_PB11_MFP_LCD_S23 (8UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
280#define SYS_PB_H_MFP_PB11_MFP_LCD_S27 (8UL<<SYS_PB_H_MFP_PB11_MFP_Pos)
281#define SYS_PB_H_MFP_PB11_MFP_TMR1_OUT (0xAUL<<SYS_PB_H_MFP_PB11_MFP_Pos)
283#define SYS_PB_H_MFP_PB10_MFP_GPB10 (0UL<<SYS_PB_H_MFP_PB10_MFP_Pos)
284#define SYS_PB_H_MFP_PB10_MFP_SPI0_MOSI1 (6UL<<SYS_PB_H_MFP_PB10_MFP_Pos)
285#define SYS_PB_H_MFP_PB10_MFP_UART1_RX (7UL<<SYS_PB_H_MFP_PB10_MFP_Pos)
286#define SYS_PB_H_MFP_PB10_MFP_LCD_S24 (8UL<<SYS_PB_H_MFP_PB10_MFP_Pos)
287#define SYS_PB_H_MFP_PB10_MFP_LCD_S28 (8UL<<SYS_PB_H_MFP_PB10_MFP_Pos)
289#define SYS_PB_H_MFP_PB9_MFP_GPB9 (0UL<<SYS_PB_H_MFP_PB9_MFP_Pos)
290#define SYS_PB_H_MFP_PB9_MFP_PWM0_CH1 (3UL<<SYS_PB_H_MFP_PB9_MFP_Pos)
291#define SYS_PB_H_MFP_PB9_MFP_LCD_S31 (8UL<<SYS_PB_H_MFP_PB9_MFP_Pos)
293#define SYS_PB_H_MFP_PB8_MFP_GPB8 (0UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
294#define SYS_PB_H_MFP_PB8_MFP_EINT1 (1UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
295#define SYS_PB_H_MFP_PB8_MFP_TMR0_CNT (2UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
296#define SYS_PB_H_MFP_PB8_MFP_PWM0_CH0 (3UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
297#define SYS_PB_H_MFP_PB8_MFP_SNOOPER (4UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
298#define SYS_PB_H_MFP_PB8_MFP_LCD_S32 (8UL<<SYS_PB_H_MFP_PB8_MFP_Pos)
299#define SYS_PB_H_MFP_PB8_MFP_TMR0_OUT (0xAUL<<SYS_PB_H_MFP_PB8_MFP_Pos)
301/********************* Bit definition of PC_L_MFP register **********************/
302#define SYS_PC_L_MFP_PC7_MFP_GPC7 (0UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
303#define SYS_PC_L_MFP_PC7_MFP_SC0_PWR (4UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
304#define SYS_PC_L_MFP_PC7_MFP_UART1_RX (7UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
305#define SYS_PC_L_MFP_PC7_MFP_LCD_S4 (8UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
306#define SYS_PC_L_MFP_PC7_MFP_LCD_S11 (8UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
307#define SYS_PC_L_MFP_PC7_MFP_LCD_S15 (8UL<<SYS_PC_L_MFP_PC7_MFP_Pos)
309#define SYS_PC_L_MFP_PC6_MFP_GPC6 (0UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
310#define SYS_PC_L_MFP_PC6_MFP_SC0_DAT (4UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
311#define SYS_PC_L_MFP_PC6_MFP_UART1_RTS (7UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
312#define SYS_PC_L_MFP_PC6_MFP_LCD_S5 (8UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
313#define SYS_PC_L_MFP_PC6_MFP_LCD_S12 (8UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
314#define SYS_PC_L_MFP_PC6_MFP_LCD_S16 (8UL<<SYS_PC_L_MFP_PC6_MFP_Pos)
316#define SYS_PC_L_MFP_PC5_MFP_GPC5 (0UL<<SYS_PC_L_MFP_PC5_MFP_Pos)
317#define SYS_PC_L_MFP_PC5_MFP_SC0_CD (4UL<<SYS_PC_L_MFP_PC5_MFP_Pos)
318#define SYS_PC_L_MFP_PC5_MFP_LCD_S6 (8UL<<SYS_PC_L_MFP_PC5_MFP_Pos)
319#define SYS_PC_L_MFP_PC5_MFP_LCD_S13 (8UL<<SYS_PC_L_MFP_PC5_MFP_Pos)
320#define SYS_PC_L_MFP_PC5_MFP_LCD_S17 (8UL<<SYS_PC_L_MFP_PC5_MFP_Pos)
322#define SYS_PC_L_MFP_PC4_MFP_GPC4 (0UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
323#define SYS_PC_L_MFP_PC4_MFP_EINT0 (1UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
324#define SYS_PC_L_MFP_PC4_MFP_SC0_CLK (4UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
325#define SYS_PC_L_MFP_PC4_MFP_UART1_CTS (7UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
326#define SYS_PC_L_MFP_PC4_MFP_LCD_S7 (8UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
327#define SYS_PC_L_MFP_PC4_MFP_LCD_S14 (8UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
328#define SYS_PC_L_MFP_PC4_MFP_LCD_S18 (8UL<<SYS_PC_L_MFP_PC4_MFP_Pos)
330#define SYS_PC_L_MFP_PC3_MFP_GPC3 (0UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
331#define SYS_PC_L_MFP_PC3_MFP_PWM0_CH3 (3UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
332#define SYS_PC_L_MFP_PC3_MFP_I2C1_SDA (5UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
333#define SYS_PC_L_MFP_PC3_MFP_LCD_S8 (8UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
334#define SYS_PC_L_MFP_PC3_MFP_LCD_S15 (8UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
335#define SYS_PC_L_MFP_PC3_MFP_LCD_S19 (8UL<<SYS_PC_L_MFP_PC3_MFP_Pos)
337#define SYS_PC_L_MFP_PC2_MFP_GPC2 (0UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
338#define SYS_PC_L_MFP_PC2_MFP_PWM0_CH2 (3UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
339#define SYS_PC_L_MFP_PC2_MFP_I2C1_SCL (5UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
340#define SYS_PC_L_MFP_PC2_MFP_LCD_S9 (8UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
341#define SYS_PC_L_MFP_PC2_MFP_LCD_S16 (8UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
342#define SYS_PC_L_MFP_PC2_MFP_LCD_S20 (8UL<<SYS_PC_L_MFP_PC2_MFP_Pos)
344#define SYS_PC_L_MFP_PC1_MFP_GPC1 (0UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
345#define SYS_PC_L_MFP_PC1_MFP_PWM0_CH1 (3UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
346#define SYS_PC_L_MFP_PC1_MFP_I2C0_SDA (5UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
347#define SYS_PC_L_MFP_PC1_MFP_LCD_S10 (8UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
348#define SYS_PC_L_MFP_PC1_MFP_LCD_S17 (8UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
349#define SYS_PC_L_MFP_PC1_MFP_LCD_S21 (8UL<<SYS_PC_L_MFP_PC1_MFP_Pos)
351#define SYS_PC_L_MFP_PC0_MFP_GPC0 (0UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
352#define SYS_PC_L_MFP_PC0_MFP_PWM0_CH0 (3UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
353#define SYS_PC_L_MFP_PC0_MFP_I2C0_SCL (5UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
354#define SYS_PC_L_MFP_PC0_MFP_SPI0_SS1 (6UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
355#define SYS_PC_L_MFP_PC0_MFP_LCD_S11 (8UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
356#define SYS_PC_L_MFP_PC0_MFP_LCD_S18 (8UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
357#define SYS_PC_L_MFP_PC0_MFP_LCD_S22 (8UL<<SYS_PC_L_MFP_PC0_MFP_Pos)
359/********************* Bit definition of PC_H_MFP register **********************/
360#define SYS_PC_H_MFP_PC15_MFP_GPC15 (0UL<<SYS_PC_H_MFP_PC15_MFP_Pos)
361#define SYS_PC_H_MFP_PC15_MFP_SC1_PWR (4UL<<SYS_PC_H_MFP_PC15_MFP_Pos)
362#define SYS_PC_H_MFP_PC15_MFP_LCD_S0 (8UL<<SYS_PC_H_MFP_PC15_MFP_Pos)
363#define SYS_PC_H_MFP_PC15_MFP_LCD_S7 (8UL<<SYS_PC_H_MFP_PC15_MFP_Pos)
365#define SYS_PC_H_MFP_PC14_MFP_GPC14 (0UL<<SYS_PC_H_MFP_PC14_MFP_Pos)
366#define SYS_PC_H_MFP_PC14_MFP_SC1_CD (4UL<<SYS_PC_H_MFP_PC14_MFP_Pos)
367#define SYS_PC_H_MFP_PC14_MFP_LCD_S1 (7UL<<SYS_PC_H_MFP_PC14_MFP_Pos)
368#define SYS_PC_H_MFP_PC14_MFP_LCD_S8 (8UL<<SYS_PC_H_MFP_PC14_MFP_Pos)
370#define SYS_PC_H_MFP_PC13_MFP_GPC13 (0UL<<SYS_PC_H_MFP_PC13_MFP_Pos)
371#define SYS_PC_H_MFP_PC13_MFP_SC1_DAT (4UL<<SYS_PC_H_MFP_PC13_MFP_Pos)
372#define SYS_PC_H_MFP_PC13_MFP_LCD_S9 (8UL<<SYS_PC_H_MFP_PC13_MFP_Pos)
374#define SYS_PC_H_MFP_PC12_MFP_GPC12 (0UL<<SYS_PC_H_MFP_PC12_MFP_Pos)
375#define SYS_PC_H_MFP_PC12_MFP_SC1_CLK (4UL<<SYS_PC_H_MFP_PC12_MFP_Pos)
376#define SYS_PC_H_MFP_PC12_MFP_LCD_S10 (8UL<<SYS_PC_H_MFP_PC12_MFP_Pos)
378#define SYS_PC_H_MFP_PC11_MFP_GPC11 (0UL<<SYS_PC_H_MFP_PC11_MFP_Pos)
379#define SYS_PC_H_MFP_PC11_MFP_SC1_PWR (4UL<<SYS_PC_H_MFP_PC11_MFP_Pos)
380#define SYS_PC_H_MFP_PC11_MFP_I2C1_SDA (5UL<<SYS_PC_H_MFP_PC11_MFP_Pos)
381#define SYS_PC_H_MFP_PC11_MFP_LCD_S11 (8UL<<SYS_PC_H_MFP_PC11_MFP_Pos)
383#define SYS_PC_H_MFP_PC10_MFP_GPC10 (0UL<<SYS_PC_H_MFP_PC10_MFP_Pos)
384#define SYS_PC_H_MFP_PC10_MFP_SC1_CD (4UL<<SYS_PC_H_MFP_PC10_MFP_Pos)
385#define SYS_PC_H_MFP_PC10_MFP_I2C1_SCL (5UL<<SYS_PC_H_MFP_PC10_MFP_Pos)
386#define SYS_PC_H_MFP_PC10_MFP_LCD_S12 (8UL<<SYS_PC_H_MFP_PC10_MFP_Pos)
388#define SYS_PC_H_MFP_PC9_MFP_GPC9 (0UL<<SYS_PC_H_MFP_PC9_MFP_Pos)
389#define SYS_PC_H_MFP_PC9_MFP_LCD_S2 (8UL<<SYS_PC_H_MFP_PC9_MFP_Pos)
390#define SYS_PC_H_MFP_PC9_MFP_LCD_S9 (8UL<<SYS_PC_H_MFP_PC9_MFP_Pos)
391#define SYS_PC_H_MFP_PC9_MFP_LCD_S13 (8UL<<SYS_PC_H_MFP_PC9_MFP_Pos)
393#define SYS_PC_H_MFP_PC8_MFP_GPC8 (0UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
394#define SYS_PC_H_MFP_PC8_MFP_SC0_RST (4UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
395#define SYS_PC_H_MFP_PC8_MFP_UART1_TX (7UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
396#define SYS_PC_H_MFP_PC8_MFP_LCD_S3 (8UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
397#define SYS_PC_H_MFP_PC8_MFP_LCD_S10 (8UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
398#define SYS_PC_H_MFP_PC8_MFP_LCD_S14 (8UL<<SYS_PC_H_MFP_PC8_MFP_Pos)
400/********************* Bit definition of PD_L_MFP register **********************/
401#define SYS_PD_L_MFP_PD7_MFP_GPD7 (0UL<<SYS_PD_L_MFP_PD7_MFP_Pos)
402#define SYS_PD_L_MFP_PD7_MFP_SC1_CLK (4UL<<SYS_PD_L_MFP_PD7_MFP_Pos)
403#define SYS_PD_L_MFP_PD7_MFP_LCD_COM3 (8UL<<SYS_PD_L_MFP_PD7_MFP_Pos)
405#define SYS_PD_L_MFP_PD6_MFP_GPD6 (0UL<<SYS_PD_L_MFP_PD6_MFP_Pos)
406#define SYS_PD_L_MFP_PD6_MFP_LCD_S0 (8UL<<SYS_PD_L_MFP_PD6_MFP_Pos)
407#define SYS_PD_L_MFP_PD6_MFP_LCD_COM4 (8UL<<SYS_PD_L_MFP_PD6_MFP_Pos)
409#define SYS_PD_L_MFP_PD5_MFP_GPD5 (0UL<<SYS_PD_L_MFP_PD5_MFP_Pos)
410#define SYS_PD_L_MFP_PD5_MFP_LCD_S1 (8UL<<SYS_PD_L_MFP_PD5_MFP_Pos)
411#define SYS_PD_L_MFP_PD5_MFP_LCD_COM5 (8UL<<SYS_PD_L_MFP_PD5_MFP_Pos)
413#define SYS_PD_L_MFP_PD4_MFP_GPD4 (0UL<<SYS_PD_L_MFP_PD4_MFP_Pos)
414#define SYS_PD_L_MFP_PD4_MFP_SC1_RST (4UL<<SYS_PD_L_MFP_PD4_MFP_Pos)
415#define SYS_PD_L_MFP_PD4_MFP_LCD_S2 (8UL<<SYS_PD_L_MFP_PD4_MFP_Pos)
417#define SYS_PD_L_MFP_PD3_MFP_GPD3 (0UL<<SYS_PD_L_MFP_PD3_MFP_Pos)
418#define SYS_PD_L_MFP_PD3_MFP_LCD_S3 (8UL<<SYS_PD_L_MFP_PD3_MFP_Pos)
420#define SYS_PD_L_MFP_PD2_MFP_GPD2 (0UL<<SYS_PD_L_MFP_PD2_MFP_Pos)
421#define SYS_PD_L_MFP_PD2_MFP_LCD_S4 (8UL<<SYS_PD_L_MFP_PD2_MFP_Pos)
423#define SYS_PD_L_MFP_PD1_MFP_GPD1 (0UL<<SYS_PD_L_MFP_PD1_MFP_Pos)
424#define SYS_PD_L_MFP_PD1_MFP_LCD_S5 (8UL<<SYS_PD_L_MFP_PD1_MFP_Pos)
426#define SYS_PD_L_MFP_PD0_MFP_GPD0 (0UL<<SYS_PD_L_MFP_PD0_MFP_Pos)
427#define SYS_PD_L_MFP_PD0_MFP_LCD_S6 (8UL<<SYS_PD_L_MFP_PD0_MFP_Pos)
429/********************* Bit definition of PD_H_MFP register **********************/
430#define SYS_PD_H_MFP_PD15_MFP_GPD15 (0UL<<SYS_PD_H_MFP_PD15_MFP_Pos)
431#define SYS_PD_H_MFP_PD15_MFP_LCD_V3 (8UL<<SYS_PD_H_MFP_PD15_MFP_Pos)
433#define SYS_PD_H_MFP_PD14_MFP_GPD14 (0UL<<SYS_PD_H_MFP_PD14_MFP_Pos)
434#define SYS_PD_H_MFP_PD14_MFP_LCD_V2 (8UL<<SYS_PD_H_MFP_PD14_MFP_Pos)
436#define SYS_PD_H_MFP_PD13_MFP_GPD13 (0UL<<SYS_PD_H_MFP_PD13_MFP_Pos)
437#define SYS_PD_H_MFP_PD13_MFP_EINT1 (1UL<<SYS_PD_H_MFP_PD13_MFP_Pos)
438#define SYS_PD_H_MFP_PD13_MFP_LCD_V1 (8UL<<SYS_PD_H_MFP_PD13_MFP_Pos)
440#define SYS_PD_H_MFP_PD12_MFP_GPD12 (0UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
441#define SYS_PD_H_MFP_PD12_MFP_CKO0 (1UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
442#define SYS_PD_H_MFP_PD12_MFP_TMR1_CNT (2UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
443#define SYS_PD_H_MFP_PD12_MFP_PWM0_CH0 (3UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
444#define SYS_PD_H_MFP_PD12_MFP_LCD_DH1 (8UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
445#define SYS_PD_H_MFP_PD12_MFP_CLK_Hz (9UL<<SYS_PD_H_MFP_PD12_MFP_Pos)
446#define SYS_PD_H_MFP_PD12_MFP_TMR1_OUT (0xAUL<<SYS_PD_H_MFP_PD12_MFP_Pos)
448#define SYS_PD_H_MFP_PD11_MFP_GPD11 (0UL<<SYS_PD_H_MFP_PD11_MFP_Pos)
449#define SYS_PD_H_MFP_PD11_MFP_TMR0_CAP (2UL<<SYS_PD_H_MFP_PD11_MFP_Pos)
450#define SYS_PD_H_MFP_PD11_MFP_PWM0_CH1 (3UL<<SYS_PD_H_MFP_PD11_MFP_Pos)
451#define SYS_PD_H_MFP_PD11_MFP_LCD_DH2 (8UL<<SYS_PD_H_MFP_PD11_MFP_Pos)
453#define SYS_PD_H_MFP_PD10_MFP_GPD10 (0UL<<SYS_PD_H_MFP_PD10_MFP_Pos)
454#define SYS_PD_H_MFP_PD10_MFP_TMR1_CAP (2UL<<SYS_PD_H_MFP_PD10_MFP_Pos)
455#define SYS_PD_H_MFP_PD10_MFP_PWM0_CH2 (3UL<<SYS_PD_H_MFP_PD10_MFP_Pos)
456#define SYS_PD_H_MFP_PD10_MFP_LCD_COM0 (8UL<<SYS_PD_H_MFP_PD10_MFP_Pos)
458#define SYS_PD_H_MFP_PD9_MFP_GPD9 (0UL<<SYS_PD_H_MFP_PD9_MFP_Pos)
459#define SYS_PD_H_MFP_PD9_MFP_PWM0_CH3 (3UL<<SYS_PD_H_MFP_PD9_MFP_Pos)
460#define SYS_PD_H_MFP_PD9_MFP_SC1_RST (4UL<<SYS_PD_H_MFP_PD9_MFP_Pos)
461#define SYS_PD_H_MFP_PD9_MFP_LCD_COM1 (8UL<<SYS_PD_H_MFP_PD9_MFP_Pos)
463#define SYS_PD_H_MFP_PD8_MFP_GPD8 (0UL<<SYS_PD_H_MFP_PD8_MFP_Pos)
464#define SYS_PD_H_MFP_PD8_MFP_SC1_DAT (4UL<<SYS_PD_H_MFP_PD8_MFP_Pos)
465#define SYS_PD_H_MFP_PD8_MFP_LCD_COM2 (8UL<<SYS_PD_H_MFP_PD8_MFP_Pos)
467/********************* Bit definition of PE_L_MFP register **********************/
468#define SYS_PE_L_MFP_PE7_MFP_GPE7 (0UL<<SYS_PE_L_MFP_PE7_MFP_Pos)
469#define SYS_PE_L_MFP_PE7_MFP_SC1_DAT (4UL<<SYS_PE_L_MFP_PE7_MFP_Pos)
471#define SYS_PE_L_MFP_PE6_MFP_GPE6 (0UL<<SYS_PE_L_MFP_PE6_MFP_Pos)
472#define SYS_PE_L_MFP_PE6_MFP_SC1_CLK (4UL<<SYS_PE_L_MFP_PE6_MFP_Pos)
474#define SYS_PE_L_MFP_PE5_MFP_GPE5 (0UL<<SYS_PE_L_MFP_PE5_MFP_Pos)
475#define SYS_PE_L_MFP_PE5_MFP_SC1_PWR (4UL<<SYS_PE_L_MFP_PE5_MFP_Pos)
477#define SYS_PE_L_MFP_PE4_MFP_GPE4 (0UL<<SYS_PE_L_MFP_PE4_MFP_Pos)
478#define SYS_PE_L_MFP_PE4_MFP_SC1_RST (4UL<<SYS_PE_L_MFP_PE4_MFP_Pos)
480#define SYS_PE_L_MFP_PE3_MFP_GPE3 (0UL<<SYS_PE_L_MFP_PE3_MFP_Pos)
481#define SYS_PE_L_MFP_PE3_MFP_SPI0_SS0 (6UL<<SYS_PE_L_MFP_PE3_MFP_Pos)
483#define SYS_PE_L_MFP_PE2_MFP_GPE2 (0UL<<SYS_PE_L_MFP_PE2_MFP_Pos)
484#define SYS_PE_L_MFP_PE2_MFP_SPI0_SCLK (6UL<<SYS_PE_L_MFP_PE2_MFP_Pos)
486#define SYS_PE_L_MFP_PE1_MFP_GPE1 (0UL<<SYS_PE_L_MFP_PE1_MFP_Pos)
487#define SYS_PE_L_MFP_PE1_MFP_SPI0_MISO0 (6UL<<SYS_PE_L_MFP_PE1_MFP_Pos)
489#define SYS_PE_L_MFP_PE0_MFP_GPE0 (0UL<<SYS_PE_L_MFP_PE0_MFP_Pos)
490#define SYS_PE_L_MFP_PE0_MFP_SPI0_MOSI0 (6UL<<SYS_PE_L_MFP_PE0_MFP_Pos)
492/********************* Bit definition of PE_H_MFP register **********************/
493#define SYS_PE_H_MFP_PE9_MFP_GPE9 (0UL<<SYS_PE_H_MFP_PE9_MFP_Pos)
494#define SYS_PE_H_MFP_PE9_MFP_PWM0_CH3 (3UL<<SYS_PE_H_MFP_PE9_MFP_Pos)
495#define SYS_PE_H_MFP_PE9_MFP_LCD_S29 (8UL<<SYS_PE_H_MFP_PE9_MFP_Pos)
497#define SYS_PE_H_MFP_PE8_MFP_GPE8 (0UL<<SYS_PE_H_MFP_PE8_MFP_Pos)
498#define SYS_PE_H_MFP_PE8_MFP_PWM0_CH2 (3UL<<SYS_PE_H_MFP_PE8_MFP_Pos)
499#define SYS_PE_H_MFP_PE8_MFP_LCD_S30 (8UL<<SYS_PE_H_MFP_PE8_MFP_Pos)
501/********************* Bit definition of PF_L_MFP register **********************/
502#define SYS_PF_L_MFP_PF5_MFP_GPF5 (0UL<<SYS_PF_L_MFP_PF5_MFP_Pos)
503#define SYS_PF_L_MFP_PF5_MFP_TMR0_CAP (2UL<<SYS_PF_L_MFP_PF5_MFP_Pos)
504#define SYS_PF_L_MFP_PF5_MFP_PWM0_CH3 (3UL<<SYS_PF_L_MFP_PF5_MFP_Pos)
505#define SYS_PF_L_MFP_PF5_MFP_ACMP_C (9UL<<SYS_PF_L_MFP_PF5_MFP_Pos)
506#define SYS_PF_L_MFP_PF5_MFP_ICE_DAT (0xFUL<<SYS_PF_L_MFP_PF5_MFP_Pos)
508#define SYS_PF_L_MFP_PF4_MFP_GPF4 (0UL<<SYS_PF_L_MFP_PF4_MFP_Pos)
509#define SYS_PF_L_MFP_PF4_MFP_CKO1 (1UL<<SYS_PF_L_MFP_PF4_MFP_Pos)
510#define SYS_PF_L_MFP_PF4_MFP_TMR1_CAP (2UL<<SYS_PF_L_MFP_PF4_MFP_Pos)
511#define SYS_PF_L_MFP_PF4_MFP_PWM0_CH2 (3UL<<SYS_PF_L_MFP_PF4_MFP_Pos)
512#define SYS_PF_L_MFP_PF4_MFP_CLK_Hz (9UL<<SYS_PF_L_MFP_PF4_MFP_Pos)
513#define SYS_PF_L_MFP_PF4_MFP_ICE_CLK (0xFUL<<SYS_PF_L_MFP_PF4_MFP_Pos)
515#define SYS_PF_L_MFP_PF3_MFP_GPF3 (0UL<<SYS_PF_L_MFP_PF3_MFP_Pos)
516#define SYS_PF_L_MFP_PF3_MFP_EINT0 (1UL<<SYS_PF_L_MFP_PF3_MFP_Pos)
517#define SYS_PF_L_MFP_PF3_MFP_TMR2_CAP (2UL<<SYS_PF_L_MFP_PF3_MFP_Pos)
518#define SYS_PF_L_MFP_PF3_MFP_UART1_TX (7UL<<SYS_PF_L_MFP_PF3_MFP_Pos)
519#define SYS_PF_L_MFP_PF3_MFP_XT1_OUT (0xFUL<<SYS_PF_L_MFP_PF3_MFP_Pos)
521#define SYS_PF_L_MFP_PF2_MFP_GPF2 (0UL<<SYS_PF_L_MFP_PF2_MFP_Pos)
522#define SYS_PF_L_MFP_PF2_MFP_EINT1 (1UL<<SYS_PF_L_MFP_PF2_MFP_Pos)
523#define SYS_PF_L_MFP_PF2_MFP_TMR3_CAP (2UL<<SYS_PF_L_MFP_PF2_MFP_Pos)
524#define SYS_PF_L_MFP_PF2_MFP_UART1_RX (7UL<<SYS_PF_L_MFP_PF2_MFP_Pos)
525#define SYS_PF_L_MFP_PF2_MFP_XT1_IN (0xFUL<<SYS_PF_L_MFP_PF2_MFP_Pos)
527#define SYS_PF_L_MFP_PF1_MFP_GPF1 (0UL<<SYS_PF_L_MFP_PF1_MFP_Pos)
528#define SYS_PF_L_MFP_PF1_MFP_TMR2_CNT (2UL<<SYS_PF_L_MFP_PF1_MFP_Pos)
529#define SYS_PF_L_MFP_PF1_MFP_X32_OUT (0xFUL<<SYS_PF_L_MFP_PF1_MFP_Pos)
530#define SYS_PF_L_MFP_PF1_MFP_TMR2_OUT (0xAUL<<SYS_PF_L_MFP_PF1_MFP_Pos)
532#define SYS_PF_L_MFP_PF0_MFP_GPF0 (0UL<<SYS_PF_L_MFP_PF0_MFP_Pos)
533#define SYS_PF_L_MFP_PF0_MFP_TMR3_CNT (2UL<<SYS_PF_L_MFP_PF0_MFP_Pos)
534#define SYS_PF_L_MFP_PF0_MFP_X32_IN (0xFUL<<SYS_PF_L_MFP_PF0_MFP_Pos)
535#define SYS_PF_L_MFP_PF0_MFP_TMR3_OUT (0xAUL<<SYS_PF_L_MFP_PF0_MFP_Pos)
538#define MFP_LCD_TYPEA() { \
539 SYS->PB_L_MFP = (SYS->PB_L_MFP &~(0xFFF00000)) | (0x88800000); /* seg 35 ~ 33 */\
540 SYS->PB_H_MFP = 0x88888888; /* seg 32 ~ 31, 28 ~ 23 */\
541 SYS->PC_L_MFP = 0x88888888; /* seg 22 ~ 15 */\
542 SYS->PC_H_MFP = 0x88888888; /* seg 14 ~ 7 */\
543 SYS->PD_L_MFP = 0x88888888; /* seg 6 ~ 0, COM3 */\
544 SYS->PD_H_MFP = 0x88888888; /* COM2 ~ 0, DH2 ~ 1, V3 ~1 */\
545 SYS->PE_H_MFP = (SYS->PE_H_MFP &~(0x000000FF)) | (0x00000088); /* seg 30, 29 */\
546 PB->OFFD |= 0xFFE00000;\
547 PC->OFFD |= 0xFFFF0000;\
548 PD->OFFD |= 0xFFFF0000;\
549 PE->OFFD |= 0x03000000;\
550 }
551 /* end of group NANO1X2_SYS_EXPORTED_CONSTANTS */
553
563#define SYS_CLEAR_BOD_INT_FLAG() (SYS->BODSTS |= SYS_BODSTS_BOD_INT_Msk)
564
571#define SYS_DISABLE_BOD25() (SYS->BODCTL &= ~SYS_BODCTL_BOD25_EN_Msk)
572
579#define SYS_ENABLE_BOD25() (SYS->BODCTL |= SYS_BODCTL_BOD25_EN_Msk)
580
587#define SYS_DISABLE_BOD20() (SYS->BODCTL &= ~SYS_BODCTL_BOD20_EN_Msk)
588
595#define SYS_ENABLE_BOD20() (SYS->BODCTL |= SYS_BODCTL_BOD20_EN_Msk)
596
603#define SYS_DISABLE_BOD17() (SYS->BODCTL &= ~SYS_BODCTL_BOD17_EN_Msk)
604
611#define SYS_ENABLE_BOD17() (SYS->BODCTL |= SYS_BODCTL_BOD17_EN_Msk)
612
620#define SYS_GET_BOD_INT_FLAG() (SYS->BODSTS & SYS_BODSTS_BOD_INT_Msk)
621
630#define SYS_GET_BOD25_OUTPUT() (SYS->BODSTS & SYS_BODSTS_BOD25_drop_Msk)
631
640#define SYS_GET_BOD20_OUTPUT() (SYS->BODSTS & SYS_BODSTS_BOD20_drop_Msk)
641
650#define SYS_GET_BOD17_OUTPUT() (SYS->BODSTS & SYS_BODSTS_BOD17_drop_Msk)
651
658#define SYS_DISABLE_BOD25_RST() (SYS->BODCTL &= ~SYS_BODCTL_BOD25_RST_EN_Msk)
659
666#define SYS_ENABLE_BOD25_RST() (SYS->BODCTL |= SYS_BODCTL_BOD25_RST_EN_Msk)
667
674#define SYS_DISABLE_BOD20_RST() (SYS->BODCTL &= ~SYS_BODCTL_BOD20_RST_EN_Msk)
675
682#define SYS_ENABLE_BOD20_RST() (SYS->BODCTL |= SYS_BODCTL_BOD20_RST_EN_Msk)
683
690#define SYS_DISABLE_BOD17_RST() (SYS->BODCTL &= ~SYS_BODCTL_BOD17_RST_EN_Msk)
691
698#define SYS_ENABLE_BOD17_RST() (SYS->BODCTL |= SYS_BODCTL_BOD17_RST_EN_Msk)
699
707#define SYS_IS_BOD_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_BOD_Msk)
708
709
717#define SYS_IS_CPU_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_CPU_Msk)
718
726#define SYS_IS_POR_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_POR_Msk)
727
735#define SYS_IS_RSTPIN_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_PAD_Msk)
736
744#define SYS_IS_SYSTEM_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_SYS_Msk)
745
746
754#define SYS_IS_WDT_RST() (SYS->RST_SRC & SYS_RST_SRC_RSTS_WDT_Msk)
755
762#define SYS_DISABLE_POR() (SYS->PORCTL = 0x5AA5)
763
770#define SYS_ENABLE_POR() (SYS->PORCTL = 0)
771
772
785#define SYS_CLEAR_RST_SOURCE(u32RstSrc) (SYS->RST_SRC |= u32RstSrc )
786
794__STATIC_INLINE void SYS_UnlockReg(void)
795{
796 while(SYS->RegLockAddr != SYS_RegLockAddr_RegUnLock_Msk) {
797 SYS->RegLockAddr = 0x59;
798 SYS->RegLockAddr = 0x16;
799 SYS->RegLockAddr = 0x88;
800 }
801}
802
810__STATIC_INLINE void SYS_LockReg(void)
811{
812 SYS->RegLockAddr = 0;
813}
814
823#define SYS_GET_IRCTRIM_INT_FLAG() (SYS->IRCTRIMINT)
824
833#define SYS_CLEAR_IRCTRIM_INT_FLAG(u32IRCTrimFlg) (SYS->IRCTRIMINT = u32IRCTrimFlg )
834
835 void SYS_ClearResetSrc(uint32_t u32Src);
836uint32_t SYS_GetBODStatus(void);
837uint32_t SYS_GetResetSrc(void);
838uint32_t SYS_IsRegLocked(void);
839 void SYS_LockReg(void);
840 void SYS_UnlockReg(void);
841uint32_t SYS_ReadPDID(void);
842 void SYS_ResetChip(void);
843 void SYS_ResetCPU(void);
844 void SYS_ResetModule(uint32_t u32ModuleIndex);
845 void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel);
846 void SYS_DisableBOD(void);
847 void SYS_EnableIRCTrim(uint32_t u32TrimSel,uint32_t u32TrimEnInt);
848 void SYS_DisableIRCTrim(void); /* end of group NANO1X2_SYS_EXPORTED_FUNCTIONS */
850 /* end of group NANO1X2_SYS_Driver */
852 /* end of group NANO1X2_Device_Driver */
854
855#ifdef __cplusplus
856}
857#endif
858
859#endif //__SYS_H__
860
861/*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
862
863
SYS_RegLockAddr_RegUnLock_Msk
#define SYS_RegLockAddr_RegUnLock_Msk
Definition: Nano1X2Series.h:4062
SYS
#define SYS
Pointer to SYS register structure.
Definition: Nano1X2Series.h:10650
SYS_ResetCPU
void SYS_ResetCPU(void)
This function reset CPU.
Definition: sys.c:95
SYS_LockReg
__STATIC_INLINE void SYS_LockReg(void)
Enable register write-protection function.
Definition: sys.h:810
SYS_GetResetSrc
uint32_t SYS_GetResetSrc(void)
This function get the system reset source register value.
Definition: sys.c:54
SYS_EnableBOD
void SYS_EnableBOD(int32_t i32Mode, uint32_t u32BODLevel)
This function configure BOD function. Configure BOD reset or interrupt mode and set Brown-out voltage...
Definition: sys.c:146
SYS_ResetModule
void SYS_ResetModule(uint32_t u32ModuleIndex)
This function reset selected modules.
Definition: sys.c:125
SYS_EnableIRCTrim
void SYS_EnableIRCTrim(uint32_t u32TrimSel, uint32_t u32TrimEnInt)
This function enable HIRC trim function.
Definition: sys.c:173
SYS_ReadPDID
uint32_t SYS_ReadPDID(void)
This function get product ID.
Definition: sys.c:75
SYS_GetBODStatus
uint32_t SYS_GetBODStatus(void)
This function get Brown-out detector output status.
Definition: sys.c:44
SYS_DisableIRCTrim
void SYS_DisableIRCTrim(void)
This function disable HIRC trim function.
Definition: sys.c:184
SYS_UnlockReg
__STATIC_INLINE void SYS_UnlockReg(void)
Disable register write-protection function.
Definition: sys.h:794
SYS_DisableBOD
void SYS_DisableBOD(void)
This function disable BOD function.
Definition: sys.c:156
SYS_IsRegLocked
uint32_t SYS_IsRegLocked(void)
This function check register write-protection bit setting.
Definition: sys.c:65
SYS_ClearResetSrc
void SYS_ClearResetSrc(uint32_t u32Src)
This function clear the selected system reset source.
Definition: sys.c:32
SYS_ResetChip
void SYS_ResetChip(void)
This function reset chip.
Definition: sys.c:85