PAN1080 Peripheral API
pan_sys.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
14#ifndef __PAN_SYS_H__
15#define __PAN_SYS_H__
16
17
23#ifdef __cplusplus
24extern "C"
25{
26#endif
27
28
32#define ADC_RST ((0x4<<24) | SYS_IPRST1_ADCRST_Pos )
33#define ACMP_RST ((0x4<<24) | SYS_IPRST1_ACMPRST_Pos )
34#define PWM0_RST ((0x4<<24) | SYS_IPRST1_PWM0RST_Pos )
35#define WWDT_RST ((0x4<<24) | SYS_IPRST1_WWDTRST_Pos )
36#define WDT_RST ((0x4<<24) | SYS_IPRST1_WDTRST_Pos )
37#define UART0_RST ((0x4<<24) | SYS_IPRST1_UART0RST_Pos )
38#define UART1_RST ((0x4<<24) | SYS_IPRST1_UART1RST_Pos )
39#define SPI0_RST ((0x4<<24) | SYS_IPRST1_SPI0RST_Pos )
40#define SPI1_RST ((0x4<<24) | SYS_IPRST1_SPI1RST_Pos )
41#define I2C0_RST ((0x4<<24) | SYS_IPRST1_I2C0RST_Pos )
42#define I2C1_RST ((0x4<<24) | SYS_IPRST1_I2C1RST_Pos )
43#define TMR2_RST ((0x4<<24) | SYS_IPRST1_TMR2RST_Pos )
44#define TMR1_RST ((0x4<<24) | SYS_IPRST1_TMR1RST_Pos )
45#define TMR0_RST ((0x4<<24) | SYS_IPRST1_TMR0RST_Pos )
46#define GPIO_RST ((0x4<<24) | SYS_IPRST1_GPIORST_Pos )
52#define SYS_BODCTL_BOD_RST_EN (1UL<<SYS_BODCTL_BODRSTEN_Pos)
53#define SYS_BODCTL_BOD_INTERRUPT_EN (0UL<<SYS_BODCTL_BODRSTEN_Pos)
54#define SYS_BODCTL_DISABLE (3UL<<SYS_BODCTL_BODVL_Pos)
55#define SYS_BODCTL_BODVL_2_67V (2UL<<SYS_BODCTL_BODVL_Pos)
56#define SYS_BODCTL_BODVL_2_4V (1UL<<SYS_BODCTL_BODVL_Pos)
57#define SYS_BODCTL_BODVL_2_15V (0UL<<SYS_BODCTL_BODVL_Pos)
63#define SYS_MFP_TYPE_Msk(bit) (1UL << ((bit) +16))
64#define SYS_MFP_ALT_Msk(bit) (1UL << ((bit) + 8))
65#define SYS_MFP_MFP_Msk(bit) (1UL << ((bit) ))
67#define SYS_MFP_GPIO 0x00000000UL
69#define SYS_MFP_P00_GPIO 0x00000000UL
70#define SYS_MFP_P00_UART0_TX 0x00000001UL
71#define SYS_MFP_P00_I2C0_SCL 0x00000100UL
72#define SYS_MFP_P00_TMR0_OUT 0x00000101UL
73#define SYS_MFP_P00_PWM0_CH0 0x00010000UL
74#define SYS_MFP_P00_I2SM_DI 0x00010001UL
75#define SYS_MFP_P00_KSCAN_O6 0x00010100UL
76#define SYS_MFP_P00_I2SS_DI 0x00010101UL
77#define SYS_MFP_P00_Msk 0x00010101UL
79#define SYS_MFP_P01_GPIO 0x00000000UL
80#define SYS_MFP_P01_UART0_RX 0x00000002UL
81#define SYS_MFP_P01_I2C0_SDA 0x00000200UL
82#define SYS_MFP_P01_I2SM_DO 0x00000202UL
83#define SYS_MFP_P01_PWM0_CH1 0x00020000UL
84#define SYS_MFP_P01_I2SS_DO 0x00020002UL
85#define SYS_MFP_P01_KSCAN_O7 0x00020200UL
86#define SYS_MFP_P01_LL_DBG01 0x00020202UL
87#define SYS_MFP_P01_Msk 0x00020202UL
89#define SYS_MFP_P02_GPIO 0x00000000UL
90#define SYS_MFP_P02_UART0_CTS 0x00000004UL
91#define SYS_MFP_P02_ANT_SW0 0x00000400UL
92#define SYS_MFP_P02_SPI0_CS 0x00000404UL
93#define SYS_MFP_P02_USB_DM 0x00040000UL
94#define SYS_MFP_P02_PWM0_CH2 0x00040004UL
95#define SYS_MFP_P02_TADC_DATL 0x00040400UL
96#define SYS_MFP_P02_KSCAN_I0 0x00040404UL
97#define SYS_MFP_P02_Msk 0x00040404UL
99#define SYS_MFP_P03_GPIO 0x00000000UL
100#define SYS_MFP_P03_UART0_RTS 0x00000008UL
101#define SYS_MFP_P03_ANT_SW1 0x00000800UL
102#define SYS_MFP_P03_SPI0_CLK 0x00000808UL
103#define SYS_MFP_P03_USB_DP 0x00080000UL
104#define SYS_MFP_P03_PWM0_CH3 0x00080008UL
105#define SYS_MFP_P03_TADC_VLD 0x00080800UL
106#define SYS_MFP_P03_KSCAN_I1 0x00080808UL
107#define SYS_MFP_P03_Msk 0x00080808UL
109#define SYS_MFP_P04_GPIO 0x00000000UL
110#define SYS_MFP_P04_I2SS_DI 0x00000010UL
111#define SYS_MFP_P04_I2SM_DI 0x00001000UL
112#define SYS_MFP_P04_TMR2_OUT 0x00001010UL
113#define SYS_MFP_P04_PWM1_CH0 0x00100000UL
114#define SYS_MFP_P04_KSCAN_O10 0x00100010UL
115#define SYS_MFP_P04_QDEC_X0 0x00101000UL
116#define SYS_MFP_P04_LL_DBG10 0x00101010UL
117#define SYS_MFP_P04_Msk 0x00101010UL
119#define SYS_MFP_P05_GPIO 0x00000000UL
120#define SYS_MFP_P05_I2SS_DO 0x00000020UL
121#define SYS_MFP_P05_I2SM_DO 0x00002000UL
122#define SYS_MFP_P05_ANT_SW2 0x00002020UL
123#define SYS_MFP_P05_PWM1_CH1 0x00200000UL
124#define SYS_MFP_P05_KSCAN_O11 0x00200020UL
125#define SYS_MFP_P05_QDEC_X1 0x00202000UL
126#define SYS_MFP_P05_EXT_STADC 0x00202020UL
127#define SYS_MFP_P05_Msk 0x00202020UL
129#define SYS_MFP_P06_GPIO 0x00000000UL
130#define SYS_MFP_P06_SPI1_CS 0x00000040UL
131#define SYS_MFP_P06_UART1_TX 0x00004000UL
132#define SYS_MFP_P06_ANT_SW3 0x00004040UL
133#define SYS_MFP_P06_PWM1_CH2 0x00400000UL
134#define SYS_MFP_P06_KSCAN_O12 0x00400040UL
135#define SYS_MFP_P06_QDEC_Y0 0x00404000UL
136#define SYS_MFP_P06_I2S_MCLK 0x00404040UL
137#define SYS_MFP_P06_Msk 0x00404040UL
139#define SYS_MFP_P07_GPIO 0x00000000UL
140#define SYS_MFP_P07_SPI1_CLK 0x00000080UL
141#define SYS_MFP_P07_UART1_RX 0x00008000UL
142#define SYS_MFP_P07_TMR0_EXT 0x00008080UL
143#define SYS_MFP_P07_PWM1_CH3 0x00800000UL
144#define SYS_MFP_P07_KSCAN_O13 0x00800080UL
145#define SYS_MFP_P07_QDEC_Y1 0x00808000UL
146#define SYS_MFP_P07_ANT_SW5 0x00808080UL
147#define SYS_MFP_P07_Msk 0x00808080UL
149#define SYS_MFP_P10_GPIO 0x00000000UL
150#define SYS_MFP_P10_SPI0_MOSI 0x00000001UL
151#define SYS_MFP_P10_TMR0_EXT 0x00000100UL
152#define SYS_MFP_P10_ADC_CH5 0x00000101UL
153#define SYS_MFP_P10_PWM0_CH4 0x00010000UL
154#define SYS_MFP_P10_KSCAN_O4 0x00010001UL
155#define SYS_MFP_P10_32K_CLK 0x00010100UL
156#define SYS_MFP_P10_LL_DBG14 0x00010101UL
157#define SYS_MFP_P10_Msk 0x00010101UL
159#define SYS_MFP_P11_GPIO 0x00000000UL
160#define SYS_MFP_P11_SPI0_MISO 0x00000002UL
161#define SYS_MFP_P11_CALIB_CLK 0x00000200UL
162#define SYS_MFP_P11_ADC_CH4 0x00000202UL
163#define SYS_MFP_P11_PWM0_CH5 0x00020000UL
164#define SYS_MFP_P11_KSCAN_O5 0x00020002UL
165#define SYS_MFP_P11_AHB_CLK 0x00020200UL
166#define SYS_MFP_P11_I2S_MCLK 0x00020202UL
167#define SYS_MFP_P11_Msk 0x00020202UL
169#define SYS_MFP_P12_GPIO 0x00000000UL
170#define SYS_MFP_P12_I2C0_SCL 0x00000004UL
171#define SYS_MFP_P12_I2SS_CLK 0x00000400UL
172#define SYS_MFP_P12_I2SM_CLK 0x00000404UL
173#define SYS_MFP_P12_PWM0_CH6 0x00040000UL
174#define SYS_MFP_P12_TADC_CLK 0x00040004UL
175#define SYS_MFP_P12_DPLL 0x00040400UL
176#define SYS_MFP_P12_LL_DBG15 0x00040404UL
177#define SYS_MFP_P12_Msk 0x00040404UL
179#define SYS_MFP_P13_GPIO 0x00000000UL
180#define SYS_MFP_P13_I2C0_SDA 0x00000008UL
181#define SYS_MFP_P13_I2SS_WS 0x00000800UL
182#define SYS_MFP_P13_I2SM_WS 0x00000808UL
183#define SYS_MFP_P13_PWM0_CH7 0x00080000UL
184#define SYS_MFP_P13_TADC_DATH 0x00080008UL
185#define SYS_MFP_P13_RCH 0x00080800UL
186#define SYS_MFP_P13_ANT_SW4 0x00080808UL
187#define SYS_MFP_P13_Msk 0x00080808UL
189#define SYS_MFP_P14_GPIO 0x00000000UL
190#define SYS_MFP_P14_UART1_TX 0x00000010UL
191#define SYS_MFP_P14_I2C0_SDA 0x00001000UL
192#define SYS_MFP_P14_ANT_SW6 0x00001010UL
193#define SYS_MFP_P14_PWM0_CH4 0x00100000UL
194#define SYS_MFP_P14_KSCAN_I4 0x00100010UL
195#define SYS_MFP_P14_QDEC_X0 0x00101000UL
196#define SYS_MFP_P14_MDM_DBG18 0x00101010UL
197#define SYS_MFP_P14_Msk 0x00101010UL
199#define SYS_MFP_P15_GPIO 0x00000000UL
200#define SYS_MFP_P15_UART1_RX 0x00000020UL
201#define SYS_MFP_P15_ANT_SW7 0x00002000UL
202#define SYS_MFP_P15_I2C0_SCL 0x00002020UL
203#define SYS_MFP_P15_PWM0_CH5 0x00200000UL
204#define SYS_MFP_P15_KSCAN_I5 0x00200020UL
205#define SYS_MFP_P15_QDEC_X1 0x00202000UL
206#define SYS_MFP_P15_LL_DBG04 0x00202020UL
207#define SYS_MFP_P15_Msk 0x00202020UL
209#define SYS_MFP_P16_GPIO 0x00000000UL
210#define SYS_MFP_P16_UART1_CTS 0x00000040UL
211#define SYS_MFP_P16_ANT_SW4 0x00004000UL
212#define SYS_MFP_P16_TMR0_OUT 0x00004040UL
213#define SYS_MFP_P16_PWM0_CH6 0x00400000UL
214#define SYS_MFP_P16_KSCAN_I6 0x00400040UL
215#define SYS_MFP_P16_QDEC_Y0 0x00404000UL
216#define SYS_MFP_P16_LL_DBG13 0x00404040UL
217#define SYS_MFP_P16_Msk 0x00404040UL
219#define SYS_MFP_P17_GPIO 0x00000000UL
220#define SYS_MFP_P17_UART1_RTS 0x00000080UL
221#define SYS_MFP_P17_MDM_DBG03 0x00008000UL
222#define SYS_MFP_P17_TMR1_OUT 0x00008080UL
223#define SYS_MFP_P17_PWM0_CH7 0x00800000UL
224#define SYS_MFP_P17_KSCAN_I7 0x00800080UL
225#define SYS_MFP_P17_QDEC_Y1 0x00808000UL
226#define SYS_MFP_P17_LL_DBG07 0x00808080UL
227#define SYS_MFP_P17_Msk 0x00808080UL
229#define SYS_MFP_P20_GPIO 0x00000000UL
230#define SYS_MFP_P20_SPI1_CS 0x00000001UL
231#define SYS_MFP_P20_TMR1_EXT 0x00000100UL
232#define SYS_MFP_P20_INT2 0x00000101UL
233#define SYS_MFP_P20_ADC_CH6 0x00010000UL
234#define SYS_MFP_P20_KSCAN_I0 0x00010001UL
235#define SYS_MFP_P20_QDEC_Z0 0x00010100UL
236#define SYS_MFP_P20_LL_DBG08 0x00010101UL
237#define SYS_MFP_P20_Msk 0x00010101UL
239#define SYS_MFP_P21_GPIO 0x00000000UL
240#define SYS_MFP_P21_SPI1_CLK 0x00000002UL
241#define SYS_MFP_P21_TMR2_EXT 0x00000200UL
242#define SYS_MFP_P21_MDM_DBG04 0x00000202UL
243#define SYS_MFP_P21_ADC_CH7 0x00020000UL
244#define SYS_MFP_P21_KSCAN_I1 0x00020002UL
245#define SYS_MFP_P21_QDEC_Z1 0x00020200UL
246#define SYS_MFP_P21_LL_DBG09 0x00020202UL
247#define SYS_MFP_P21_Msk 0x00020202UL
249#define SYS_MFP_P22_GPIO 0x00000000UL
250#define SYS_MFP_P22_QDEC_X_IDX 0x00000004UL
251#define SYS_MFP_P22_PWM1_CH4 0x00000400UL
252#define SYS_MFP_P22_I2SS_CLK 0x00000404UL
253#define SYS_MFP_P22_SPI1_MISO 0x00040000UL
254#define SYS_MFP_P22_KSCAN_I2 0x00040004UL
255#define SYS_MFP_P22_I2SM_CLK 0x00040400UL
256#define SYS_MFP_P22_LL_DBG05 0x00040404UL
257#define SYS_MFP_P22_Msk 0x00040404UL
259#define SYS_MFP_P23_GPIO 0x00000000UL
260#define SYS_MFP_P23_QDEC_Y_IDX 0x00000008UL
261#define SYS_MFP_P23_PWM1_CH5 0x00000800UL
262#define SYS_MFP_P23_I2SS_WS 0x00000808UL
263#define SYS_MFP_P23_SPI1_MOSI 0x00080000UL
264#define SYS_MFP_P23_KSCAN_I3 0x00080008UL
265#define SYS_MFP_P23_I2SM_WS 0x00080800UL
266#define SYS_MFP_P23_LL_DBG06 0x00080808UL
267#define SYS_MFP_P23_Msk 0x00080808UL
269#define SYS_MFP_P24_GPIO 0x00000000UL
270#define SYS_MFP_P24_UART1_TX 0x00000010UL
271#define SYS_MFP_P24_SPI1_CLK 0x00001000UL
272#define SYS_MFP_P24_ANT_SW0 0x00001010UL
273#define SYS_MFP_P24_PWM1_CH0 0x00100000UL
274#define SYS_MFP_P24_KSCAN_O8 0x00100010UL
275#define SYS_MFP_P24_QDEC_Z0 0x00101000UL
276#define SYS_MFP_P24_MDM_DBG07 0x00101010UL
277#define SYS_MFP_P24_Msk 0x00101010UL
279#define SYS_MFP_P25_GPIO 0x00000000UL
280#define SYS_MFP_P25_UART1_RX 0x00000020UL
281#define SYS_MFP_P25_SPI1_CS 0x00002000UL
282#define SYS_MFP_P25_ANT_SW1 0x00002020UL
283#define SYS_MFP_P25_QDEC_Z_IDX 0x00200000UL
284#define SYS_MFP_P25_KSCAN_O9 0x00200020UL
285#define SYS_MFP_P25_PWM1_CH1 0x00202000UL
286#define SYS_MFP_P25_MDM_DBG08 0x00202020UL
287#define SYS_MFP_P25_Msk 0x00202020UL
289#define SYS_MFP_P26_GPIO 0x00000000UL
290#define SYS_MFP_P26_UART1_CTS 0x00000040UL
291#define SYS_MFP_P26_UART0_TX 0x00004000UL
292#define SYS_MFP_P26_SPI1_MISO 0x00004040UL
293#define SYS_MFP_P26_MDM_DBG17 0x00400000UL
294#define SYS_MFP_P26_KSCAN_O14 0x00400040UL
295#define SYS_MFP_P26_PWM1_CH2 0x00404000UL
296#define SYS_MFP_P26_LL_DBG12 0x00404040UL
297#define SYS_MFP_P26_Msk 0x00404040UL
299#define SYS_MFP_P27_GPIO 0x00000000UL
300#define SYS_MFP_P27_UART1_RTS 0x00000080UL
301#define SYS_MFP_P27_UART0_RX 0x00008000UL
302#define SYS_MFP_P27_SPI1_MOSI 0x00008080UL
303#define SYS_MFP_P27_ADC_CH2 0x00800000UL
304#define SYS_MFP_P27_KSCAN_O15 0x00800080UL
305#define SYS_MFP_P27_QDEC_Z1 0x00808000UL
306#define SYS_MFP_P27_MDM_DBG10 0x00808080UL
307#define SYS_MFP_P27_Msk 0x00808080UL
309#define SYS_MFP_P30_GPIO 0x00000000UL
310#define SYS_MFP_P30_UART0_TX 0x00000001UL
311#define SYS_MFP_P30_PWM1_CH6 0x00000100UL
312#define SYS_MFP_P30_SPI0_MOSI 0x00000101UL
313#define SYS_MFP_P30_ADC_CH1 0x00010000UL
314#define SYS_MFP_P30_KSCAN_I4 0x00010001UL
315#define SYS_MFP_P30_MDM_DBG11 0x00010100UL
316#define SYS_MFP_P30_MDM_SPI_CLK 0x00010101UL
317#define SYS_MFP_P30_Msk 0x00010101UL
319#define SYS_MFP_P31_GPIO 0x00000000UL
320#define SYS_MFP_P31_UART0_RX 0x00000002UL
321#define SYS_MFP_P31_PWM1_CH7 0x00000200UL
322#define SYS_MFP_P31_SPI0_MISO 0x00000202UL
323#define SYS_MFP_P31_ADC_CH0 0x00020000UL
324#define SYS_MFP_P31_KSCAN_I5 0x00020002UL
325#define SYS_MFP_P31_MDM_DBG12 0x00020200UL
326#define SYS_MFP_P31_MDM_SPI_CS 0x00020202UL
327#define SYS_MFP_P31_Msk 0x00020202UL
329#define SYS_MFP_P32_GPIO 0x00000000UL
330#define SYS_MFP_P32_SPI0_CS 0x00000004UL
331#define SYS_MFP_P32_BOD_OUT 0x00000400UL
332#define SYS_MFP_P32_INT0 0x00000404UL
333#define SYS_MFP_P32_PWM0_CH2 0x00040000UL
334#define SYS_MFP_P32_KSCAN_O16 0x00040004UL
335#define SYS_MFP_P32_MDM_DBG14 0x00040400UL
336#define SYS_MFP_P32_MDM_SPI_MOSI 0x00040404UL
337#define SYS_MFP_P32_Msk 0x00040404UL
339#define SYS_MFP_P33_GPIO 0x00000000UL
340#define SYS_MFP_P33_SPI0_CLK 0x00000008UL
341#define SYS_MFP_P33_LVR_OUT 0x00000800UL
342#define SYS_MFP_P33_UART0_RTS 0x00000808UL
343#define SYS_MFP_P33_PWM0_CH3 0x00080000UL
344#define SYS_MFP_P33_KSCAN_O17 0x00080008UL
345#define SYS_MFP_P33_LL_DBG03 0x00080800UL
346#define SYS_MFP_P33_MDM_SPI_MISO 0x00080808UL
347#define SYS_MFP_P33_Msk 0x00080808UL
349#define SYS_MFP_P34_GPIO 0x00000000UL
350#define SYS_MFP_P34_PWM2_CH4 0x00000010UL
351#define SYS_MFP_P34_KSCAN_O18 0x00001000UL
352#define SYS_MFP_P34_MDM_DBG02 0x00001010UL
353#define SYS_MFP_P34_MDM_TX_DATA 0x00100000UL
354#define SYS_MFP_P34_TMR1_EXT 0x00100010UL
355#define SYS_MFP_P34_USB_DIP 0x00101000UL
356#define SYS_MFP_P34_RESERVED 0x00101010UL
357#define SYS_MFP_P34_Msk 0x00101010UL
359#define SYS_MFP_P35_GPIO 0x00000000UL
360#define SYS_MFP_P35_PWM2_CH5 0x00000020UL
361#define SYS_MFP_P35_KSCAN_O19 0x00002000UL
362#define SYS_MFP_P35_MDM_DBG05 0x00002020UL
363#define SYS_MFP_P35_MDM_TX_ON 0x00200000UL
364#define SYS_MFP_P35_UART0_CTS 0x00200020UL
365#define SYS_MFP_P35_USB_DIM 0x00202000UL
366#define SYS_MFP_P35_RESERVED 0x00202020UL
367#define SYS_MFP_P35_Msk 0x00202020UL
369#define SYS_MFP_P36_GPIO 0x00000000UL
370#define SYS_MFP_P36_PWM2_CH6 0x00000040UL
371#define SYS_MFP_P36_KSCAN_O20 0x00004000UL
372#define SYS_MFP_P36_MDM_DBG06 0x00004040UL
373#define SYS_MFP_P36_MDM_RX_ON 0x00400000UL
374#define SYS_MFP_P36_CALIB_CLK 0x00400040UL
375#define SYS_MFP_P36_USB_DIDIF 0x00404000UL
376#define SYS_MFP_P36_RESERVED 0x00404040UL
377#define SYS_MFP_P36_Msk 0x00404040UL
379#define SYS_MFP_P37_GPIO 0x00000000UL
380#define SYS_MFP_P37_PWM2_CH7 0x00000080UL
381#define SYS_MFP_P37_KSCAN_O21 0x00008000UL
382#define SYS_MFP_P37_KSCAN_I2 0x00008080UL
383#define SYS_MFP_P37_MDM_ACC_MATCH 0x00800000UL
384#define SYS_MFP_P37_MDM_DBG15 0x00800080UL
385#define SYS_MFP_P37_USB_DOP 0x00808000UL
386#define SYS_MFP_P37_RESERVED 0x00808080UL
387#define SYS_MFP_P37_Msk 0x00808080UL
389#define SYS_MFP_P40_GPIO 0x00000000UL
390#define SYS_MFP_P40_SPI0_CLK 0x00000001UL
391#define SYS_MFP_P40_I2C0_SDA 0x00000100UL
392#define SYS_MFP_P40_I2SS_CLK 0x00000101UL
393#define SYS_MFP_P40_I2SM_CLK 0x00010000UL
394#define SYS_MFP_P40_MDM_RX_DATA 0x00010001UL
395#define SYS_MFP_P40_PWM2_CH0 0x00010100UL
396#define SYS_MFP_P40_KSCAN_O2 0x00010101UL
397#define SYS_MFP_P40_Msk 0x00010101UL
399#define SYS_MFP_P41_GPIO 0x00000000UL
400#define SYS_MFP_P41_SPI0_CS 0x00000002UL
401#define SYS_MFP_P41_I2SS_DI 0x00000200UL
402#define SYS_MFP_P41_PWM2_CH1 0x00000202UL
403#define SYS_MFP_P41_I2SM_DI 0x00020000UL
404#define SYS_MFP_P41_MDM_RX_CLK 0x00020002UL
405#define SYS_MFP_P41_MDM_DBG13 0x00020200UL
406#define SYS_MFP_P41_I2C0_SCL 0x00020202UL
407#define SYS_MFP_P41_Msk 0x00020202UL
409#define SYS_MFP_P42_GPIO 0x00000000UL
410#define SYS_MFP_P42_SPI0_MISO 0x00000004UL
411#define SYS_MFP_P42_I2SS_DO 0x00000400UL
412#define SYS_MFP_P42_PWM2_CH2 0x00000404UL
413#define SYS_MFP_P42_I2SM_DO 0x00040000UL
414#define SYS_MFP_P42_MDM_RX_DAT0 0x00040004UL
415#define SYS_MFP_P42_LL_DBG02 0x00040400UL
416#define SYS_MFP_P42_MDM_DBG20 0x00040404UL
417#define SYS_MFP_P42_Msk 0x00040404UL
419#define SYS_MFP_P43_GPIO 0x00000000UL
420#define SYS_MFP_P43_SPI0_MOSI 0x00000008UL
421#define SYS_MFP_P43_UART0_RX 0x00000800UL
422#define SYS_MFP_P43_PWM2_CH3 0x00000808UL
423#define SYS_MFP_P43_I2SMCLK 0x00080000UL
424#define SYS_MFP_P43_MDM_RX_DAT1 0x00080008UL
425#define SYS_MFP_P43_UART0_TX 0x00080008UL
426#define SYS_MFP_P43_MDM_DBG00 0x00080800UL
427#define SYS_MFP_P43_KSCAN_O15 0x00080808UL
428#define SYS_MFP_P43_Msk 0x00080808UL
430#define SYS_MFP_P44_GPIO 0x00000000UL
431#define SYS_MFP_P44_UART0_TX 0x00000010UL
432#define SYS_MFP_P44_I2SS_WS 0x00001000UL
433#define SYS_MFP_P44_PWM2_CH4 0x00001010UL
434#define SYS_MFP_P44_I2SM_WS 0x00100000UL
435#define SYS_MFP_P44_MDM_IO_RSTN 0x00100010UL
436#define SYS_MFP_P44_MDM_DBG01 0x00101000UL
437#define SYS_MFP_P44_USB_DOM 0x00101010UL
438#define SYS_MFP_P44_Msk 0x00101010UL
440#define SYS_MFP_P45_GPIO 0x00000000UL
441#define SYS_MFP_P45_PWM2_CH0 0x00000020UL
442#define SYS_MFP_P45_KSCAN_O22 0x00002000UL
443#define SYS_MFP_P45_MDM_EST_DONE 0x00002020UL
444#define SYS_MFP_P45_USB_NDOE 0x00200000UL
445#define SYS_MFP_P45_RESERVED 0x00200020UL
446#define SYS_MFP_P45_RESERVED1 0x00202000UL
447#define SYS_MFP_P45_RESERVED2 0x00202020UL
448#define SYS_MFP_P45_Msk 0x00202020UL
450#define SYS_MFP_P46_GPIO 0x00000000UL
451#define SYS_MFP_P46_SWD_CLK 0x00000040UL
452#define SYS_MFP_P46_UART1_RX 0x00004000UL
453#define SYS_MFP_P46_I2C0_SCL 0x00004040UL
454#define SYS_MFP_P46_SPI0_CLK 0x00400000UL
455#define SYS_MFP_P46_ANT_SW5 0x00400040UL
456#define SYS_MFP_P46_KSCAN_O0 0x00404000UL
457#define SYS_MFP_P46_MDM_DBG09 0x00404040UL
458#define SYS_MFP_P46_Msk 0x00404040UL
460#define SYS_MFP_P47_GPIO 0x00000000UL
461#define SYS_MFP_P47_SWD_DAT 0x00000080UL
462#define SYS_MFP_P47_UART1_TX 0x00008000UL
463#define SYS_MFP_P47_I2C0_SDA 0x00008080UL
464#define SYS_MFP_P47_SPI0_CS 0x00800000UL
465#define SYS_MFP_P47_ANT_SW6 0x00800080UL
466#define SYS_MFP_P47_KSCAN_O1 0x00808000UL
467#define SYS_MFP_P47_MDM_DBG16 0x00808080UL
468#define SYS_MFP_P47_Msk 0x00808080UL
470#define SYS_MFP_P50_GPIO 0x00000000UL
471#define SYS_MFP_P50_PWM2_CH1 0x00000001UL
472#define SYS_MFP_P50_KSCAN_O0 0x00000100UL
473#define SYS_MFP_P50_MDM_STDBY_EN 0x00000101UL
474#define SYS_MFP_P50_FSYNSD_D 0x00010000UL
475#define SYS_MFP_P50_RESERVED1 0x00010001UL
476#define SYS_MFP_P50_RESERVED2 0x00010100UL
477#define SYS_MFP_P50_RCO_32M 0x00010101UL
478#define SYS_MFP_P50_Msk 0x00010101UL
480#define SYS_MFP_P51_GPIO 0x00000000UL
481#define SYS_MFP_P51_PWM1_CH7 0x00000002UL
482#define SYS_MFP_P51_KSCAN_O1 0x00000200UL
483#define SYS_MFP_P51_QDEC_X_IDX 0x00000202UL
484#define SYS_MFP_P51_FSYNSD_DIV2 0x00020000UL
485#define SYS_MFP_P51_RESERVED1 0x00020002UL
486#define SYS_MFP_P51_RESERVED2 0x00020200UL
487#define SYS_MFP_P51_XTH_32M 0x00020202UL
488#define SYS_MFP_P51_Msk 0x00020202UL
490#define SYS_MFP_P52_GPIO 0x00000000UL
491#define SYS_MFP_P52_EXT_STADC 0x00000004UL
492#define SYS_MFP_P52_SPI1_CS 0x00000400UL
493#define SYS_MFP_P52_INT1 0x00000404UL
494#define SYS_MFP_P52_ADC_CH3 0x00040000UL
495#define SYS_MFP_P52_KSCAN_O2 0x00040004UL
496#define SYS_MFP_P52_ANT_SW7 0x00040400UL
497#define SYS_MFP_P52_LL_DBG00 0x00040404UL
498#define SYS_MFP_P52_Msk 0x00040404UL
500#define SYS_MFP_P53_GPIO 0x00000000UL
501#define SYS_MFP_P53_PWM1_CH3 0x00000008UL
502#define SYS_MFP_P53_KSCAN_O3 0x00000800UL
503#define SYS_MFP_P53_QDEC_Y_IDX 0x00000808UL
504#define SYS_MFP_P53_RESERVED 0x00080000UL
505#define SYS_MFP_P53_RESERVED1 0x00080008UL
506#define SYS_MFP_P53_RESERVED2 0x00080800UL
507#define SYS_MFP_P53_RESERVED3 0x00080808UL
508#define SYS_MFP_P53_Msk 0x00080808UL
510#define SYS_MFP_P54_GPIO 0x00000000UL
511#define SYS_MFP_P54_PWM2_CH2 0x00000010UL
512#define SYS_MFP_P54_KSCAN_O23 0x00001000UL
513#define SYS_MFP_P54_QDEC_Z_IDX 0x00001010UL
514#define SYS_MFP_P54_RESERVED 0x00100000UL
515#define SYS_MFP_P54_RESERVED1 0x00100010UL
516#define SYS_MFP_P54_RESERVED2 0x00101000UL
517#define SYS_MFP_P54_RESERVED3 0x00101010UL
518#define SYS_MFP_P54_Msk 0x00101010UL
520#define SYS_MFP_P55_GPIO 0x00000000UL
521#define SYS_MFP_P55_PWM2_CH3 0x00000020UL
522#define SYS_MFP_P55_KSCAN_O4 0x00002000UL
523#define SYS_MFP_P55_QDEC_X0 0x00002020UL
524#define SYS_MFP_P55_RESERVED 0x00200000UL
525#define SYS_MFP_P55_RESERVED1 0x00200020UL
526#define SYS_MFP_P55_RESERVED2 0x00202000UL
527#define SYS_MFP_P55_RESERVED3 0x00202020UL
528#define SYS_MFP_P55_Msk 0x00202020UL
530#define SYS_MFP_P56_GPIO 0x00000000UL
531#define SYS_MFP_P56_PWM1_CH6 0x00000040UL
532#define SYS_MFP_P56_UART0_CTS 0x00004000UL
533#define SYS_MFP_P56_UART1_TX 0x00004040UL
534#define SYS_MFP_P56_QDEC_X0 0x00400000UL
535#define SYS_MFP_P56_KSCAN_O11 0x00400040UL
536#define SYS_MFP_P56_MDM_DBG19 0x00404000UL
537#define SYS_MFP_P56_LL_DBG11 0x00404040UL
538#define SYS_MFP_P56_Msk 0x00404040UL
540#define SYS_MFP_P57_GPIO 0x00000000UL
541#define SYS_MFP_P57_PWM2_CH5 0x00000080UL
542#define SYS_MFP_P57_KSCAN_O5 0x00008000UL
543#define SYS_MFP_P57_QDEC_X1 0x00008080UL
544#define SYS_MFP_P57_RESERVED 0x00800000UL
545#define SYS_MFP_P57_RESERVED1 0x00800080UL
546#define SYS_MFP_P57_RESERVED2 0x00808000UL
547#define SYS_MFP_P57_RESERVED3 0x00808080UL
548#define SYS_MFP_P57_Msk 0x00808080UL
558#define SYS_SET_MFP(Port, Bit, Func) \
559 (SYS->Port##_MFP = (SYS->Port##_MFP & ~SYS_MFP_##Port##Bit##_Msk) | SYS_MFP_##Port##Bit##_##Func)
560
564#define SYS_BLDBCTL_BODDBSEL_2POW4 0x00000001UL
565#define SYS_BLDBCTL_BODDBSEL_2POW7 0x00000002UL
566#define SYS_BLDBCTL_BODDBSEL_2POW9 0x00000004UL
567#define SYS_BLDBCTL_BODDBSEL_2POW11 0x00000008UL
568#define SYS_BLDBCTL_BODDBSEL_2POW13 0x00000010UL
569#define SYS_BLDBCTL_BODDBSEL_2POW15 0x00000020UL
571#define SYS_BLDBCTL_LVRDBSEL_2POW4 0x00000100UL
572#define SYS_BLDBCTL_LVRDBSEL_2POW7 0x00000200UL
573#define SYS_BLDBCTL_LVRDBSEL_2POW9 0x00000400UL
574#define SYS_BLDBCTL_LVRDBSEL_2POW11 0x00000800UL
575#define SYS_BLDBCTL_LVRDBSEL_2POW13 0x00001000UL
576#define SYS_BLDBCTL_LVRDBSEL_2POW15 0x00002000UL
586#define SYS_ENABLE_BOD_RST() (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk)
587
594__STATIC_INLINE void SYS_UnlockReg(void)
595{
596 do
597 {
598 SYS->REGLCTL = 0x59;
599 SYS->REGLCTL = 0x16;
600 SYS->REGLCTL = 0x88;
601 }
602 while(SYS->REGLCTL == 0);
603}
604
611__STATIC_INLINE void SYS_LockReg(void)
612{
613 // (Workaround) To insure write-protected reg
614 // is succefully wrote before lock
615#if 1
616 __NOP();__NOP();__NOP();__NOP();__NOP();
617#else
618 __ISB();
619#endif
620 SYS->REGLCTL = 0;
621}
622
628uint32_t SYS_IsRegLocked(void);
629
634void SYS_DisableBOD(void);
635
641void SYS_delay_10nop(uint32_t u32NopCnt);
642
645#ifdef __cplusplus
646}
647#endif
648
649#endif /* __PAN_SYS_H__ */
__STATIC_INLINE void SYS_LockReg(void)
Enable register write-protection function.
Definition: pan_sys.h:611
void SYS_delay_10nop(uint32_t u32NopCnt)
Set delay time.
void SYS_DisableBOD(void)
This function disable BOD function.
uint32_t SYS_IsRegLocked(void)
This function check register write-protection bit setting.
__STATIC_INLINE void SYS_UnlockReg(void)
Disable register write-protection function.
Definition: pan_sys.h:594