17#ifndef LIBBSP_ARM_LPC32XX_LPC32XX_H
18#define LIBBSP_ARM_LPC32XX_LPC32XX_H
44#define LPC32XX_BASE_ADC 0x40048000
45#define LPC32XX_BASE_SYSCON 0x40004000
46#define LPC32XX_BASE_DEBUG_CTRL 0x40040000
47#define LPC32XX_BASE_DMA 0x31000000
48#define LPC32XX_BASE_EMC 0x31080000
49#define LPC32XX_BASE_EMC_CS_0 0xe0000000
50#define LPC32XX_BASE_EMC_CS_1 0xe1000000
51#define LPC32XX_BASE_EMC_CS_2 0xe2000000
52#define LPC32XX_BASE_EMC_CS_3 0xe3000000
53#define LPC32XX_BASE_EMC_DYCS_0 0x80000000
54#define LPC32XX_BASE_EMC_DYCS_1 0xa0000000
55#define LPC32XX_BASE_ETB_CFG 0x310c0000
56#define LPC32XX_BASE_ETB_DATA 0x310e0000
57#define LPC32XX_BASE_ETHERNET 0x31060000
58#define LPC32XX_BASE_GPIO 0x40028000
59#define LPC32XX_BASE_I2C_1 0x400a0000
60#define LPC32XX_BASE_I2C_2 0x400a8000
61#define LPC32XX_BASE_I2S_0 0x20094000
62#define LPC32XX_BASE_I2S_1 0x2009c000
63#define LPC32XX_BASE_IRAM 0x08000000
64#define LPC32XX_BASE_IROM 0x0c000000
65#define LPC32XX_BASE_KEYSCAN 0x40050000
66#define LPC32XX_BASE_LCD 0x31040000
67#define LPC32XX_BASE_MCPWM 0x400e8000
68#define LPC32XX_BASE_MIC 0x40008000
69#define LPC32XX_BASE_NAND_MLC 0x200a8000
70#define LPC32XX_BASE_NAND_SLC 0x20020000
71#define LPC32XX_BASE_PWM_1 0x4005c000
72#define LPC32XX_BASE_PWM_2 0x4005c004
73#define LPC32XX_BASE_PWM_3 0x4002c000
74#define LPC32XX_BASE_PWM_4 0x40030000
75#define LPC32XX_BASE_RTC 0x40024000
76#define LPC32XX_BASE_RTC_RAM 0x40024080
77#define LPC32XX_BASE_SDCARD 0x20098000
78#define LPC32XX_BASE_SIC_1 0x4000c000
79#define LPC32XX_BASE_SIC_2 0x40010000
80#define LPC32XX_BASE_SPI_1 0x20088000
81#define LPC32XX_BASE_SPI_2 0x20090000
82#define LPC32XX_BASE_SSP_0 0x20084000
83#define LPC32XX_BASE_SSP_1 0x2008c000
84#define LPC32XX_BASE_TIMER_0 0x40044000
85#define LPC32XX_BASE_TIMER_1 0x4004c000
86#define LPC32XX_BASE_TIMER_2 0x40058000
87#define LPC32XX_BASE_TIMER_3 0x40060000
88#define LPC32XX_BASE_TIMER_5 0x4002c000
89#define LPC32XX_BASE_TIMER_6 0x40030000
90#define LPC32XX_BASE_TIMER_HS 0x40038000
91#define LPC32XX_BASE_TIMER_MS 0x40034000
92#define LPC32XX_BASE_UART_1 0x40014000
93#define LPC32XX_BASE_UART_2 0x40018000
94#define LPC32XX_BASE_UART_3 0x40080000
95#define LPC32XX_BASE_UART_4 0x40088000
96#define LPC32XX_BASE_UART_5 0x40090000
97#define LPC32XX_BASE_UART_6 0x40098000
98#define LPC32XX_BASE_UART_7 0x4001c000
99#define LPC32XX_BASE_USB 0x31020000
100#define LPC32XX_BASE_USB_OTG_I2C 0x31020300
101#define LPC32XX_BASE_WDT 0x4003c000
111#define LPC32XX_U3CLK (*(volatile uint32_t *) 0x400040d0)
112#define LPC32XX_U4CLK (*(volatile uint32_t *) 0x400040d4)
113#define LPC32XX_U5CLK (*(volatile uint32_t *) 0x400040d8)
114#define LPC32XX_U6CLK (*(volatile uint32_t *) 0x400040dc)
115#define LPC32XX_IRDACLK (*(volatile uint32_t *) 0x400040e0)
116#define LPC32XX_UART_CTRL (*(volatile uint32_t *) 0x40054000)
117#define LPC32XX_UART_CLKMODE (*(volatile uint32_t *) 0x40054004)
118#define LPC32XX_UART_LOOP (*(volatile uint32_t *) 0x40054008)
119#define LPC32XX_SW_INT (*(volatile uint32_t *) 0x400040a8)
120#define LPC32XX_MAC_CLK_CTRL (*(volatile uint32_t *) 0x40004090)
121#define LPC32XX_USB_DIV (*(volatile uint32_t *) 0x4000401c)
122#define LPC32XX_OTG_CLK_CTRL (*(volatile uint32_t *) 0x31020ff4)
123#define LPC32XX_OTG_CLK_STAT (*(volatile uint32_t *) 0x31020ff8)
124#define LPC32XX_OTG_STAT_CTRL (*(volatile uint32_t *) 0x31020110)
125#define LPC32XX_I2C_RX (*(volatile uint32_t *) 0x31020300)
126#define LPC32XX_I2C_TX (*(volatile uint32_t *) 0x31020300)
127#define LPC32XX_I2C_STS (*(volatile uint32_t *) 0x31020304)
128#define LPC32XX_I2C_CTL (*(volatile uint32_t *) 0x31020308)
129#define LPC32XX_I2C_CLKHI (*(volatile uint32_t *) 0x3102030c)
130#define LPC32XX_I2C_CLKLO (*(volatile uint32_t *) 0x31020310)
131#define LPC32XX_PWR_CTRL (*(volatile uint32_t *) 0x40004044)
132#define LPC32XX_OSC_CTRL (*(volatile uint32_t *) 0x4000404c)
133#define LPC32XX_SYSCLK_CTRL (*(volatile uint32_t *) 0x40004050)
134#define LPC32XX_PLL397_CTRL (*(volatile uint32_t *) 0x40004048)
135#define LPC32XX_HCLKPLL_CTRL (*(volatile uint32_t *) 0x40004058)
136#define LPC32XX_HCLKDIV_CTRL (*(volatile uint32_t *) 0x40004040)
137#define LPC32XX_TEST_CLK (*(volatile uint32_t *) 0x400040a4)
138#define LPC32XX_AUTOCLK_CTRL (*(volatile uint32_t *) 0x400040ec)
139#define LPC32XX_START_ER_PIN (*(volatile uint32_t *) 0x40004030)
140#define LPC32XX_START_ER_INT (*(volatile uint32_t *) 0x40004020)
141#define LPC32XX_P0_INTR_ER (*(volatile uint32_t *) 0x40004018)
142#define LPC32XX_START_SR_PIN (*(volatile uint32_t *) 0x40004038)
143#define LPC32XX_START_SR_INT (*(volatile uint32_t *) 0x40004028)
144#define LPC32XX_START_RSR_PIN (*(volatile uint32_t *) 0x40004034)
145#define LPC32XX_START_RSR_INT (*(volatile uint32_t *) 0x40004024)
146#define LPC32XX_START_APR_PIN (*(volatile uint32_t *) 0x4000403c)
147#define LPC32XX_START_APR_INT (*(volatile uint32_t *) 0x4000402c)
148#define LPC32XX_USB_CTRL (*(volatile uint32_t *) 0x40004064)
149#define LPC32XX_USBDIV_CTRL (*(volatile uint32_t *) 0x4000401c)
150#define LPC32XX_MS_CTRL (*(volatile uint32_t *) 0x40004080)
151#define LPC32XX_DMACLK_CTRL (*(volatile uint32_t *) 0x400040e8)
152#define LPC32XX_FLASHCLK_CTRL (*(volatile uint32_t *) 0x400040c8)
153#define LPC32XX_MACCLK_CTRL (*(volatile uint32_t *) 0x40004090)
154#define LPC32XX_LCDCLK_CTRL (*(volatile uint32_t *) 0x40004054)
155#define LPC32XX_I2S_CTRL (*(volatile uint32_t *) 0x4000407c)
156#define LPC32XX_SSP_CTRL (*(volatile uint32_t *) 0x40004078)
157#define LPC32XX_SPI_CTRL (*(volatile uint32_t *) 0x400040c4)
158#define LPC32XX_I2CCLK_CTRL (*(volatile uint32_t *) 0x400040ac)
159#define LPC32XX_TIMCLK_CTRL1 (*(volatile uint32_t *) 0x400040c0)
160#define LPC32XX_TIMCLK_CTRL (*(volatile uint32_t *) 0x400040bc)
161#define LPC32XX_ADCLK_CTRL (*(volatile uint32_t *) 0x400040b4)
162#define LPC32XX_ADCLK_CTRL1 (*(volatile uint32_t *) 0x40004060)
163#define LPC32XX_KEYCLK_CTRL (*(volatile uint32_t *) 0x400040b0)
164#define LPC32XX_PWMCLK_CTRL (*(volatile uint32_t *) 0x400040b8)
165#define LPC32XX_UARTCLK_CTRL (*(volatile uint32_t *) 0x400040e4)
166#define LPC32XX_POS0_IRAM_CTRL (*(volatile uint32_t *) 0x40004110)
167#define LPC32XX_POS1_IRAM_CTRL (*(volatile uint32_t *) 0x40004114)
168#define LPC32XX_SDRAMCLK_CTRL (*(volatile uint32_t *) 0x40004068)
178#define PWR_STOP BSP_BIT32(0)
179#define PWR_HIGHCORE_ALWAYS BSP_BIT32(1)
180#define PWR_NORMAL_RUN_MODE BSP_BIT32(2)
181#define PWR_SYSCLKEN_ALWAYS BSP_BIT32(3)
182#define PWR_SYSCLKEN_HIGH BSP_BIT32(4)
183#define PWR_HIGHCORE_HIGH BSP_BIT32(5)
184#define PWR_SDRAM_AUTO_REFRESH BSP_BIT32(7)
185#define PWR_UPDATE_EMCSREFREQ BSP_BIT32(8)
186#define PWR_EMCSREFREQ BSP_BIT32(9)
187#define PWR_HCLK_USES_PERIPH_CLK BSP_BIT32(10)
197#define HCLK_PLL_LOCK BSP_BIT32(0)
198#define HCLK_PLL_M(val) BSP_FLD32(val, 1, 8)
199#define HCLK_PLL_M_GET(reg) BSP_FLD32GET(reg, 1, 8)
200#define HCLK_PLL_N(val) BSP_FLD32(val, 9, 10)
201#define HCLK_PLL_N_GET(reg) BSP_FLD32GET(reg, 9, 10)
202#define HCLK_PLL_P(val) BSP_FLD32(val, 11, 12)
203#define HCLK_PLL_P_GET(reg) BSP_FLD32GET(reg, 11, 12)
204#define HCLK_PLL_FBD_FCLKOUT BSP_BIT32(13)
205#define HCLK_PLL_DIRECT BSP_BIT32(14)
206#define HCLK_PLL_BYPASS BSP_BIT32(15)
207#define HCLK_PLL_POWER BSP_BIT32(16)
217#define HCLK_DIV_HCLK(val) BSP_FLD32(val, 0, 1)
218#define HCLK_DIV_HCLK_GET(reg) BSP_FLD32GET(reg, 0, 1)
219#define HCLK_DIV_PERIPH_CLK(val) BSP_FLD32(val, 2, 6)
220#define HCLK_DIV_PERIPH_CLK_GET(reg) BSP_FLD32GET(reg, 2, 6)
221#define HCLK_DIV_DDRAM_CLK(val) BSP_FLD32(val, 7, 8)
222#define HCLK_DIV_DDRAM_CLK_GET(reg) BSP_FLD32GET(reg, 7, 8)
232#define TIMCLK_CTRL_WDT BSP_BIT32(0)
233#define TIMCLK_CTRL_HST BSP_BIT32(1)
237#define LPC32XX_FILL(a, b, s) uint8_t reserved_ ## b [b - a - sizeof(s)]
238#define LPC32XX_RESERVE(a, b) uint8_t reserved_ ## b [b - a]
282#define WDTTIM_INT_MATCH_INT BSP_BIT32(0)
292#define WDTTIM_CTRL_COUNT_ENAB BSP_BIT32(0)
293#define WDTTIM_CTRL_RESET_COUNT BSP_BIT32(1)
294#define WDTTIM_CTRL_PAUSE_EN BSP_BIT32(2)
304#define WDTTIM_MCTRL_MR0_INT BSP_BIT32(0)
305#define WDTTIM_MCTRL_RESET_COUNT0 BSP_BIT32(1)
306#define WDTTIM_MCTRL_STOP_COUNT0 BSP_BIT32(2)
307#define WDTTIM_MCTRL_M_RES1 BSP_BIT32(3)
308#define WDTTIM_MCTRL_M_RES2 BSP_BIT32(4)
309#define WDTTIM_MCTRL_RESFRC1 BSP_BIT32(5)
310#define WDTTIM_MCTRL_RESFRC2 BSP_BIT32(6)
320#define WDTTIM_EMR_EXT_MATCH0 BSP_BIT32(0)
321#define WDTTIM_EMR_MATCH_CTRL(val) BSP_FLD32(val, 4, 5)
322#define WDTTIM_EMR_MATCH_CTRL_SET(reg, val) BSP_FLD32SET(reg, val, 4, 5)
332#define WDTTIM_RES_WDT BSP_BIT32(0)
377 uint32_t reserved_0 [2];
381 uint32_t reserved_1 [45];
384 uint32_t rxdescriptor;
386 uint32_t rxdescriptornum;
387 uint32_t rxproduceindex;
388 uint32_t rxconsumeindex;
389 uint32_t txdescriptor;
391 uint32_t txdescriptornum;
392 uint32_t txproduceindex;
393 uint32_t txconsumeindex;
394 uint32_t reserved_2 [10];
398 uint32_t reserved_3 [3];
399 uint32_t flowcontrolcnt;
400 uint32_t flowcontrolsts;
401 uint32_t reserved_4 [34];
402 uint32_t rxfilterctrl;
403 uint32_t rxfilterwolsts;
404 uint32_t rxfilterwolclr;
405 uint32_t reserved_5 [1];
406 uint32_t hashfilterl;
407 uint32_t hashfilterh;
408 uint32_t reserved_6 [882];
413 uint32_t reserved_7 [1];
427 uint32_t p3_inp_state;
428 uint32_t p3_outp_set;
429 uint32_t p3_outp_clr;
430 uint32_t p3_outp_state;
433 uint32_t p2_dir_state;
434 uint32_t p2_inp_state;
435 uint32_t p2_outp_set;
436 uint32_t p2_outp_clr;
439 uint32_t p2_mux_state;
440 LPC32XX_RESERVE(0x034, 0x040);
441 uint32_t p0_inp_state;
442 uint32_t p0_outp_set;
443 uint32_t p0_outp_clr;
444 uint32_t p0_outp_state;
447 uint32_t p0_dir_state;
448 LPC32XX_RESERVE(0x05c, 0x060);
449 uint32_t p1_inp_state;
450 uint32_t p1_outp_set;
451 uint32_t p1_outp_clr;
452 uint32_t p1_outp_state;
455 uint32_t p1_dir_state;
456 LPC32XX_RESERVE(0x07c, 0x110);
459 uint32_t p3_mux_state;
460 LPC32XX_RESERVE(0x11c, 0x120);
463 uint32_t p0_mux_state;
464 LPC32XX_RESERVE(0x12c, 0x130);
467 uint32_t p1_mux_state;
500 uint32_t reserved_0 [5];
509 uint32_t reserved_0 [8191];
515 uint32_t reserved_1 [8191];
520 uint32_t ecc_auto_enc;
521 uint32_t ecc_auto_dec;
526 uint32_t sw_wp_add_low;
527 uint32_t sw_wp_add_hig;
550 LPC32XX_FILL(0x20094000, 0x20098000,
lpc_i2s);
554 LPC32XX_FILL(0x2009c000, 0x200a8000,
lpc_i2s);
558 LPC32XX_FILL(0x31000000, 0x31020000,
lpc_dma);
566 LPC32XX_FILL(0x31080000, 0x31080400,
lpc_emc);
590 LPC32XX_FILL(0x4002c000, 0x40030000,
lpc_timer);
592 LPC32XX_FILL(0x40030000, 0x40034000,
lpc_timer);
602 LPC32XX_FILL(0x40044000, 0x40048000,
lpc_timer);
606 LPC32XX_FILL(0x4004c000, 0x40050000,
lpc_timer);
612 LPC32XX_FILL(0x40058000, 0x4005c000,
lpc_timer);
616 LPC32XX_FILL(0x40060000, 0x40080000,
lpc_timer);
This header file provides utility macros for BSPs.
Definition: intercom.c:87
Definition: 8xx_immap.h:195
Definition: lpc32xx.h:350
Definition: lpc32xx.h:347
Definition: lpc32xx.h:496
Definition: lpc32xx.h:258
Definition: lpc32xx.h:362
Definition: lpc32xx.h:426
Definition: lpc32xx.h:273
Definition: lpc32xx.h:470
Definition: lpc32xx.h:417
Definition: lpc32xx.h:353
Definition: lpc32xx.h:255
Definition: lpc32xx.h:359
Definition: lpc32xx.h:270
Definition: lpc32xx.h:503
Definition: lpc32xx.h:240
Definition: lpc32xx.h:356
Definition: lpc32xx.h:538
Definition: lpc32xx.h:485
Definition: lpc32xx.h:249
Definition: lpc32xx.h:246
Definition: lpc32xx.h:243
Definition: lpc32xx.h:261
Definition: lpc32xx.h:264
Definition: lpc32xx.h:267
Definition: lpc32xx.h:252
Definition: lpc32xx.h:336
DMA control block.
Definition: lpc-dma.h:79
Definition: lpc-emc.h:148
I2S control block.
Definition: lpc-i2s.h:59
Timer control block.
Definition: lpc-timer.h:147