Changeset 4a6cc2a in rtems
- Timestamp:
- 11/08/11 10:39:46 (12 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 3d1313e8
- Parents:
- 4c622e5
- Location:
- c/src/lib/libbsp/arm/lpc24xx
- Files:
-
- 1 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/arm/lpc24xx/ChangeLog
r4c622e5 r4a6cc2a 1 2011-11-08 Sebastian Huber <sebastian.huber@embedded-brains.de> 2 3 * include/lpc17xx.h: New file. 4 * Makefile.am, preinstall.am: Reflect change above. Update due to API 5 changes. 6 * configure.ac, console/console-config.c, include/bsp.h, include/io.h, 7 include/irq.h, include/lcd.h, include/lpc-clock-config.h, 8 include/lpc24xx.h, include/start-config.h, irq/irq-dispatch.c, 9 irq/irq.c, misc/bspidle.c, misc/io.c, misc/lcd.c, misc/restart.c, 10 misc/system-clocks.c, ssp/ssp.c, startup/bspreset.c, 11 startup/bspstart.c, startup/bspstarthooks.c, 12 startup/start-config-emc-dynamic.c, startup/start-config-emc-static.c, 13 startup/start-config-pinsel.c: Basic support for LPC17XX. New memory 14 configurations for W9825G2JB75I, IS42S32800B, and SST39VF3201. 15 1 16 2011-11-07 Sebastian Huber <sebastian.huber@embedded-brains.de> 2 17 -
c/src/lib/libbsp/arm/lpc24xx/Makefile.am
r4c622e5 r4a6cc2a 45 45 include_bsp_HEADERS += include/irq.h 46 46 include_bsp_HEADERS += include/lcd.h 47 include_bsp_HEADERS += include/lpc17xx.h 47 48 include_bsp_HEADERS += include/lpc24xx.h 48 49 include_bsp_HEADERS += include/lpc-clock-config.h … … 94 95 ../../shared/sbrk.c \ 95 96 ../../shared/src/stackalloc.c \ 96 ../../shared/src/uart-output-char.c \ 97 ../shared/abort/simple_abort.c 97 ../../shared/src/uart-output-char.c 98 98 99 99 # Startup 100 libbsp_a_SOURCES += startup/bspstart.c \ 101 startup/bspreset.c 100 libbsp_a_SOURCES += ../shared/startup/bsp-start-copy-sections.c 101 libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S 102 libbsp_a_SOURCES += startup/bspreset.c 103 libbsp_a_SOURCES += startup/bspstart.c 102 104 103 105 # IRQ -
c/src/lib/libbsp/arm/lpc24xx/configure.ac
r4c622e5 r4a6cc2a 33 33 RTEMS_BSPOPTS_HELP([LPC24XX_OSCILLATOR_RTC],[RTC oscillator frequency in Hz]) 34 34 35 RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[lpc17*],[120000000U]) 36 #RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[lpc17*],[96000000U]) 37 #RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[lpc17*],[48000000U]) 35 38 RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[lpc23*],[58982400U]) 36 39 RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[lpc24xx_plx800*],[51612800U]) 37 40 RTEMS_BSPOPTS_SET([LPC24XX_CCLK],[*],[72000000U]) 38 41 RTEMS_BSPOPTS_HELP([LPC24XX_CCLK],[CPU clock in Hz]) 42 43 RTEMS_BSPOPTS_SET([LPC24XX_PCLKDIV],[lpc17*],[2U]) 44 RTEMS_BSPOPTS_SET([LPC24XX_PCLKDIV],[*],[1U]) 45 RTEMS_BSPOPTS_HELP([LPC24XX_PCLKDIV],[peripheral clock divider for default PCLK (PCLK = CCLK / PCLKDIV)]) 46 47 RTEMS_BSPOPTS_SET([LPC24XX_EMCCLKDIV],[lpc17*],[2U]) 48 RTEMS_BSPOPTS_SET([LPC24XX_EMCCLKDIV],[*],[1U]) 49 RTEMS_BSPOPTS_HELP([LPC24XX_EMCCLKDIV],[peripheral clock divider for default EMCCLK (EMCCLK = CCLK / EMCCLKDIV)]) 39 50 40 51 RTEMS_BSPOPTS_SET([LPC24XX_UART_BAUD],[*],[115200U]) … … 45 56 RTEMS_BSPOPTS_HELP([LPC24XX_ETHERNET_RMII],[enable RMII for Ethernet]) 46 57 47 RTEMS_BSPOPTS_SET([LPC24XX_EMC_MICRON],[lpc24xx_plx800_rom_*],[1]) 48 RTEMS_BSPOPTS_SET([LPC24XX_EMC_MICRON],[lpc24xx_ncs_rom_*],[1]) 49 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_MICRON],[enable Micron configuration for EMC]) 58 RTEMS_BSPOPTS_SET([LPC24XX_EMC_MT48LC4M16A2],[lpc24xx_ncs_rom_*],[1]) 59 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_MT48LC4M16A2],[enable Micron MT48LC4M16A2 configuration for EMC]) 50 60 51 RTEMS_BSPOPTS_SET([LPC24XX_EMC_ NUMONYX],[lpc24xx_ncs_rom_*],[1])52 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_ NUMONYX],[enable Numonyxconfiguration for EMC])61 RTEMS_BSPOPTS_SET([LPC24XX_EMC_W9825G2JB75I],[lpc24xx_plx800_rom_*],[1]) 62 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_W9825G2JB75I],[enable Winbond W9825G2JB75I configuration for EMC]) 53 63 54 RTEMS_BSPOPTS_SET([LPC24XX_EMC_W9825G2JB],[lpc24xx_plx800_rom_*],[1]) 55 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_W9825G2JB],[enable Winbond W9825G2JB configuration for EMC]) 64 RTEMS_BSPOPTS_SET([LPC24XX_EMC_IS42S32800B],[lpc17xx_ea_rom_*],[1]) 65 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_IS42S32800B],[enable ISSI IS42S32800B configuration for EMC]) 66 67 RTEMS_BSPOPTS_SET([LPC24XX_EMC_NUMONYX_M29W160E],[lpc24xx_ncs_rom_*],[1]) 68 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_NUMONYX_M29W160E],[enable Numonyx M29W160E configuration for EMC]) 69 70 RTEMS_BSPOPTS_SET([LPC24XX_EMC_SST39VF3201],[lpc24xx_plx800_rom_*],[1]) 71 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_SST39VF3201],[enable SST39VF3201 configuration for EMC]) 56 72 57 73 RTEMS_BSPOPTS_SET([LPC24XX_EMC_TEST],[*],[]) -
c/src/lib/libbsp/arm/lpc24xx/console/console-config.c
r4c622e5 r4a6cc2a 51 51 }; 52 52 53 lpc24xx_module_enable(LPC24XX_MODULE_UART_1, LPC24XX_MODULE_ CCLK);53 lpc24xx_module_enable(LPC24XX_MODULE_UART_1, LPC24XX_MODULE_PCLK_DEFAULT); 54 54 lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION); 55 55 … … 67 67 }; 68 68 69 lpc24xx_module_enable(LPC24XX_MODULE_UART_2, LPC24XX_MODULE_ CCLK);69 lpc24xx_module_enable(LPC24XX_MODULE_UART_2, LPC24XX_MODULE_PCLK_DEFAULT); 70 70 lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION); 71 71 … … 83 83 }; 84 84 85 lpc24xx_module_enable(LPC24XX_MODULE_UART_3, LPC24XX_MODULE_ CCLK);85 lpc24xx_module_enable(LPC24XX_MODULE_UART_3, LPC24XX_MODULE_PCLK_DEFAULT); 86 86 lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION); 87 87 … … 108 108 .getData = NULL, 109 109 .setData = NULL, 110 .ulClock = LPC24XX_ CCLK,110 .ulClock = LPC24XX_PCLK, 111 111 .ulIntVector = LPC24XX_IRQ_UART_0 112 112 }, … … 129 129 .getData = NULL, 130 130 .setData = NULL, 131 .ulClock = LPC24XX_ CCLK,131 .ulClock = LPC24XX_PCLK, 132 132 .ulIntVector = LPC24XX_IRQ_UART_1 133 133 }, … … 150 150 .getData = NULL, 151 151 .setData = NULL, 152 .ulClock = LPC24XX_ CCLK,152 .ulClock = LPC24XX_PCLK, 153 153 .ulIntVector = LPC24XX_IRQ_UART_2 154 154 }, … … 171 171 .getData = NULL, 172 172 .setData = NULL, 173 .ulClock = LPC24XX_ CCLK,173 .ulClock = LPC24XX_PCLK, 174 174 .ulIntVector = LPC24XX_IRQ_UART_3 175 175 }, -
c/src/lib/libbsp/arm/lpc24xx/include/bsp.h
r4c622e5 r4a6cc2a 8 8 9 9 /* 10 * Copyright (c) 2008 11 * Embedded Brains GmbH 12 * Obere Lagerstr. 30 13 * D-82178 Puchheim 14 * Germany 15 * rtems@embedded-brains.de 10 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. 16 11 * 17 * The license and distribution terms for this file may be found in the file 18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. 12 * embedded brains GmbH 13 * Obere Lagerstr. 30 14 * 82178 Puchheim 15 * Germany 16 * <rtems@embedded-brains.de> 17 * 18 * The license and distribution terms for this file may be 19 * found in the file LICENSE in this distribution or at 20 * http://www.rtems.com/license/LICENSE. 21 * 22 * $Id$ 19 23 */ 20 24 … … 33 37 34 38 #define BSP_FEATURE_IRQ_EXTENSION 39 40 #define LPC24XX_PCLK (LPC24XX_CCLK / LPC24XX_PCLKDIV) 41 42 #define LPC24XX_EMCCLK (LPC24XX_CCLK / LPC24XX_EMCCLKDIV) 35 43 36 44 #ifndef ASM … … 88 96 void *bsp_idle_thread(uintptr_t ignored); 89 97 90 #define BSP_CONSOLE_UART_BASE 0xe000c000 98 #ifdef ARM_MULTILIB_ARCH_V4 99 #define BSP_CONSOLE_UART_BASE 0xe000c000 100 #else 101 #define BSP_CONSOLE_UART_BASE 0x4000c000 102 #endif 91 103 92 104 void bsp_restart(void *addr); -
c/src/lib/libbsp/arm/lpc24xx/include/io.h
r4c622e5 r4a6cc2a 48 48 #define LPC24XX_IO_INDEX_BY_PORT(port, bit) (((port) << 5U) + (bit)) 49 49 50 #define LPC24XX_IO_PORT(index) ( index>> 5U)51 52 #define LPC24XX_IO_PORT_BIT(index) ( index& 0x1fU)50 #define LPC24XX_IO_PORT(index) ((index) >> 5U) 51 52 #define LPC24XX_IO_PORT_BIT(index) ((index) & 0x1fU) 53 53 54 54 typedef enum { 55 LPC24XX_MODULE_ACF = 0, 56 LPC24XX_MODULE_ADC, 57 LPC24XX_MODULE_BAT_RAM, 55 #ifdef ARM_MULTILIB_ARCH_V4 56 LPC24XX_MODULE_ACF, 57 #endif 58 LPC24XX_MODULE_ADC, 59 #ifdef ARM_MULTILIB_ARCH_V4 60 LPC24XX_MODULE_BAT_RAM, 61 #endif 58 62 LPC24XX_MODULE_CAN_0, 59 63 LPC24XX_MODULE_CAN_1, … … 73 77 LPC24XX_MODULE_PWM_1, 74 78 LPC24XX_MODULE_RTC, 75 LPC24XX_MODULE_SPI, 79 #ifdef ARM_MULTILIB_ARCH_V4 80 LPC24XX_MODULE_SPI, 81 #endif 76 82 LPC24XX_MODULE_SSP_0, 77 83 LPC24XX_MODULE_SSP_1, … … 85 91 LPC24XX_MODULE_UART_2, 86 92 LPC24XX_MODULE_UART_3, 87 LPC24XX_MODULE_USB, 88 LPC24XX_MODULE_WDT 93 #ifdef ARM_MULTILIB_ARCH_V4 94 LPC24XX_MODULE_WDT, 95 #endif 96 LPC24XX_MODULE_USB 89 97 } lpc24xx_module; 90 98 91 #define LPC24XX_MODULE_FIRST LPC24XX_MODULE_ACF 92 93 #define LPC24XX_MODULE_COUNT (LPC24XX_MODULE_WDT + 1) 99 #define LPC24XX_MODULE_COUNT (LPC24XX_MODULE_USB + 1) 94 100 95 101 typedef enum { 96 LPC24XX_MODULE_PCLK_DEFAULT = 0x 0U,102 LPC24XX_MODULE_PCLK_DEFAULT = 0x4U, 97 103 LPC24XX_MODULE_CCLK = 0x1U, 98 104 LPC24XX_MODULE_CCLK_2 = 0x2U, … … 106 112 typedef enum { 107 113 LPC24XX_GPIO_DEFAULT = 0x0U, 108 LPC24XX_GPIO_RESISTOR_ DEFAULT= 0x0U,114 LPC24XX_GPIO_RESISTOR_PULL_UP = 0x0U, 109 115 LPC24XX_GPIO_RESISTOR_NONE = 0x1U, 110 LPC24XX_GPIO_RESISTOR_PULL_UP = 0x2U, 111 LPC24XX_GPIO_RESISTOR_PULL_DOWN = 0x3U, 116 LPC24XX_GPIO_RESISTOR_PULL_DOWN = 0x2U, 112 117 LPC24XX_GPIO_INPUT = 0x0U, 113 LPC24XX_GPIO_OUTPUT = 0x8 U118 LPC24XX_GPIO_OUTPUT = 0x8000U 114 119 } lpc24xx_gpio_settings; 115 116 #define LPC24XX_GPIO_RESISTOR_MASK 0x3U117 120 118 121 rtems_status_code lpc24xx_module_enable( … … 175 178 * @brief Sets the pin function. 176 179 */ 177 LPC24XX_PIN_SET_FUNCTION = 0,180 LPC24XX_PIN_SET_FUNCTION, 178 181 179 182 /** … … 196 199 struct { 197 200 uint16_t port : 3; 198 uint16_t index_begin : 5; 199 uint16_t index_last : 5; 201 uint16_t port_bit : 5; 200 202 uint16_t function : 3; 203 uint16_t type : 4; 204 uint16_t range : 1; 201 205 } fields; 202 206 uint16_t value; 203 207 } lpc24xx_pin_range; 204 208 205 #define LPC24XX_PIN_FUNCTION_00 0x0 206 #define LPC24XX_PIN_FUNCTION_01 0x1 207 #define LPC24XX_PIN_FUNCTION_10 0x2 208 #define LPC24XX_PIN_FUNCTION_11 0x3 209 210 #define LPC24XX_PIN(p, i, f) { { p, i, i, f } } 211 212 #define LPC24XX_PIN_RANGE(p, i, j, f) { { p, i, j, f } } 213 214 #define LPC24XX_PIN_TERMINAL { { 0x3, 0x1f, 0x1f, 0x3 } } 209 typedef enum { 210 LPC24XX_PIN_FUNCTION_00, 211 LPC24XX_PIN_FUNCTION_01, 212 LPC24XX_PIN_FUNCTION_10, 213 LPC24XX_PIN_FUNCTION_11 214 } lpc24xx_pin_function; 215 216 typedef enum { 217 LPC17XX_PIN_TYPE_DEFAULT, 218 LPC17XX_PIN_TYPE_ADC, 219 LPC17XX_PIN_TYPE_DAC, 220 LPC17XX_PIN_TYPE_I2C, 221 LPC17XX_PIN_TYPE_I2C_FAST_PLUS 222 } lpc17xx_pin_type; 223 224 #ifdef ARM_MULTILIB_ARCH_V4 225 #define LPC24XX_PIN(p, i, f0, f1) { { p, i, f0, 0, 0 } } 226 #define LPC24XX_PIN_WITH_TYPE(p, i, f0, f1, t) { { p, i, f0, t, 0 } } 227 #define LPC24XX_PIN_RANGE(p, i, j, f0, f1) \ 228 { { p, i, f0, 0, 0 } }, { { p, j, f0, 0, 1 } } 229 #endif 230 231 #define LPC24XX_PIN_TERMINAL { { 0x7, 0x1f, 0x7, 0xf, 0x1 } } 215 232 216 233 /** … … 257 274 258 275 #define LPC24XX_PIN_ADC_CHANNEL_0 \ 259 LPC24XX_PIN (0, 23, LPC24XX_PIN_FUNCTION_01)276 LPC24XX_PIN_WITH_TYPE(0, 23, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_ADC) 260 277 #define LPC24XX_PIN_ADC_CHANNEL_1 \ 261 LPC24XX_PIN (0, 24, LPC24XX_PIN_FUNCTION_01)278 LPC24XX_PIN_WITH_TYPE(0, 24, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_ADC) 262 279 #define LPC24XX_PIN_ADC_CHANNEL_2 \ 263 LPC24XX_PIN (0, 25, LPC24XX_PIN_FUNCTION_01)280 LPC24XX_PIN_WITH_TYPE(0, 25, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_ADC) 264 281 #define LPC24XX_PIN_ADC_CHANNEL_3 \ 265 LPC24XX_PIN (0, 26, LPC24XX_PIN_FUNCTION_01)282 LPC24XX_PIN_WITH_TYPE(0, 26, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_ADC) 266 283 #define LPC24XX_PIN_ADC_CHANNEL_4 \ 267 LPC24XX_PIN (1, 30, LPC24XX_PIN_FUNCTION_11)284 LPC24XX_PIN_WITH_TYPE(1, 30, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_ADC) 268 285 #define LPC24XX_PIN_ADC_CHANNEL_5 \ 269 LPC24XX_PIN (1, 31, LPC24XX_PIN_FUNCTION_11)286 LPC24XX_PIN_WITH_TYPE(1, 31, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_ADC) 270 287 #define LPC24XX_PIN_ADC_CHANNEL_6 \ 271 LPC24XX_PIN (0, 12, LPC24XX_PIN_FUNCTION_11)288 LPC24XX_PIN_WITH_TYPE(0, 12, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_ADC) 272 289 #define LPC24XX_PIN_ADC_CHANNEL_7 \ 273 LPC24XX_PIN(0, 13, LPC24XX_PIN_FUNCTION_11) 290 LPC24XX_PIN_WITH_TYPE(0, 13, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_ADC) 291 292 /** @} */ 293 294 /** 295 * @name CAN 0 Pins 296 * 297 * @{ 298 */ 299 300 #define LPC24XX_PIN_CAN_0_RD \ 301 LPC24XX_PIN(0, 0, LPC24XX_PIN_FUNCTION_01, 1) 302 303 #define LPC24XX_PIN_CAN_0_TD \ 304 LPC24XX_PIN(0, 1, LPC24XX_PIN_FUNCTION_01, 1) 305 306 /** @} */ 307 308 /** 309 * @name CAN 1 Pins 310 * 311 * @{ 312 */ 313 314 #define LPC24XX_PIN_CAN_1_RD \ 315 LPC24XX_PIN(0, 4, LPC24XX_PIN_FUNCTION_10, 2) 316 317 #define LPC24XX_PIN_CAN_1_TD \ 318 LPC24XX_PIN(0, 5, LPC24XX_PIN_FUNCTION_10, 2) 274 319 275 320 /** @} */ … … 282 327 283 328 #define LPC24XX_PIN_DAC \ 284 LPC24XX_PIN (0, 26, LPC24XX_PIN_FUNCTION_10)329 LPC24XX_PIN_WITH_TYPE(0, 26, LPC24XX_PIN_FUNCTION_10, 2, LPC17XX_PIN_TYPE_DAC) 285 330 286 331 /** @} */ … … 293 338 294 339 #define LPC24XX_PIN_ETHERNET_MII \ 295 LPC24XX_PIN_RANGE(1, 0, 17, LPC24XX_PIN_FUNCTION_01 )340 LPC24XX_PIN_RANGE(1, 0, 17, LPC24XX_PIN_FUNCTION_01, 1) 296 341 297 342 #define LPC24XX_PIN_ETHERNET_RMII_0 \ 298 LPC24XX_PIN_RANGE(1, 0, 1, LPC24XX_PIN_FUNCTION_01 )343 LPC24XX_PIN_RANGE(1, 0, 1, LPC24XX_PIN_FUNCTION_01, 1) 299 344 #define LPC24XX_PIN_ETHERNET_RMII_1 \ 300 LPC24XX_PIN(1, 4, LPC24XX_PIN_FUNCTION_01 )345 LPC24XX_PIN(1, 4, LPC24XX_PIN_FUNCTION_01, 1) 301 346 #define LPC24XX_PIN_ETHERNET_RMII_2 \ 302 LPC24XX_PIN_RANGE(1, 8, 10, LPC24XX_PIN_FUNCTION_01 )347 LPC24XX_PIN_RANGE(1, 8, 10, LPC24XX_PIN_FUNCTION_01, 1) 303 348 #define LPC24XX_PIN_ETHERNET_RMII_3 \ 304 LPC24XX_PIN_RANGE(1, 14, 17, LPC24XX_PIN_FUNCTION_01) 349 LPC24XX_PIN_RANGE(1, 14, 17, LPC24XX_PIN_FUNCTION_01, 1) 350 351 /** @} */ 352 353 /** 354 * @name External Interrupt Pins 355 * 356 * @{ 357 */ 358 359 #define LPC24XX_PIN_EINT_0 \ 360 LPC24XX_PIN(2, 10, LPC24XX_PIN_FUNCTION_01, 1) 361 #define LPC24XX_PIN_EINT_1 \ 362 LPC24XX_PIN(2, 11, LPC24XX_PIN_FUNCTION_01, 1) 363 #define LPC24XX_PIN_EINT_2 \ 364 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01, 1) 365 #define LPC24XX_PIN_EINT_3 \ 366 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_01, 1) 367 368 /** @} */ 369 370 /** 371 * @name External Memory Controller (EMC) Pins 372 * 373 * @{ 374 */ 375 376 #define LPC24XX_PIN_EMC_CS_0 \ 377 LPC24XX_PIN(4, 30, LPC24XX_PIN_FUNCTION_01, 1) 378 #define LPC24XX_PIN_EMC_CS_1 \ 379 LPC24XX_PIN(4, 31, LPC24XX_PIN_FUNCTION_01, 1) 380 #define LPC24XX_PIN_EMC_CS_2 \ 381 LPC24XX_PIN(2, 14, LPC24XX_PIN_FUNCTION_01, 1) 382 #define LPC24XX_PIN_EMC_CS_3 \ 383 LPC24XX_PIN(2, 15, LPC24XX_PIN_FUNCTION_01, 1) 384 385 #define LPC24XX_PIN_EMC_DYCS_0 \ 386 LPC24XX_PIN(2, 20, LPC24XX_PIN_FUNCTION_01, 1) 387 #define LPC24XX_PIN_EMC_DYCS_1 \ 388 LPC24XX_PIN(2, 21, LPC24XX_PIN_FUNCTION_01, 1) 389 #define LPC24XX_PIN_EMC_DYCS_2 \ 390 LPC24XX_PIN(2, 22, LPC24XX_PIN_FUNCTION_01, 1) 391 #define LPC24XX_PIN_EMC_DYCS_3 \ 392 LPC24XX_PIN(2, 23, LPC24XX_PIN_FUNCTION_01, 1) 393 394 #define LPC24XX_PIN_EMC_OE \ 395 LPC24XX_PIN(4, 24, LPC24XX_PIN_FUNCTION_01, 1) 396 #define LPC24XX_PIN_EMC_WE \ 397 LPC24XX_PIN(4, 25, LPC24XX_PIN_FUNCTION_01, 1) 398 #define LPC24XX_PIN_EMC_CAS \ 399 LPC24XX_PIN(2, 16, LPC24XX_PIN_FUNCTION_01, 1) 400 #define LPC24XX_PIN_EMC_RAS \ 401 LPC24XX_PIN(2, 17, LPC24XX_PIN_FUNCTION_01, 1) 402 403 #define LPC24XX_PIN_EMC_CLK_0 \ 404 LPC24XX_PIN(2, 18, LPC24XX_PIN_FUNCTION_01, 1) 405 #define LPC24XX_PIN_EMC_CLK_1 \ 406 LPC24XX_PIN(2, 19, LPC24XX_PIN_FUNCTION_01, 1) 407 408 #define LPC24XX_PIN_EMC_CKE_0 \ 409 LPC24XX_PIN(2, 24, LPC24XX_PIN_FUNCTION_01, 1) 410 #define LPC24XX_PIN_EMC_CKE_1 \ 411 LPC24XX_PIN(2, 25, LPC24XX_PIN_FUNCTION_01, 1) 412 #define LPC24XX_PIN_EMC_CKE_2 \ 413 LPC24XX_PIN(2, 26, LPC24XX_PIN_FUNCTION_01, 1) 414 #define LPC24XX_PIN_EMC_CKE_3 \ 415 LPC24XX_PIN(2, 27, LPC24XX_PIN_FUNCTION_01, 1) 416 417 #define LPC24XX_PIN_EMC_DQM_0 \ 418 LPC24XX_PIN(2, 28, LPC24XX_PIN_FUNCTION_01, 1) 419 #define LPC24XX_PIN_EMC_DQM_1 \ 420 LPC24XX_PIN(2, 29, LPC24XX_PIN_FUNCTION_01, 1) 421 #define LPC24XX_PIN_EMC_DQM_2 \ 422 LPC24XX_PIN(2, 30, LPC24XX_PIN_FUNCTION_01, 1) 423 #define LPC24XX_PIN_EMC_DQM_3 \ 424 LPC24XX_PIN(2, 31, LPC24XX_PIN_FUNCTION_01, 1) 425 426 #define LPC24XX_PIN_EMC_BLS0 \ 427 LPC24XX_PIN(4, 26, LPC24XX_PIN_FUNCTION_01, 1) 428 #define LPC24XX_PIN_EMC_BLS1 \ 429 LPC24XX_PIN(4, 27, LPC24XX_PIN_FUNCTION_01, 1) 430 #define LPC24XX_PIN_EMC_BLS2 \ 431 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_01, 1) 432 #define LPC24XX_PIN_EMC_BLS3 \ 433 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_01, 1) 434 435 #define LPC24XX_PIN_EMC_D_0_15 \ 436 LPC24XX_PIN_RANGE(3, 0, 15, LPC24XX_PIN_FUNCTION_01, 1) 437 #define LPC24XX_PIN_EMC_D_15_31 \ 438 LPC24XX_PIN_RANGE(3, 15, 31, LPC24XX_PIN_FUNCTION_01, 1) 439 #define LPC24XX_PIN_EMC_D_0_31 \ 440 LPC24XX_PIN_RANGE(3, 0, 31, LPC24XX_PIN_FUNCTION_01, 1) 441 442 #define LPC24XX_PIN_EMC_A_0_12 \ 443 LPC24XX_PIN_RANGE(4, 0, 12, LPC24XX_PIN_FUNCTION_01, 1) 444 #define LPC24XX_PIN_EMC_A_0_13 \ 445 LPC24XX_PIN_RANGE(4, 0, 13, LPC24XX_PIN_FUNCTION_01, 1) 446 #define LPC24XX_PIN_EMC_A_0_14 \ 447 LPC24XX_PIN_RANGE(4, 0, 14, LPC24XX_PIN_FUNCTION_01, 1) 448 #define LPC24XX_PIN_EMC_A_0_15 \ 449 LPC24XX_PIN_RANGE(4, 0, 15, LPC24XX_PIN_FUNCTION_01, 1) 450 #define LPC24XX_PIN_EMC_A_0_16 \ 451 LPC24XX_PIN_EMC_A_0_15, \ 452 LPC24XX_PIN(4, 16, LPC24XX_PIN_FUNCTION_01, 1) 453 #define LPC24XX_PIN_EMC_A_0_17 \ 454 LPC24XX_PIN_EMC_A_0_15, \ 455 LPC24XX_PIN_RANGE(4, 16, 17, LPC24XX_PIN_FUNCTION_01, 1) 456 #define LPC24XX_PIN_EMC_A_0_18 \ 457 LPC24XX_PIN_EMC_A_0_15, \ 458 LPC24XX_PIN_RANGE(4, 16, 18, LPC24XX_PIN_FUNCTION_01, 1) 459 #define LPC24XX_PIN_EMC_A_0_19 \ 460 LPC24XX_PIN_EMC_A_0_15, \ 461 LPC24XX_PIN_RANGE(4, 16, 19, LPC24XX_PIN_FUNCTION_01, 1) 462 #define LPC24XX_PIN_EMC_A_0_20 \ 463 LPC24XX_PIN_EMC_A_0_15, \ 464 LPC24XX_PIN_RANGE(4, 16, 20, LPC24XX_PIN_FUNCTION_01, 1) 465 #define LPC24XX_PIN_EMC_A_0_21 \ 466 LPC24XX_PIN_EMC_A_0_15, \ 467 LPC24XX_PIN_RANGE(4, 16, 21, LPC24XX_PIN_FUNCTION_01, 1) 468 #define LPC24XX_PIN_EMC_A_0_22 \ 469 LPC24XX_PIN_EMC_A_0_15, \ 470 LPC24XX_PIN_RANGE(4, 16, 22, LPC24XX_PIN_FUNCTION_01, 1) 471 #define LPC24XX_PIN_EMC_A_0_23 \ 472 LPC24XX_PIN_EMC_A_0_15, \ 473 LPC24XX_PIN_RANGE(4, 16, 23, LPC24XX_PIN_FUNCTION_01, 1) 474 #define LPC24XX_PIN_EMC_A_0_24 \ 475 LPC24XX_PIN_EMC_A_0_23, \ 476 LPC24XX_PIN(5, 24, LPC24XX_PIN_FUNCTION_01, 1) 477 #define LPC24XX_PIN_EMC_A_0_25 \ 478 LPC24XX_PIN_EMC_A_0_23, \ 479 LPC24XX_PIN_RANGE(5, 24, 25, LPC24XX_PIN_FUNCTION_01, 1) 305 480 306 481 /** @} */ … … 313 488 314 489 #define LPC24XX_PIN_I2C_0_SDA \ 315 LPC24XX_PIN (0, 27, LPC24XX_PIN_FUNCTION_01)490 LPC24XX_PIN_WITH_TYPE(0, 27, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_I2C) 316 491 #define LPC24XX_PIN_I2C_0_SCL \ 317 LPC24XX_PIN (0, 28, LPC24XX_PIN_FUNCTION_01)492 LPC24XX_PIN_WITH_TYPE(0, 28, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_I2C) 318 493 319 494 /** @} */ … … 326 501 327 502 #define LPC24XX_PIN_I2C_1_SDA_P0_0 \ 328 LPC24XX_PIN (0, 0, LPC24XX_PIN_FUNCTION_11)503 LPC24XX_PIN_WITH_TYPE(0, 0, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_I2C) 329 504 #define LPC24XX_PIN_I2C_1_SDA_P0_19 \ 330 LPC24XX_PIN (0, 19, LPC24XX_PIN_FUNCTION_11)505 LPC24XX_PIN_WITH_TYPE(0, 19, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_I2C) 331 506 #define LPC24XX_PIN_I2C_1_SDA_P2_14 \ 332 LPC24XX_PIN(2, 14, LPC24XX_PIN_FUNCTION_11) 333 507 LPC24XX_PIN_WITH_TYPE(2, 14, LPC24XX_PIN_FUNCTION_11, 2, LPC17XX_PIN_TYPE_I2C) 508 509 #define LPC24XX_PIN_I2C_1_SCL_P0_1 \ 510 LPC24XX_PIN_WITH_TYPE(0, 1, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_I2C) 334 511 #define LPC24XX_PIN_I2C_1_SCL_P0_20 \ 335 LPC24XX_PIN(0, 20, LPC24XX_PIN_FUNCTION_11) 336 #define LPC24XX_PIN_I2C_1_SCL_P0_1 \ 337 LPC24XX_PIN(0, 1, LPC24XX_PIN_FUNCTION_11) 512 LPC24XX_PIN_WITH_TYPE(0, 20, LPC24XX_PIN_FUNCTION_11, 3, LPC17XX_PIN_TYPE_I2C) 338 513 #define LPC24XX_PIN_I2C_1_SCL_P2_15 \ 339 LPC24XX_PIN (2, 15, LPC24XX_PIN_FUNCTION_11)514 LPC24XX_PIN_WITH_TYPE(2, 15, LPC24XX_PIN_FUNCTION_11, 2, LPC17XX_PIN_TYPE_I2C) 340 515 341 516 /** @} */ … … 348 523 349 524 #define LPC24XX_PIN_I2C_2_SDA_P0_10 \ 350 LPC24XX_PIN (0, 10, LPC24XX_PIN_FUNCTION_10)525 LPC24XX_PIN_WITH_TYPE(0, 10, LPC24XX_PIN_FUNCTION_10, 2, LPC17XX_PIN_TYPE_I2C) 351 526 #define LPC24XX_PIN_I2C_2_SDA_P2_30 \ 352 LPC24XX_PIN (2, 30, LPC24XX_PIN_FUNCTION_11)527 LPC24XX_PIN_WITH_TYPE(2, 30, LPC24XX_PIN_FUNCTION_11, 2, LPC17XX_PIN_TYPE_I2C) 353 528 #define LPC24XX_PIN_I2C_2_SDA_P4_20 \ 354 LPC24XX_PIN(4, 20, LPC24XX_PIN_FUNCTION_10) 355 529 LPC24XX_PIN_WITH_TYPE(4, 20, LPC24XX_PIN_FUNCTION_10, 2, LPC17XX_PIN_TYPE_I2C) 530 531 #define LPC24XX_PIN_I2C_2_SCL_P0_11 \ 532 LPC24XX_PIN_WITH_TYPE(0, 11, LPC24XX_PIN_FUNCTION_10, 2, LPC17XX_PIN_TYPE_I2C) 356 533 #define LPC24XX_PIN_I2C_2_SCL_P2_31 \ 357 LPC24XX_PIN(2, 31, LPC24XX_PIN_FUNCTION_11) 358 #define LPC24XX_PIN_I2C_2_SCL_P0_11 \ 359 LPC24XX_PIN(0, 11, LPC24XX_PIN_FUNCTION_10) 534 LPC24XX_PIN_WITH_TYPE(2, 31, LPC24XX_PIN_FUNCTION_11, 2, LPC17XX_PIN_TYPE_I2C) 360 535 #define LPC24XX_PIN_I2C_2_SCL_P4_21 \ 361 LPC24XX_PIN (4, 21, LPC24XX_PIN_FUNCTION_10)536 LPC24XX_PIN_WITH_TYPE(4, 21, LPC24XX_PIN_FUNCTION_10, 2, LPC17XX_PIN_TYPE_I2C) 362 537 363 538 /** @} */ … … 370 545 371 546 #define LPC24XX_PIN_I2S_RX_CLK_P0_4 \ 372 LPC24XX_PIN(0, 4, LPC24XX_PIN_FUNCTION_01 )547 LPC24XX_PIN(0, 4, LPC24XX_PIN_FUNCTION_01, 1) 373 548 #define LPC24XX_PIN_I2S_RX_CLK_P0_23 \ 374 LPC24XX_PIN(0, 23, LPC24XX_PIN_FUNCTION_10 )549 LPC24XX_PIN(0, 23, LPC24XX_PIN_FUNCTION_10, 2) 375 550 376 551 #define LPC24XX_PIN_I2S_RX_WS_P0_5 \ 377 LPC24XX_PIN(0, 5, LPC24XX_PIN_FUNCTION_01 )552 LPC24XX_PIN(0, 5, LPC24XX_PIN_FUNCTION_01, 1) 378 553 #define LPC24XX_PIN_I2S_RX_WS_P0_24 \ 379 LPC24XX_PIN(0, 24, LPC24XX_PIN_FUNCTION_10 )554 LPC24XX_PIN(0, 24, LPC24XX_PIN_FUNCTION_10, 2) 380 555 381 556 #define LPC24XX_PIN_I2S_RX_SDA_P0_6 \ 382 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_01 )557 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_01, 1) 383 558 #define LPC24XX_PIN_I2S_RX_SDA_P0_25 \ 384 LPC24XX_PIN(0, 25, LPC24XX_PIN_FUNCTION_10 )559 LPC24XX_PIN(0, 25, LPC24XX_PIN_FUNCTION_10, 2) 385 560 386 561 #define LPC24XX_PIN_I2S_TX_CLK_P0_7 \ 387 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_01 )562 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_01, 1) 388 563 #define LPC24XX_PIN_I2S_TX_CLK_P2_11 \ 389 LPC24XX_PIN(2, 11, LPC24XX_PIN_FUNCTION_11 )564 LPC24XX_PIN(2, 11, LPC24XX_PIN_FUNCTION_11, 3) 390 565 391 566 #define LPC24XX_PIN_I2S_TX_WS_P0_8 \ 392 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_01 )567 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_01, 1) 393 568 #define LPC24XX_PIN_I2S_TX_WS_P2_12 \ 394 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_11 )569 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_11, 3) 395 570 396 571 #define LPC24XX_PIN_I2S_TX_SDA_P0_9 \ 397 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_01 )572 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_01, 1) 398 573 #define LPC24XX_PIN_I2S_TX_SDA_P2_13 \ 399 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_11 )574 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_11, 3) 400 575 401 576 /** @} */ … … 408 583 409 584 #define LPC24XX_PIN_LCD_PWR \ 410 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_11 )585 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_11, 7) 411 586 #define LPC24XX_PIN_LCD_LE \ 412 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_11 )587 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_11, 7) 413 588 #define LPC24XX_PIN_LCD_DCLK \ 414 LPC24XX_PIN(2, 2, LPC24XX_PIN_FUNCTION_11 )589 LPC24XX_PIN(2, 2, LPC24XX_PIN_FUNCTION_11, 7) 415 590 #define LPC24XX_PIN_LCD_FP \ 416 LPC24XX_PIN(2, 3, LPC24XX_PIN_FUNCTION_11 )591 LPC24XX_PIN(2, 3, LPC24XX_PIN_FUNCTION_11, 7) 417 592 #define LPC24XX_PIN_LCD_ENAB_M \ 418 LPC24XX_PIN(2, 4, LPC24XX_PIN_FUNCTION_11 )593 LPC24XX_PIN(2, 4, LPC24XX_PIN_FUNCTION_11, 7) 419 594 #define LPC24XX_PIN_LCD_LP \ 420 LPC24XX_PIN(2, 5, LPC24XX_PIN_FUNCTION_11 )595 LPC24XX_PIN(2, 5, LPC24XX_PIN_FUNCTION_11, 7) 421 596 #define LPC24XX_PIN_LCD_CLKIN \ 422 LPC24XX_PIN(2, 11, LPC24XX_PIN_FUNCTION_01) 423 424 #define LPC24XX_PIN_LCD_VD_P0_4 \ 425 LPC24XX_PIN(0, 4, LPC24XX_PIN_FUNCTION_01) 426 #define LPC24XX_PIN_LCD_VD_P0_5 \ 427 LPC24XX_PIN(0, 5, LPC24XX_PIN_FUNCTION_01) 428 #define LPC24XX_PIN_LCD_VD_P0_6 \ 429 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_01) 430 #define LPC24XX_PIN_LCD_VD_P0_7 \ 431 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_01) 432 #define LPC24XX_PIN_LCD_VD_P0_8 \ 433 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_01) 434 #define LPC24XX_PIN_LCD_VD_P0_9 \ 435 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_01) 436 #define LPC24XX_PIN_LCD_VD_P1_20 \ 437 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_01) 438 #define LPC24XX_PIN_LCD_VD_P1_21 \ 439 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_01) 440 #define LPC24XX_PIN_LCD_VD_P1_22 \ 441 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_01) 442 #define LPC24XX_PIN_LCD_VD_P1_23 \ 443 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_01) 444 #define LPC24XX_PIN_LCD_VD_P1_24 \ 445 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_01) 446 #define LPC24XX_PIN_LCD_VD_P1_25 \ 447 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_01) 448 #define LPC24XX_PIN_LCD_VD_P1_26 \ 449 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_01) 450 #define LPC24XX_PIN_LCD_VD_P1_27 \ 451 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_01) 452 #define LPC24XX_PIN_LCD_VD_P1_28 \ 453 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01) 454 #define LPC24XX_PIN_LCD_VD_P1_29 \ 455 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01) 456 #define LPC24XX_PIN_LCD_VD_P2_6 \ 457 LPC24XX_PIN(2, 6, LPC24XX_PIN_FUNCTION_11) 458 #define LPC24XX_PIN_LCD_VD_P2_7 \ 459 LPC24XX_PIN(2, 7, LPC24XX_PIN_FUNCTION_11) 460 #define LPC24XX_PIN_LCD_VD_P2_8 \ 461 LPC24XX_PIN(2, 8, LPC24XX_PIN_FUNCTION_11) 462 #define LPC24XX_PIN_LCD_VD_P2_9 \ 463 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_11) 464 #define LPC24XX_PIN_LCD_VD_P2_12 \ 465 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01) 466 #define LPC24XX_PIN_LCD_VD_P2_13 \ 467 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_01) 468 #define LPC24XX_PIN_LCD_VD_P4_28 \ 469 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_10) 470 #define LPC24XX_PIN_LCD_VD_P4_29 \ 471 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_10) 597 LPC24XX_PIN(2, 11, LPC24XX_PIN_FUNCTION_01, 7) 598 599 #define LPC24XX_PIN_LCD_VD_0_P0_4 \ 600 LPC24XX_PIN(0, 4, LPC24XX_PIN_FUNCTION_01, 7) 601 #define LPC24XX_PIN_LCD_VD_0_P2_6 \ 602 LPC24XX_PIN(2, 6, LPC24XX_PIN_FUNCTION_11, 6) 603 #define LPC24XX_PIN_LCD_VD_1_P0_5 \ 604 LPC24XX_PIN(0, 5, LPC24XX_PIN_FUNCTION_01, 7) 605 #define LPC24XX_PIN_LCD_VD_1_P2_7 \ 606 LPC24XX_PIN(2, 7, LPC24XX_PIN_FUNCTION_11, 6) 607 #define LPC24XX_PIN_LCD_VD_2_P2_8 \ 608 LPC24XX_PIN(2, 8, LPC24XX_PIN_FUNCTION_11, 6) 609 #define LPC24XX_PIN_LCD_VD_2_P4_28 \ 610 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_10, 7) 611 #define LPC24XX_PIN_LCD_VD_3_P2_9 \ 612 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_11, 6) 613 #define LPC24XX_PIN_LCD_VD_3_P2_12 \ 614 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01, 5) 615 #define LPC24XX_PIN_LCD_VD_3_P4_29 \ 616 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_10, 7) 617 #define LPC24XX_PIN_LCD_VD_4_P2_6 \ 618 LPC24XX_PIN(2, 6, LPC24XX_PIN_FUNCTION_11, 7) 619 #define LPC24XX_PIN_LCD_VD_4_P2_12 \ 620 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01, 4) 621 #define LPC24XX_PIN_LCD_VD_5_P2_7 \ 622 LPC24XX_PIN(2, 7, LPC24XX_PIN_FUNCTION_11, 7) 623 #define LPC24XX_PIN_LCD_VD_5_P2_13 \ 624 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_01, 5) 625 #define LPC24XX_PIN_LCD_VD_6_P1_20 \ 626 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_01, 6) 627 #define LPC24XX_PIN_LCD_VD_6_P2_8 \ 628 LPC24XX_PIN(2, 8, LPC24XX_PIN_FUNCTION_11, 7) 629 #define LPC24XX_PIN_LCD_VD_6_P4_28 \ 630 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_10, 5) 631 #define LPC24XX_PIN_LCD_VD_7_P1_21 \ 632 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_01, 6) 633 #define LPC24XX_PIN_LCD_VD_7_P2_9 \ 634 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_11, 7) 635 #define LPC24XX_PIN_LCD_VD_7_P4_29 \ 636 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_10, 5) 637 #define LPC24XX_PIN_LCD_VD_8_P0_6 \ 638 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_01, 7) 639 #define LPC24XX_PIN_LCD_VD_8_P1_22 \ 640 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_01, 6) 641 #define LPC24XX_PIN_LCD_VD_8_P2_12 \ 642 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01, 6) 643 #define LPC24XX_PIN_LCD_VD_9_P0_7 \ 644 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_01, 7) 645 #define LPC24XX_PIN_LCD_VD_9_P1_23 \ 646 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_01, 6) 647 #define LPC24XX_PIN_LCD_VD_9_P2_13 \ 648 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_01, 6) 649 #define LPC24XX_PIN_LCD_VD_10_P1_20 \ 650 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_01, 7) 651 #define LPC24XX_PIN_LCD_VD_10_P1_24 \ 652 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_01, 6) 653 #define LPC24XX_PIN_LCD_VD_10_P4_28 \ 654 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_10, 6) 655 #define LPC24XX_PIN_LCD_VD_11_P1_21 \ 656 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_01, 7) 657 #define LPC24XX_PIN_LCD_VD_11_P1_25 \ 658 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_01, 6) 659 #define LPC24XX_PIN_LCD_VD_11_P4_29 \ 660 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_10, 6) 661 #define LPC24XX_PIN_LCD_VD_12_P1_22 \ 662 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_01, 7) 663 #define LPC24XX_PIN_LCD_VD_12_P1_26 \ 664 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_01, 6) 665 #define LPC24XX_PIN_LCD_VD_13_P1_23 \ 666 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_01, 7) 667 #define LPC24XX_PIN_LCD_VD_13_P1_27 \ 668 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_01, 6) 669 #define LPC24XX_PIN_LCD_VD_14_P1_24 \ 670 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_01, 7) 671 #define LPC24XX_PIN_LCD_VD_14_P1_28 \ 672 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01, 6) 673 #define LPC24XX_PIN_LCD_VD_15_P1_25 \ 674 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_01, 7) 675 #define LPC24XX_PIN_LCD_VD_15_P1_29 \ 676 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01, 6) 677 #define LPC24XX_PIN_LCD_VD_16_P0_8 \ 678 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_01, 7) 679 #define LPC24XX_PIN_LCD_VD_17_P0_9 \ 680 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_01, 7) 681 #define LPC24XX_PIN_LCD_VD_18_P2_12 \ 682 LPC24XX_PIN(2, 12, LPC24XX_PIN_FUNCTION_01, 7) 683 #define LPC24XX_PIN_LCD_VD_19_P2_13 \ 684 LPC24XX_PIN(2, 13, LPC24XX_PIN_FUNCTION_01, 7) 685 #define LPC24XX_PIN_LCD_VD_20_P1_26 \ 686 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_01, 7) 687 #define LPC24XX_PIN_LCD_VD_21_P1_27 \ 688 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_01, 7) 689 #define LPC24XX_PIN_LCD_VD_22_P1_28 \ 690 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01, 7) 691 #define LPC24XX_PIN_LCD_VD_23_P1_29 \ 692 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01, 7) 472 693 473 694 /** @} */ … … 480 701 481 702 #define LPC24XX_PIN_PWM_0_CHANNEL_1_P1_2 \ 482 LPC24XX_PIN(1, 2, LPC24XX_PIN_FUNCTION_11 )703 LPC24XX_PIN(1, 2, LPC24XX_PIN_FUNCTION_11, 3) 483 704 #define LPC24XX_PIN_PWM_0_CHANNEL_1_P3_16 \ 484 LPC24XX_PIN(3, 16, LPC24XX_PIN_FUNCTION_10 )705 LPC24XX_PIN(3, 16, LPC24XX_PIN_FUNCTION_10, 2) 485 706 486 707 #define LPC24XX_PIN_PWM_0_CHANNEL_2_P1_3 \ 487 LPC24XX_PIN(1, 3, LPC24XX_PIN_FUNCTION_11 )708 LPC24XX_PIN(1, 3, LPC24XX_PIN_FUNCTION_11, 3) 488 709 #define LPC24XX_PIN_PWM_0_CHANNEL_2_P3_17 \ 489 LPC24XX_PIN(3, 17, LPC24XX_PIN_FUNCTION_10 )710 LPC24XX_PIN(3, 17, LPC24XX_PIN_FUNCTION_10, 2) 490 711 491 712 #define LPC24XX_PIN_PWM_0_CHANNEL_3_P1_5 \ 492 LPC24XX_PIN(1, 5, LPC24XX_PIN_FUNCTION_11 )713 LPC24XX_PIN(1, 5, LPC24XX_PIN_FUNCTION_11, 3) 493 714 #define LPC24XX_PIN_PWM_0_CHANNEL_3_P3_18 \ 494 LPC24XX_PIN(3, 18, LPC24XX_PIN_FUNCTION_10 )715 LPC24XX_PIN(3, 18, LPC24XX_PIN_FUNCTION_10, 2) 495 716 496 717 #define LPC24XX_PIN_PWM_0_CHANNEL_4_P1_6 \ 497 LPC24XX_PIN(1, 6, LPC24XX_PIN_FUNCTION_11 )718 LPC24XX_PIN(1, 6, LPC24XX_PIN_FUNCTION_11, 3) 498 719 #define LPC24XX_PIN_PWM_0_CHANNEL_4_P3_19 \ 499 LPC24XX_PIN(3, 19, LPC24XX_PIN_FUNCTION_10 )720 LPC24XX_PIN(3, 19, LPC24XX_PIN_FUNCTION_10, 2) 500 721 501 722 #define LPC24XX_PIN_PWM_0_CHANNEL_5_P1_7 \ 502 LPC24XX_PIN(1, 7, LPC24XX_PIN_FUNCTION_11 )723 LPC24XX_PIN(1, 7, LPC24XX_PIN_FUNCTION_11, 3) 503 724 #define LPC24XX_PIN_PWM_0_CHANNEL_5_P3_20 \ 504 LPC24XX_PIN(3, 20, LPC24XX_PIN_FUNCTION_10 )725 LPC24XX_PIN(3, 20, LPC24XX_PIN_FUNCTION_10, 2) 505 726 506 727 #define LPC24XX_PIN_PWM_0_CHANNEL_6_P1_11 \ 507 LPC24XX_PIN(1, 11, LPC24XX_PIN_FUNCTION_11 )728 LPC24XX_PIN(1, 11, LPC24XX_PIN_FUNCTION_11, 3) 508 729 #define LPC24XX_PIN_PWM_0_CHANNEL_6_P3_21 \ 509 LPC24XX_PIN(3, 21, LPC24XX_PIN_FUNCTION_10 )730 LPC24XX_PIN(3, 21, LPC24XX_PIN_FUNCTION_10, 2) 510 731 511 732 #define LPC24XX_PIN_PWM_0_CAPTURE_0_P1_12 \ 512 LPC24XX_PIN(1, 12, LPC24XX_PIN_FUNCTION_11 )733 LPC24XX_PIN(1, 12, LPC24XX_PIN_FUNCTION_11, 3) 513 734 #define LPC24XX_PIN_PWM_0_CAPTURE_0_P3_22 \ 514 LPC24XX_PIN(3, 22, LPC24XX_PIN_FUNCTION_10 )735 LPC24XX_PIN(3, 22, LPC24XX_PIN_FUNCTION_10, 2) 515 736 516 737 /** @} */ … … 523 744 524 745 #define LPC24XX_PIN_PWM_1_CHANNEL_1_P1_18 \ 525 LPC24XX_PIN(1, 18, LPC24XX_PIN_FUNCTION_10 )746 LPC24XX_PIN(1, 18, LPC24XX_PIN_FUNCTION_10, 2) 526 747 #define LPC24XX_PIN_PWM_1_CHANNEL_1_P2_0 \ 527 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_01 )748 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_01, 1) 528 749 #define LPC24XX_PIN_PWM_1_CHANNEL_1_P3_24 \ 529 LPC24XX_PIN(3, 24, LPC24XX_PIN_FUNCTION_11 )750 LPC24XX_PIN(3, 24, LPC24XX_PIN_FUNCTION_11, 2) 530 751 531 752 #define LPC24XX_PIN_PWM_1_CHANNEL_2_P1_20 \ 532 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_10 )753 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_10, 2) 533 754 #define LPC24XX_PIN_PWM_1_CHANNEL_2_P2_1 \ 534 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_01 )755 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_01, 1) 535 756 #define LPC24XX_PIN_PWM_1_CHANNEL_2_P3_25 \ 536 LPC24XX_PIN(3, 25, LPC24XX_PIN_FUNCTION_11 )757 LPC24XX_PIN(3, 25, LPC24XX_PIN_FUNCTION_11, 2) 537 758 538 759 #define LPC24XX_PIN_PWM_1_CHANNEL_3_P1_21 \ 539 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_10 )760 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_10, 2) 540 761 #define LPC24XX_PIN_PWM_1_CHANNEL_3_P2_2 \ 541 LPC24XX_PIN(2, 2, LPC24XX_PIN_FUNCTION_01 )762 LPC24XX_PIN(2, 2, LPC24XX_PIN_FUNCTION_01, 1) 542 763 #define LPC24XX_PIN_PWM_1_CHANNEL_3_P3_26 \ 543 LPC24XX_PIN(3, 26, LPC24XX_PIN_FUNCTION_11 )764 LPC24XX_PIN(3, 26, LPC24XX_PIN_FUNCTION_11, 2) 544 765 545 766 #define LPC24XX_PIN_PWM_1_CHANNEL_4_P1_23 \ 546 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_10 )767 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_10, 2) 547 768 #define LPC24XX_PIN_PWM_1_CHANNEL_4_P2_3 \ 548 LPC24XX_PIN(2, 3, LPC24XX_PIN_FUNCTION_01 )769 LPC24XX_PIN(2, 3, LPC24XX_PIN_FUNCTION_01, 1) 549 770 #define LPC24XX_PIN_PWM_1_CHANNEL_4_P3_27 \ 550 LPC24XX_PIN(3, 27, LPC24XX_PIN_FUNCTION_11 )771 LPC24XX_PIN(3, 27, LPC24XX_PIN_FUNCTION_11, 2) 551 772 552 773 #define LPC24XX_PIN_PWM_1_CHANNEL_5_P1_24 \ 553 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_10 )774 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_10, 2) 554 775 #define LPC24XX_PIN_PWM_1_CHANNEL_5_P2_4 \ 555 LPC24XX_PIN(2, 4, LPC24XX_PIN_FUNCTION_01 )776 LPC24XX_PIN(2, 4, LPC24XX_PIN_FUNCTION_01, 1) 556 777 #define LPC24XX_PIN_PWM_1_CHANNEL_5_P3_28 \ 557 LPC24XX_PIN(3, 28, LPC24XX_PIN_FUNCTION_11 )778 LPC24XX_PIN(3, 28, LPC24XX_PIN_FUNCTION_11, 2) 558 779 559 780 #define LPC24XX_PIN_PWM_1_CHANNEL_6_P1_26 \ 560 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_10 )781 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_10, 2) 561 782 #define LPC24XX_PIN_PWM_1_CHANNEL_6_P2_5 \ 562 LPC24XX_PIN(2, 5, LPC24XX_PIN_FUNCTION_01 )783 LPC24XX_PIN(2, 5, LPC24XX_PIN_FUNCTION_01, 1) 563 784 #define LPC24XX_PIN_PWM_1_CHANNEL_6_P3_29 \ 564 LPC24XX_PIN(3, 29, LPC24XX_PIN_FUNCTIO9_11 )785 LPC24XX_PIN(3, 29, LPC24XX_PIN_FUNCTIO9_11, 2) 565 786 566 787 #define LPC24XX_PIN_PWM_1_CAPTURE_0_P1_28 \ 567 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_10 )788 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_10, 2) 568 789 #define LPC24XX_PIN_PWM_1_CAPTURE_0_P2_7 \ 569 LPC24XX_PIN(2, 6, LPC24XX_PIN_FUNCTION_01 )790 LPC24XX_PIN(2, 6, LPC24XX_PIN_FUNCTION_01, 1) 570 791 #define LPC24XX_PIN_PWM_1_CAPTURE_0_P3_23 \ 571 LPC24XX_PIN(3, 23, LPC24XX_PIN_FUNCTION_11 )792 LPC24XX_PIN(3, 23, LPC24XX_PIN_FUNCTION_11, 2) 572 793 573 794 #define LPC24XX_PIN_PWM_1_CAPTURE_1_P1_29 \ 574 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_10) 575 576 /** @} */ 577 578 /** 579 * @name SPI Pins 580 * 581 * @{ 582 */ 583 584 #define LPC24XX_PIN_SPI_SCK \ 585 LPC24XX_PIN(0, 15, LPC24XX_PIN_FUNCTION_11) 586 #define LPC24XX_PIN_SPI_SSEL \ 587 LPC24XX_PIN(0, 16, LPC24XX_PIN_FUNCTION_11) 588 #define LPC24XX_PIN_SPI_MISO \ 589 LPC24XX_PIN(0, 17, LPC24XX_PIN_FUNCTION_11) 590 #define LPC24XX_PIN_SPI_MOSI \ 591 LPC24XX_PIN(0, 18, LPC24XX_PIN_FUNCTION_11) 795 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_10, 2) 592 796 593 797 /** @} */ … … 600 804 601 805 #define LPC24XX_PIN_SSP_0_SCK_P0_15 \ 602 LPC24XX_PIN(0, 15, LPC24XX_PIN_FUNCTION_10 )806 LPC24XX_PIN(0, 15, LPC24XX_PIN_FUNCTION_10, 2) 603 807 #define LPC24XX_PIN_SSP_0_SCK_P1_20 \ 604 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_11 )808 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_11, 5) 605 809 #define LPC24XX_PIN_SSP_0_SCK_P2_22 \ 606 LPC24XX_PIN(2, 22, LPC24XX_PIN_FUNCTION_11 )810 LPC24XX_PIN(2, 22, LPC24XX_PIN_FUNCTION_11, 2) 607 811 608 812 #define LPC24XX_PIN_SSP_0_SSEL_P0_16 \ 609 LPC24XX_PIN(0, 16, LPC24XX_PIN_FUNCTION_10 )813 LPC24XX_PIN(0, 16, LPC24XX_PIN_FUNCTION_10, 2) 610 814 #define LPC24XX_PIN_SSP_0_SSEL_P1_21 \ 611 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_11 )815 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_11, 3) 612 816 #define LPC24XX_PIN_SSP_0_SSEL_P2_23 \ 613 LPC24XX_PIN(2, 23, LPC24XX_PIN_FUNCTION_11 )817 LPC24XX_PIN(2, 23, LPC24XX_PIN_FUNCTION_11, 2) 614 818 615 819 #define LPC24XX_PIN_SSP_0_MISO_P0_17 \ 616 LPC24XX_PIN(0, 17, LPC24XX_PIN_FUNCTION_10 )820 LPC24XX_PIN(0, 17, LPC24XX_PIN_FUNCTION_10, 2) 617 821 #define LPC24XX_PIN_SSP_0_MISO_P1_23 \ 618 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_11 )822 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_11, 5) 619 823 #define LPC24XX_PIN_SSP_0_MISO_P2_26 \ 620 LPC24XX_PIN(2, 26, LPC24XX_PIN_FUNCTION_11 )824 LPC24XX_PIN(2, 26, LPC24XX_PIN_FUNCTION_11, 2) 621 825 622 826 #define LPC24XX_PIN_SSP_0_MOSI_P0_18 \ 623 LPC24XX_PIN(0, 18, LPC24XX_PIN_FUNCTION_10 )827 LPC24XX_PIN(0, 18, LPC24XX_PIN_FUNCTION_10, 2) 624 828 #define LPC24XX_PIN_SSP_0_MOSI_P1_24 \ 625 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_11 )829 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_11, 5) 626 830 #define LPC24XX_PIN_SSP_0_MOSI_P2_27 \ 627 LPC24XX_PIN(2, 27, LPC24XX_PIN_FUNCTION_11 )831 LPC24XX_PIN(2, 27, LPC24XX_PIN_FUNCTION_11, 2) 628 832 629 833 /** @} */ … … 636 840 637 841 #define LPC24XX_PIN_SSP_1_SCK_P0_6 \ 638 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_10)842 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_10, 2) 639 843 #define LPC24XX_PIN_SSP_1_SCK_P0_12 \ 640 LPC24XX_PIN( 0, 12, LPC24XX_PIN_FUNCTION_10)844 LPC24XX_PIN(1, 31, LPC24XX_PIN_FUNCTION_10, 2) 641 845 #define LPC24XX_PIN_SSP_1_SCK_P4_20 \ 642 LPC24XX_PIN(4, 20, LPC24XX_PIN_FUNCTION_11 )846 LPC24XX_PIN(4, 20, LPC24XX_PIN_FUNCTION_11, 3) 643 847 644 848 #define LPC24XX_PIN_SSP_1_SSEL_P0_7 \ 645 LPC24XX_PIN(0, 7, LPC24XX_PIN_FUNCTION_10)849 LPC24XX_PIN(0, 6, LPC24XX_PIN_FUNCTION_10, 2) 646 850 #define LPC24XX_PIN_SSP_1_SSEL_P0_13 \ 647 LPC24XX_PIN(0, 1 3, LPC24XX_PIN_FUNCTION_10)851 LPC24XX_PIN(0, 14, LPC24XX_PIN_FUNCTION_11, 2) 648 852 #define LPC24XX_PIN_SSP_1_SSEL_P4_21 \ 649 LPC24XX_PIN(4, 21, LPC24XX_PIN_FUNCTION_11 )853 LPC24XX_PIN(4, 21, LPC24XX_PIN_FUNCTION_11, 3) 650 854 651 855 #define LPC24XX_PIN_SSP_1_MISO_P0_8 \ 652 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_10 )856 LPC24XX_PIN(0, 8, LPC24XX_PIN_FUNCTION_10, 2) 653 857 #define LPC24XX_PIN_SSP_1_MISO_P0_14 \ 654 LPC24XX_PIN(0, 1 4, LPC24XX_PIN_FUNCTION_11)858 LPC24XX_PIN(0, 12, LPC24XX_PIN_FUNCTION_10, 2) 655 859 #define LPC24XX_PIN_SSP_1_MISO_P4_22 \ 656 LPC24XX_PIN(4, 22, LPC24XX_PIN_FUNCTION_11 )860 LPC24XX_PIN(4, 22, LPC24XX_PIN_FUNCTION_11, 3) 657 861 658 862 #define LPC24XX_PIN_SSP_1_MOSI_P0_9 \ 659 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_10 )863 LPC24XX_PIN(0, 9, LPC24XX_PIN_FUNCTION_10, 2) 660 864 #define LPC24XX_PIN_SSP_1_MOSI_P1_31 \ 661 LPC24XX_PIN( 1, 31, LPC24XX_PIN_FUNCTION_10)865 LPC24XX_PIN(0, 13, LPC24XX_PIN_FUNCTION_10, 2) 662 866 #define LPC24XX_PIN_SSP_1_MOSI_P4_23 \ 663 LPC24XX_PIN(4, 23, LPC24XX_PIN_FUNCTION_11 )867 LPC24XX_PIN(4, 23, LPC24XX_PIN_FUNCTION_11, 3) 664 868 665 869 /** @} */ … … 672 876 673 877 #define LPC24XX_PIN_UART_0_TXD \ 674 LPC24XX_PIN(0, 2, LPC24XX_PIN_FUNCTION_01 )878 LPC24XX_PIN(0, 2, LPC24XX_PIN_FUNCTION_01, 1) 675 879 676 880 #define LPC24XX_PIN_UART_0_RXD \ 677 LPC24XX_PIN(0, 3, LPC24XX_PIN_FUNCTION_01 )881 LPC24XX_PIN(0, 3, LPC24XX_PIN_FUNCTION_01, 1) 678 882 679 883 /** @} */ … … 686 890 687 891 #define LPC24XX_PIN_UART_1_TXD_P0_15 \ 688 LPC24XX_PIN(0, 15, LPC24XX_PIN_FUNCTION_01 )892 LPC24XX_PIN(0, 15, LPC24XX_PIN_FUNCTION_01, 1) 689 893 #define LPC24XX_PIN_UART_1_TXD_P2_0 \ 690 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_10 )894 LPC24XX_PIN(2, 0, LPC24XX_PIN_FUNCTION_10, 2) 691 895 #define LPC24XX_PIN_UART_1_TXD_P3_16 \ 692 LPC24XX_PIN(3, 16, LPC24XX_PIN_FUNCTION_11 )896 LPC24XX_PIN(3, 16, LPC24XX_PIN_FUNCTION_11, 3) 693 897 694 898 #define LPC24XX_PIN_UART_1_RXD_P0_16 \ 695 LPC24XX_PIN(0, 16, LPC24XX_PIN_FUNCTION_01 )899 LPC24XX_PIN(0, 16, LPC24XX_PIN_FUNCTION_01, 1) 696 900 #define LPC24XX_PIN_UART_1_RXD_P2_1 \ 697 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_10 )901 LPC24XX_PIN(2, 1, LPC24XX_PIN_FUNCTION_10, 2) 698 902 #define LPC24XX_PIN_UART_1_RXD_P3_17 \ 699 LPC24XX_PIN(3, 17, LPC24XX_PIN_FUNCTION_11 )903 LPC24XX_PIN(3, 17, LPC24XX_PIN_FUNCTION_11, 3) 700 904 701 905 /** @} */ … … 708 912 709 913 #define LPC24XX_PIN_UART_2_TXD_P0_10 \ 710 LPC24XX_PIN(0, 10, LPC24XX_PIN_FUNCTION_01 )914 LPC24XX_PIN(0, 10, LPC24XX_PIN_FUNCTION_01, 1) 711 915 #define LPC24XX_PIN_UART_2_TXD_P2_8 \ 712 LPC24XX_PIN(2, 8, LPC24XX_PIN_FUNCTION_10 )916 LPC24XX_PIN(2, 8, LPC24XX_PIN_FUNCTION_10, 2) 713 917 #define LPC24XX_PIN_UART_2_TXD_P4_22 \ 714 LPC24XX_PIN(4, 22, LPC24XX_PIN_FUNCTION_10 )918 LPC24XX_PIN(4, 22, LPC24XX_PIN_FUNCTION_10, 2) 715 919 716 920 #define LPC24XX_PIN_UART_2_RXD_P0_11 \ 717 LPC24XX_PIN(0, 11, LPC24XX_PIN_FUNCTION_01 )921 LPC24XX_PIN(0, 11, LPC24XX_PIN_FUNCTION_01, 1) 718 922 #define LPC24XX_PIN_UART_2_RXD_P2_9 \ 719 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_10 )923 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_10, 2) 720 924 #define LPC24XX_PIN_UART_2_RXD_P4_23 \ 721 LPC24XX_PIN(4, 23, LPC24XX_PIN_FUNCTION_10 )925 LPC24XX_PIN(4, 23, LPC24XX_PIN_FUNCTION_10, 2) 722 926 723 927 /** @} */ … … 730 934 731 935 #define LPC24XX_PIN_UART_3_TXD_P0_0 \ 732 LPC24XX_PIN(0, 0, LPC24XX_PIN_FUNCTION_10 )936 LPC24XX_PIN(0, 0, LPC24XX_PIN_FUNCTION_10, 2) 733 937 #define LPC24XX_PIN_UART_3_TXD_P0_25 \ 734 LPC24XX_PIN(0, 25, LPC24XX_PIN_FUNCTION_11 )938 LPC24XX_PIN(0, 25, LPC24XX_PIN_FUNCTION_11, 3) 735 939 #define LPC24XX_PIN_UART_3_TXD_P4_28 \ 736 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_11 )940 LPC24XX_PIN(4, 28, LPC24XX_PIN_FUNCTION_11, 2) 737 941 738 942 #define LPC24XX_PIN_UART_3_RXD_P0_1 \ 739 LPC24XX_PIN(0, 1, LPC24XX_PIN_FUNCTION_10 )943 LPC24XX_PIN(0, 1, LPC24XX_PIN_FUNCTION_10, 2) 740 944 #define LPC24XX_PIN_UART_3_RXD_P0_25 \ 741 LPC24XX_PIN(0, 26, LPC24XX_PIN_FUNCTION_11 )945 LPC24XX_PIN(0, 26, LPC24XX_PIN_FUNCTION_11, 3) 742 946 #define LPC24XX_PIN_UART_3_RXD_P4_29 \ 743 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_11 )947 LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_11, 2) 744 948 745 949 /** @} */ … … 752 956 753 957 #define LPC24XX_PIN_USB_D_PLUS_1\ 754 LPC24XX_PIN(0, 29, LPC24XX_PIN_FUNCTION_01 )958 LPC24XX_PIN(0, 29, LPC24XX_PIN_FUNCTION_01, 1) 755 959 #define LPC24XX_PIN_USB_D_MINUS_1\ 756 LPC24XX_PIN(0, 30, LPC24XX_PIN_FUNCTION_01 )960 LPC24XX_PIN(0, 30, LPC24XX_PIN_FUNCTION_01, 1) 757 961 #define LPC24XX_PIN_USB_UP_LED_1\ 758 LPC24XX_PIN(1, 18, LPC24XX_PIN_FUNCTION_01 )962 LPC24XX_PIN(1, 18, LPC24XX_PIN_FUNCTION_01, 1) 759 963 #define LPC24XX_PIN_USB_TX_E_1\ 760 LPC24XX_PIN(1, 19, LPC24XX_PIN_FUNCTION_01 )964 LPC24XX_PIN(1, 19, LPC24XX_PIN_FUNCTION_01, 1) 761 965 #define LPC24XX_PIN_USB_PPWR_1\ 762 LPC24XX_PIN(1, 19, LPC24XX_PIN_FUNCTION_10 )966 LPC24XX_PIN(1, 19, LPC24XX_PIN_FUNCTION_10, 2) 763 967 #define LPC24XX_PIN_USB_TX_DP_1\ 764 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_01 )968 LPC24XX_PIN(1, 20, LPC24XX_PIN_FUNCTION_01, 1) 765 969 #define LPC24XX_PIN_USB_TX_DM_1\ 766 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_01 )970 LPC24XX_PIN(1, 21, LPC24XX_PIN_FUNCTION_01, 1) 767 971 #define LPC24XX_PIN_USB_RCV_1\ 768 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_01 )972 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_01, 1) 769 973 #define LPC24XX_PIN_USB_PWRD_1\ 770 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_10 )974 LPC24XX_PIN(1, 22, LPC24XX_PIN_FUNCTION_10, 2) 771 975 #define LPC24XX_PIN_USB_RX_DP_1\ 772 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_01 )976 LPC24XX_PIN(1, 23, LPC24XX_PIN_FUNCTION_01, 1) 773 977 #define LPC24XX_PIN_USB_RX_DM_1\ 774 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_01 )978 LPC24XX_PIN(1, 24, LPC24XX_PIN_FUNCTION_01, 1) 775 979 #define LPC24XX_PIN_USB_LS_1\ 776 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_01 )980 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_01, 1) 777 981 #define LPC24XX_PIN_USB_HSTEN_1\ 778 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_10 )982 LPC24XX_PIN(1, 25, LPC24XX_PIN_FUNCTION_10, 2) 779 983 #define LPC24XX_PIN_USB_SSPND_1\ 780 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_01 )984 LPC24XX_PIN(1, 26, LPC24XX_PIN_FUNCTION_01, 1) 781 985 #define LPC24XX_PIN_USB_INT_1\ 782 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_01 )986 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_01, 1) 783 987 #define LPC24XX_PIN_USB_OVRCR_1\ 784 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_10 )988 LPC24XX_PIN(1, 27, LPC24XX_PIN_FUNCTION_10, 2) 785 989 #define LPC24XX_PIN_USB_SCL_1\ 786 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01 )990 LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01, 1) 787 991 #define LPC24XX_PIN_USB_SDA_1\ 788 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01 )992 LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01, 1) 789 993 #define LPC24XX_PIN_USB_CONNECT_1\ 790 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_01 )994 LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_01, 1) 791 995 792 996 /** @} */ … … 799 1003 800 1004 #define LPC24XX_PIN_USB_PPWR_2\ 801 LPC24XX_PIN(0, 12, LPC24XX_PIN_FUNCTION_01 )1005 LPC24XX_PIN(0, 12, LPC24XX_PIN_FUNCTION_01, 1) 802 1006 #define LPC24XX_PIN_USB_UP_LED_2\ 803 LPC24XX_PIN(0, 13, LPC24XX_PIN_FUNCTION_01 )1007 LPC24XX_PIN(0, 13, LPC24XX_PIN_FUNCTION_01, 1) 804 1008 #define LPC24XX_PIN_USB_HSTEN_2\ 805 LPC24XX_PIN(0, 14, LPC24XX_PIN_FUNCTION_01 )1009 LPC24XX_PIN(0, 14, LPC24XX_PIN_FUNCTION_01, 1) 806 1010 #define LPC24XX_PIN_USB_CONNECT_2\ 807 LPC24XX_PIN(0, 14, LPC24XX_PIN_FUNCTION_01 )1011 LPC24XX_PIN(0, 14, LPC24XX_PIN_FUNCTION_01, 3) 808 1012 #define LPC24XX_PIN_USB_D_PLUS_2\ 809 LPC24XX_PIN(0, 31, LPC24XX_PIN_FUNCTION_ 10)1013 LPC24XX_PIN(0, 31, LPC24XX_PIN_FUNCTION_01, 1) 810 1014 #define LPC24XX_PIN_USB_PWRD_2\ 811 LPC24XX_PIN(1, 30, LPC24XX_PIN_FUNCTION_01 )1015 LPC24XX_PIN(1, 30, LPC24XX_PIN_FUNCTION_01, 1) 812 1016 #define LPC24XX_PIN_USB_OVRCR_2\ 813 LPC24XX_PIN(1, 31, LPC24XX_PIN_FUNCTION_01 )1017 LPC24XX_PIN(1, 31, LPC24XX_PIN_FUNCTION_01, 1) 814 1018 815 1019 /** @} */ -
c/src/lib/libbsp/arm/lpc24xx/include/irq.h
r4c622e5 r4a6cc2a 8 8 9 9 /* 10 * Copyright (c) 2008 11 * Embedded Brains GmbH 12 * Obere Lagerstr. 30 13 * D-82178 Puchheim 14 * Germany 15 * rtems@embedded-brains.de 10 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. 16 11 * 17 * The license and distribution terms for this file may be found in the file 18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. 12 * embedded brains GmbH 13 * Obere Lagerstr. 30 14 * 82178 Puchheim 15 * Germany 16 * <rtems@embedded-brains.de> 17 * 18 * The license and distribution terms for this file may be 19 * found in the file LICENSE in this distribution or at 20 * http://www.rtems.com/license/LICENSE. 19 21 */ 20 22 … … 23 25 24 26 #ifndef ASM 25 26 #include <rtems.h>27 #include <rtems/irq.h>28 # include <rtems/irq-extension.h>27 #include <rtems.h> 28 #include <rtems/irq.h> 29 #include <rtems/irq-extension.h> 30 #endif 29 31 30 32 /** … … 34 36 */ 35 37 36 #define LPC24XX_IRQ_WDT 0 37 #define LPC24XX_IRQ_SOFTWARE 1 38 #define LPC24XX_IRQ_ARM_CORE_0 2 39 #define LPC24XX_IRQ_ARM_CORE_1 3 40 #define LPC24XX_IRQ_TIMER_0 4 41 #define LPC24XX_IRQ_TIMER_1 5 42 #define LPC24XX_IRQ_UART_0 6 43 #define LPC24XX_IRQ_UART_1 7 44 #define LPC24XX_IRQ_PWM 8 45 #define LPC24XX_IRQ_I2C_0 9 46 #define LPC24XX_IRQ_SPI_SSP_0 10 47 #define LPC24XX_IRQ_SSP_1 11 48 #define LPC24XX_IRQ_PLL 12 49 #define LPC24XX_IRQ_RTC 13 50 #define LPC24XX_IRQ_EINT_0 14 51 #define LPC24XX_IRQ_EINT_1 15 52 #define LPC24XX_IRQ_EINT_2 16 53 #define LPC24XX_IRQ_EINT_3 17 54 #define LPC24XX_IRQ_ADC_0 18 55 #define LPC24XX_IRQ_I2C_1 19 56 #define LPC24XX_IRQ_BOD 20 57 #define LPC24XX_IRQ_ETHERNET 21 58 #define LPC24XX_IRQ_USB 22 59 #define LPC24XX_IRQ_CAN 23 60 #define LPC24XX_IRQ_SD_MMC 24 61 #define LPC24XX_IRQ_DMA 25 62 #define LPC24XX_IRQ_TIMER_2 26 63 #define LPC24XX_IRQ_TIMER_3 27 64 #define LPC24XX_IRQ_UART_2 28 65 #define LPC24XX_IRQ_UART_3 29 66 #define LPC24XX_IRQ_I2C_2 30 67 #define LPC24XX_IRQ_I2S 31 38 #define BSP_INTERRUPT_VECTOR_MIN 0 68 39 69 #define LPC24XX_IRQ_PRIORITY_VALUE_MIN 0U 70 #define LPC24XX_IRQ_PRIORITY_VALUE_MAX 15U 71 #define LPC24XX_IRQ_PRIORITY_COUNT (LPC24XX_IRQ_PRIORITY_VALUE_MAX + 1U) 40 #ifdef ARM_MULTILIB_ARCH_V4 41 #define LPC24XX_IRQ_WDT 0 42 #define LPC24XX_IRQ_SOFTWARE 1 43 #define LPC24XX_IRQ_ARM_CORE_0 2 44 #define LPC24XX_IRQ_ARM_CORE_1 3 45 #define LPC24XX_IRQ_TIMER_0 4 46 #define LPC24XX_IRQ_TIMER_1 5 47 #define LPC24XX_IRQ_UART_0 6 48 #define LPC24XX_IRQ_UART_1 7 49 #define LPC24XX_IRQ_PWM 8 50 #define LPC24XX_IRQ_I2C_0 9 51 #define LPC24XX_IRQ_SPI_SSP_0 10 52 #define LPC24XX_IRQ_SSP_1 11 53 #define LPC24XX_IRQ_PLL 12 54 #define LPC24XX_IRQ_RTC 13 55 #define LPC24XX_IRQ_EINT_0 14 56 #define LPC24XX_IRQ_EINT_1 15 57 #define LPC24XX_IRQ_EINT_2 16 58 #define LPC24XX_IRQ_EINT_3 17 59 #define LPC24XX_IRQ_ADC_0 18 60 #define LPC24XX_IRQ_I2C_1 19 61 #define LPC24XX_IRQ_BOD 20 62 #define LPC24XX_IRQ_ETHERNET 21 63 #define LPC24XX_IRQ_USB 22 64 #define LPC24XX_IRQ_CAN 23 65 #define LPC24XX_IRQ_SD_MMC 24 66 #define LPC24XX_IRQ_DMA 25 67 #define LPC24XX_IRQ_TIMER_2 26 68 #define LPC24XX_IRQ_TIMER_3 27 69 #define LPC24XX_IRQ_UART_2 28 70 #define LPC24XX_IRQ_UART_3 29 71 #define LPC24XX_IRQ_I2C_2 30 72 #define LPC24XX_IRQ_I2S 31 73 74 #define BSP_INTERRUPT_VECTOR_MAX 31 75 #endif 76 77 #define LPC24XX_IRQ_PRIORITY_VALUE_MIN 0 78 #ifdef ARM_MULTILIB_ARCH_V4 79 #define LPC24XX_IRQ_PRIORITY_VALUE_MAX 15 80 #endif 81 #define LPC24XX_IRQ_PRIORITY_COUNT (LPC24XX_IRQ_PRIORITY_VALUE_MAX + 1) 72 82 #define LPC24XX_IRQ_PRIORITY_HIGHEST LPC24XX_IRQ_PRIORITY_VALUE_MIN 73 83 #define LPC24XX_IRQ_PRIORITY_LOWEST LPC24XX_IRQ_PRIORITY_VALUE_MAX 74 84 75 /** 76 * @brief Minimum vector number. 77 */ 78 #define BSP_INTERRUPT_VECTOR_MIN LPC24XX_IRQ_WDT 79 80 /** 81 * @brief Maximum vector number. 82 */ 83 #define BSP_INTERRUPT_VECTOR_MAX LPC24XX_IRQ_I2S 85 #ifndef ASM 84 86 85 87 void lpc24xx_irq_set_priority(rtems_vector_number vector, unsigned priority); … … 87 89 unsigned lpc24xx_irq_get_priority(rtems_vector_number vector); 88 90 89 /** @} */ 91 void bsp_interrupt_dispatch(void); 90 92 91 93 #endif /* ASM */ 92 94 95 /** @} */ 96 93 97 #endif /* LIBBSP_ARM_LPC24XX_IRQ_H */ -
c/src/lib/libbsp/arm/lpc24xx/include/lcd.h
r4c622e5 r4a6cc2a 8 8 9 9 /* 10 * Copyright (c) 2010 embedded brains GmbH. All rights reserved.10 * Copyright (c) 2010-2011 embedded brains GmbH. All rights reserved. 11 11 * 12 12 * embedded brains GmbH … … 43 43 44 44 typedef enum { 45 LCD_MODE_STN_4_BIT = 0, 46 LCD_MODE_STN_8_BIT, 47 LCD_MODE_STN_DUAL_PANEL_4_BIT, 48 LCD_MODE_STN_DUAL_PANEL_8_BIT, 49 LCD_MODE_TFT_12_BIT_4_4_4, 50 LCD_MODE_TFT_16_BIT_5_6_5, 51 LCD_MODE_TFT_16_BIT_1_5_5_5, 52 LCD_MODE_TFT_24_BIT, 53 LCD_MODE_DISABLED 45 #ifdef ARM_MULTILIB_ARCH_V4 46 LCD_MODE_STN_4_BIT = 0, 47 LCD_MODE_STN_8_BIT, 48 LCD_MODE_STN_DUAL_PANEL_4_BIT, 49 LCD_MODE_STN_DUAL_PANEL_8_BIT, 50 LCD_MODE_TFT_12_BIT_4_4_4, 51 LCD_MODE_TFT_16_BIT_5_6_5, 52 LCD_MODE_TFT_16_BIT_1_5_5_5, 53 LCD_MODE_TFT_24_BIT, 54 LCD_MODE_DISABLED 55 #endif 54 56 } lpc24xx_lcd_mode; 55 57 -
c/src/lib/libbsp/arm/lpc24xx/include/lpc-clock-config.h
r4c622e5 r4a6cc2a 36 36 #define LPC_CLOCK_TIMER_BASE TMR0_BASE_ADDR 37 37 38 #define LPC_CLOCK_REFERENCE LPC24XX_ CCLK38 #define LPC_CLOCK_REFERENCE LPC24XX_PCLK 39 39 40 40 #define LPC_CLOCK_MODULE_ENABLE() \ 41 lpc24xx_module_enable(LPC24XX_MODULE_TIMER_0, LPC24XX_MODULE_ CCLK)41 lpc24xx_module_enable(LPC24XX_MODULE_TIMER_0, LPC24XX_MODULE_PCLK_DEFAULT) 42 42 43 43 #ifdef __cplusplus -
c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h
r4c622e5 r4a6cc2a 8 8 9 9 /* 10 * Copyright (c) 2008 11 * Embedded Brains GmbH 12 * Obere Lagerstr. 30 13 * D-82178 Puchheim 14 * Germany 15 * rtems@embedded-brains.de 10 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. 16 11 * 17 * The license and distribution terms for this file may be found in the file 18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. 12 * embedded brains GmbH 13 * Obere Lagerstr. 30 14 * 82178 Puchheim 15 * Germany 16 * <rtems@embedded-brains.de> 17 * 18 * The license and distribution terms for this file may be 19 * found in the file LICENSE in this distribution or at 20 * http://www.rtems.com/license/LICENSE. 21 * 22 * $Id$ 19 23 */ 20 24 … … 22 26 #define LIBBSP_ARM_LPC24XX_LPC24XX_H 23 27 24 #include < stdint.h>28 #include <rtems/score/cpu.h> 25 29 #include <bsp/utility.h> 26 30 #include <bsp/lpc-i2s.h> 31 32 #ifdef ARM_MULTILIB_ARCH_V7M 33 #include <bsp/lpc17xx.h> 34 #endif 27 35 28 36 /** … … 35 43 * @{ 36 44 */ 45 46 #ifdef ARM_MULTILIB_ARCH_V4 37 47 38 48 /* Vectored Interrupt Controller (VIC) */ … … 119 129 #define VICVectAddr (*(volatile uint32_t *) (VIC_BASE_ADDR + 0xF00)) 120 130 131 #endif /* ARM_MULTILIB_ARCH_V4 */ 121 132 122 133 /* Pin Connect Block */ 123 #define PINSEL_BASE_ADDR 0xE002C000 134 #ifdef ARM_MULTILIB_ARCH_V4 135 #define PINSEL_BASE_ADDR 0xE002C000 136 #else 137 #define PINSEL_BASE_ADDR 0x4002C000 138 #endif 139 140 #ifdef ARM_MULTILIB_ARCH_V4 141 124 142 #define PINSEL0 (*(volatile uint32_t *) (PINSEL_BASE_ADDR + 0x00)) 125 143 #define PINSEL1 (*(volatile uint32_t *) (PINSEL_BASE_ADDR + 0x04)) … … 146 164 #define PINMODE9 (*(volatile uint32_t *) (PINSEL_BASE_ADDR + 0x64)) 147 165 166 #endif /* ARM_MULTILIB_ARCH_V4 */ 167 148 168 /* General Purpose Input/Output (GPIO) */ 149 #define GPIO_BASE_ADDR 0xE0028000 169 #ifdef ARM_MULTILIB_ARCH_V4 170 #define GPIO_BASE_ADDR 0xE0028000 171 #else 172 #define GPIO_BASE_ADDR 0x40028000 173 #endif 150 174 #define IOPIN0 (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x00)) 151 175 #define IOSET0 (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x04)) … … 172 196 #define IO_INT_STAT (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x80)) 173 197 198 #ifdef ARM_MULTILIB_ARCH_V4 199 174 200 #define PARTCFG_BASE_ADDR 0x3FFF8000 175 201 #define PARTCFG (*(volatile uint32_t *) (PARTCFG_BASE_ADDR + 0x00)) 176 202 203 #endif /* ARM_MULTILIB_ARCH_V4 */ 204 177 205 /* Fast I/O setup */ 178 #define FIO_BASE_ADDR 0x3FFFC000 206 #ifdef ARM_MULTILIB_ARCH_V4 207 #define FIO_BASE_ADDR 0x3FFFC000 208 #else 209 #define FIO_BASE_ADDR 0x20098000 210 #endif 179 211 #define FIO0DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x00)) 180 212 #define FIO0MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x10)) … … 206 238 #define FIO4SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x98)) 207 239 #define FIO4CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x9C)) 240 241 #ifdef ARM_MULTILIB_ARCH_V7M 242 243 #define FIO5DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0xa0)) 244 #define FIO5MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0xb0)) 245 #define FIO5PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0xb4)) 246 #define FIO5SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0xb8)) 247 #define FIO5CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0xbC)) 248 249 #endif /* ARM_MULTILIB_ARCH_V7M */ 208 250 209 251 /* FIOs can be accessed through WORD, HALF-WORD or BYTE. */ … … 388 430 #define FIO4CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9E)) 389 431 432 #ifdef ARM_MULTILIB_ARCH_V4 390 433 391 434 /* System Control Block(SCB) modules include Memory Accelerator Module, … … 436 479 #define SCS (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x1A0)) 437 480 481 #endif /* ARM_MULTILIB_ARCH_V4 */ 438 482 439 483 /* External Memory Controller (EMC) */ 440 #define EMC_BASE_ADDR 0xFFE08000 484 #ifdef ARM_MULTILIB_ARCH_V4 485 #define EMC_BASE_ADDR 0xFFE08000 486 #else 487 #define EMC_BASE_ADDR 0x2009c000 488 #endif 441 489 #define EMC_CTRL (*(volatile uint32_t *) (EMC_BASE_ADDR + 0x000)) 442 490 #define EMC_STAT (*(volatile uint32_t *) (EMC_BASE_ADDR + 0x004)) … … 509 557 510 558 /* Timer 0 */ 511 #define TMR0_BASE_ADDR 0xE0004000 559 #ifdef ARM_MULTILIB_ARCH_V4 560 #define TMR0_BASE_ADDR 0xE0004000 561 #else 562 #define TMR0_BASE_ADDR 0x40004000 563 #endif 512 564 #define T0IR (*(volatile uint32_t *) (TMR0_BASE_ADDR + 0x00)) 513 565 #define T0TCR (*(volatile uint32_t *) (TMR0_BASE_ADDR + 0x04)) … … 529 581 530 582 /* Timer 1 */ 531 #define TMR1_BASE_ADDR 0xE0008000 583 #ifdef ARM_MULTILIB_ARCH_V4 584 #define TMR1_BASE_ADDR 0xE0008000 585 #else 586 #define TMR1_BASE_ADDR 0x40008000 587 #endif 532 588 #define T1IR (*(volatile uint32_t *) (TMR1_BASE_ADDR + 0x00)) 533 589 #define T1TCR (*(volatile uint32_t *) (TMR1_BASE_ADDR + 0x04)) … … 549 605 550 606 /* Timer 2 */ 551 #define TMR2_BASE_ADDR 0xE0070000 607 #ifdef ARM_MULTILIB_ARCH_V4 608 #define TMR2_BASE_ADDR 0xE0070000 609 #else 610 #define TMR2_BASE_ADDR 0x40090000 611 #endif 552 612 #define T2IR (*(volatile uint32_t *) (TMR2_BASE_ADDR + 0x00)) 553 613 #define T2TCR (*(volatile uint32_t *) (TMR2_BASE_ADDR + 0x04)) … … 569 629 570 630 /* Timer 3 */ 571 #define TMR3_BASE_ADDR 0xE0074000 631 #ifdef ARM_MULTILIB_ARCH_V4 632 #define TMR3_BASE_ADDR 0xE0074000 633 #else 634 #define TMR3_BASE_ADDR 0x40094000 635 #endif 572 636 #define T3IR (*(volatile uint32_t *) (TMR3_BASE_ADDR + 0x00)) 573 637 #define T3TCR (*(volatile uint32_t *) (TMR3_BASE_ADDR + 0x04)) … … 590 654 591 655 /* Pulse Width Modulator (PWM) */ 592 #define PWM0_BASE_ADDR 0xE0014000 656 #ifdef ARM_MULTILIB_ARCH_V4 657 #define PWM0_BASE_ADDR 0xE0014000 658 #else 659 #define PWM0_BASE_ADDR 0x40014000 660 #endif 593 661 #define PWM0IR (*(volatile uint32_t *) (PWM0_BASE_ADDR + 0x00)) 594 662 #define PWM0TCR (*(volatile uint32_t *) (PWM0_BASE_ADDR + 0x04)) … … 614 682 #define PWM0CTCR (*(volatile uint32_t *) (PWM0_BASE_ADDR + 0x70)) 615 683 616 #define PWM1_BASE_ADDR 0xE0018000 684 #ifdef ARM_MULTILIB_ARCH_V4 685 #define PWM1_BASE_ADDR 0xE0018000 686 #else 687 #define PWM1_BASE_ADDR 0x40018000 688 #endif 617 689 #define PWM1IR (*(volatile uint32_t *) (PWM1_BASE_ADDR + 0x00)) 618 690 #define PWM1TCR (*(volatile uint32_t *) (PWM1_BASE_ADDR + 0x04)) … … 640 712 641 713 /* Universal Asynchronous Receiver Transmitter 0 (UART0) */ 642 #define UART0_BASE_ADDR 0xE000C000 714 #ifdef ARM_MULTILIB_ARCH_V4 715 #define UART0_BASE_ADDR 0xE000C000 716 #else 717 #define UART0_BASE_ADDR 0x4000C000 718 #endif 643 719 #define U0RBR (*(volatile uint32_t *) (UART0_BASE_ADDR + 0x00)) 644 720 #define U0THR (*(volatile uint32_t *) (UART0_BASE_ADDR + 0x00)) … … 657 733 658 734 /* Universal Asynchronous Receiver Transmitter 1 (UART1) */ 659 #define UART1_BASE_ADDR 0xE0010000 735 #ifdef ARM_MULTILIB_ARCH_V4 736 #define UART1_BASE_ADDR 0xE0010000 737 #else 738 #define UART1_BASE_ADDR 0x40010000 739 #endif 660 740 #define U1RBR (*(volatile uint32_t *) (UART1_BASE_ADDR + 0x00)) 661 741 #define U1THR (*(volatile uint32_t *) (UART1_BASE_ADDR + 0x00)) … … 675 755 676 756 /* Universal Asynchronous Receiver Transmitter 2 (UART2) */ 677 #define UART2_BASE_ADDR 0xE0078000 757 #ifdef ARM_MULTILIB_ARCH_V4 758 #define UART2_BASE_ADDR 0xE0078000 759 #else 760 #define UART2_BASE_ADDR 0x40098000 761 #endif 678 762 #define U2RBR (*(volatile uint32_t *) (UART2_BASE_ADDR + 0x00)) 679 763 #define U2THR (*(volatile uint32_t *) (UART2_BASE_ADDR + 0x00)) … … 692 776 693 777 /* Universal Asynchronous Receiver Transmitter 3 (UART3) */ 694 #define UART3_BASE_ADDR 0xE007C000 778 #ifdef ARM_MULTILIB_ARCH_V4 779 #define UART3_BASE_ADDR 0xE007C000 780 #else 781 #define UART3_BASE_ADDR 0x4009C000 782 #endif 695 783 #define U3RBR (*(volatile uint32_t *) (UART3_BASE_ADDR + 0x00)) 696 784 #define U3THR (*(volatile uint32_t *) (UART3_BASE_ADDR + 0x00)) … … 709 797 710 798 /* I2C Interface 0 */ 711 #define I2C0_BASE_ADDR 0xE001C000 799 #ifdef ARM_MULTILIB_ARCH_V4 800 #define I2C0_BASE_ADDR 0xE001C000 801 #else 802 #define I2C0_BASE_ADDR 0x4001C000 803 #endif 712 804 #define I20CONSET (*(volatile uint32_t *) (I2C0_BASE_ADDR + 0x00)) 713 805 #define I20STAT (*(volatile uint32_t *) (I2C0_BASE_ADDR + 0x04)) … … 719 811 720 812 /* I2C Interface 1 */ 721 #define I2C1_BASE_ADDR 0xE005C000 813 #ifdef ARM_MULTILIB_ARCH_V4 814 #define I2C1_BASE_ADDR 0xE005C000 815 #else 816 #define I2C1_BASE_ADDR 0x4005C000 817 #endif 722 818 #define I21CONSET (*(volatile uint32_t *) (I2C1_BASE_ADDR + 0x00)) 723 819 #define I21STAT (*(volatile uint32_t *) (I2C1_BASE_ADDR + 0x04)) … … 729 825 730 826 /* I2C Interface 2 */ 731 #define I2C2_BASE_ADDR 0xE0080000 827 #ifdef ARM_MULTILIB_ARCH_V4 828 #define I2C2_BASE_ADDR 0xE0080000 829 #else 830 #define I2C2_BASE_ADDR 0x400a0000 831 #endif 732 832 #define I22CONSET (*(volatile uint32_t *) (I2C2_BASE_ADDR + 0x00)) 733 833 #define I22STAT (*(volatile uint32_t *) (I2C2_BASE_ADDR + 0x04)) … … 747 847 748 848 /* SSP0 Controller */ 749 #define SSP0_BASE_ADDR 0xE0068000 849 #ifdef ARM_MULTILIB_ARCH_V4 850 #define SSP0_BASE_ADDR 0xE0068000 851 #else 852 #define SSP0_BASE_ADDR 0x40088000 853 #endif 750 854 #define SSP0CR0 (*(volatile uint32_t *) (SSP0_BASE_ADDR + 0x00)) 751 855 #define SSP0CR1 (*(volatile uint32_t *) (SSP0_BASE_ADDR + 0x04)) … … 760 864 761 865 /* SSP1 Controller */ 762 #define SSP1_BASE_ADDR 0xE0030000 866 #ifdef ARM_MULTILIB_ARCH_V4 867 #define SSP1_BASE_ADDR 0xE0030000 868 #else 869 #define SSP1_BASE_ADDR 0x40030000 870 #endif 763 871 #define SSP1CR0 (*(volatile uint32_t *) (SSP1_BASE_ADDR + 0x00)) 764 872 #define SSP1CR1 (*(volatile uint32_t *) (SSP1_BASE_ADDR + 0x04)) … … 772 880 #define SSP1DMACR (*(volatile uint32_t *) (SSP1_BASE_ADDR + 0x24)) 773 881 882 #ifdef ARM_MULTILIB_ARCH_V7M 883 884 /* SSP2 Controller */ 885 #define SSP2_BASE_ADDR 0x400ac000 886 #define SSP2CR0 (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x00)) 887 #define SSP2CR1 (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x04)) 888 #define SSP2DR (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x08)) 889 #define SSP2SR (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x0C)) 890 #define SSP2CPSR (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x10)) 891 #define SSP2IMSC (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x14)) 892 #define SSP2RIS (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x18)) 893 #define SSP2MIS (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x1C)) 894 #define SSP2ICR (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x20)) 895 #define SSP2DMACR (*(volatile uint32_t *) (SSP2_BASE_ADDR + 0x24)) 896 897 #endif /* ARM_MULTILIB_ARCH_V4 */ 774 898 775 899 /* Real Time Clock */ 776 #define RTC_BASE_ADDR 0xE0024000 900 #ifdef ARM_MULTILIB_ARCH_V4 901 #define RTC_BASE_ADDR 0xE0024000 902 #else 903 #define RTC_BASE_ADDR 0x40024000 904 #endif 777 905 #define RTC_ILR (*(volatile uint32_t *) (RTC_BASE_ADDR + 0x00)) 778 906 #define RTC_CTC (*(volatile uint32_t *) (RTC_BASE_ADDR + 0x04)) … … 805 933 806 934 /* A/D Converter 0 (AD0) */ 807 #define AD0_BASE_ADDR 0xE0034000 935 #ifdef ARM_MULTILIB_ARCH_V4 936 #define AD0_BASE_ADDR 0xE0034000 937 #else 938 #define AD0_BASE_ADDR 0x40034000 939 #endif 808 940 #define AD0CR (*(volatile uint32_t *) (AD0_BASE_ADDR + 0x00)) 809 941 #define AD0GDR (*(volatile uint32_t *) (AD0_BASE_ADDR + 0x04)) … … 822 954 823 955 /* D/A Converter */ 824 #define DAC_BASE_ADDR 0xE006C000 956 #ifdef ARM_MULTILIB_ARCH_V4 957 #define DAC_BASE_ADDR 0xE006C000 958 #else 959 #define DAC_BASE_ADDR 0x4008C000 960 #endif 825 961 #define DACR (*(volatile uint32_t *) (DAC_BASE_ADDR + 0x00)) 826 962 827 963 828 964 /* Watchdog */ 829 #define WDG_BASE_ADDR 0xE0000000 965 #ifdef ARM_MULTILIB_ARCH_V4 966 #define WDG_BASE_ADDR 0xE0000000 967 #else 968 #define WDG_BASE_ADDR 0x40000000 969 #endif 830 970 #define WDMOD (*(volatile uint32_t *) (WDG_BASE_ADDR + 0x00)) 831 971 #define WDTC (*(volatile uint32_t *) (WDG_BASE_ADDR + 0x04)) … … 835 975 836 976 /* CAN CONTROLLERS AND ACCEPTANCE FILTER */ 837 #define CAN_ACCEPT_BASE_ADDR 0xE003C000 977 #ifdef ARM_MULTILIB_ARCH_V4 978 #define CAN_ACCEPT_BASE_ADDR 0xE003C000 979 #else 980 #define CAN_ACCEPT_BASE_ADDR 0x4003C000 981 #endif 838 982 #define CAN_AFMR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x00)) 839 983 #define CAN_SFF_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x04)) … … 845 989 #define CAN_LUT_ERR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x1C)) 846 990 847 #define CAN_CENTRAL_BASE_ADDR 0xE0040000 991 #ifdef ARM_MULTILIB_ARCH_V4 992 #define CAN_CENTRAL_BASE_ADDR 0xE0040000 993 #else 994 #define CAN_CENTRAL_BASE_ADDR 0x40040000 995 #endif 848 996 #define CAN_TX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x00)) 849 997 #define CAN_RX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x04)) 850 998 #define CAN_MSR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x08)) 851 999 852 #define CAN1_BASE_ADDR 0xE0044000 1000 #ifdef ARM_MULTILIB_ARCH_V4 1001 #define CAN1_BASE_ADDR 0xE0044000 1002 #else 1003 #define CAN1_BASE_ADDR 0x40044000 1004 #endif 853 1005 #define CAN1MOD (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x00)) 854 1006 #define CAN1CMR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x04)) … … 877 1029 #define CAN1TDB3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x5C)) 878 1030 879 #define CAN2_BASE_ADDR 0xE0048000 1031 #ifdef ARM_MULTILIB_ARCH_V4 1032 #define CAN2_BASE_ADDR 0xE0048000 1033 #else 1034 #define CAN2_BASE_ADDR 0x40048000 1035 #endif 880 1036 #define CAN2MOD (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x00)) 881 1037 #define CAN2CMR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x04)) … … 906 1062 907 1063 /* MultiMedia Card Interface(MCI) Controller */ 908 #define MCI_BASE_ADDR 0xE008C000 1064 #ifdef ARM_MULTILIB_ARCH_V4 1065 #define MCI_BASE_ADDR 0xE008C000 1066 #else 1067 #define MCI_BASE_ADDR 0x400c0000 1068 #endif 909 1069 #define MCI_POWER (*(volatile uint32_t *) (MCI_BASE_ADDR + 0x00)) 910 1070 #define MCI_CLOCK (*(volatile uint32_t *) (MCI_BASE_ADDR + 0x04)) … … 929 1089 930 1090 /* I2S Interface Controller (I2S) */ 931 #define I2S_BASE_ADDR 0xE0088000 1091 #ifdef ARM_MULTILIB_ARCH_V4 1092 #define I2S_BASE_ADDR 0xE0088000 1093 #else 1094 #define I2S_BASE_ADDR 0x400a8000 1095 #endif 932 1096 #define I2S_DAO (*(volatile uint32_t *) (I2S_BASE_ADDR + 0x00)) 933 1097 #define I2S_DAI (*(volatile uint32_t *) (I2S_BASE_ADDR + 0x04)) … … 943 1107 944 1108 /* General-purpose DMA Controller */ 945 #define DMA_BASE_ADDR 0xFFE04000 1109 #ifdef ARM_MULTILIB_ARCH_V4 1110 #define DMA_BASE_ADDR 0xFFE04000 1111 #else 1112 #define DMA_BASE_ADDR 0x20080000 1113 #endif 946 1114 #define GPDMA_INT_STAT (*(volatile uint32_t *) (DMA_BASE_ADDR + 0x000)) 947 1115 #define GPDMA_INT_TCSTAT (*(volatile uint32_t *) (DMA_BASE_ADDR + 0x004)) … … 975 1143 #define GPDMA_CH1_CFG (*(volatile uint32_t *) (DMA_BASE_ADDR + 0x130)) 976 1144 977 978 1145 /* USB Controller */ 979 #define USB_INT_BASE_ADDR 0xE01FC1C0 980 #define USB_BASE_ADDR 0xFFE0C200 /* USB Base Address */ 1146 #ifdef ARM_MULTILIB_ARCH_V4 1147 #define USB_INT_BASE_ADDR 0xE01FC1C0 1148 #define USB_BASE_ADDR 0xFFE0C200 /* USB Base Address */ 1149 #else 1150 #define USB_INT_BASE_ADDR 0x400fc1c0 1151 #define USB_BASE_ADDR 0x2008c200 1152 #endif 981 1153 982 1154 #define USB_INT_STAT (*(volatile uint32_t *) (USB_INT_BASE_ADDR + 0x00)) … … 1032 1204 #define SYS_ERR_INT_SET (*(volatile uint32_t *) (USB_BASE_ADDR + 0xC0)) 1033 1205 1034 1035 1206 /* USB Host Controller */ 1036 #define USBHC_BASE_ADDR 0xFFE0C000 1207 #ifdef ARM_MULTILIB_ARCH_V4 1208 #define USBHC_BASE_ADDR 0xFFE0C000 1209 #else 1210 #define USBHC_BASE_ADDR 0x2008c000 1211 #endif 1037 1212 #define HC_REVISION (*(volatile uint32_t *) (USBHC_BASE_ADDR + 0x00)) 1038 1213 #define HC_CONTROL (*(volatile uint32_t *) (USBHC_BASE_ADDR + 0x04)) … … 1060 1235 1061 1236 /* USB OTG Controller */ 1062 #define USBOTG_BASE_ADDR 0xFFE0C100 1237 #ifdef ARM_MULTILIB_ARCH_V4 1238 #define USBOTG_BASE_ADDR 0xFFE0C100 1239 #else 1240 #define USBOTG_BASE_ADDR 0x2008c100 1241 #endif 1063 1242 #define OTG_INT_STAT (*(volatile uint32_t *) (USBOTG_BASE_ADDR + 0x00)) 1064 1243 #define OTG_INT_EN (*(volatile uint32_t *) (USBOTG_BASE_ADDR + 0x04)) … … 1068 1247 #define OTG_TIMER (*(volatile uint32_t *) (USBOTG_BASE_ADDR + 0x14)) 1069 1248 1070 #define USBOTG_I2C_BASE_ADDR 0xFFE0C300 1249 #ifdef ARM_MULTILIB_ARCH_V4 1250 #define USBOTG_I2C_BASE_ADDR 0xFFE0C300 1251 #else 1252 #define USBOTG_I2C_BASE_ADDR 0x2008c300 1253 #endif 1071 1254 #define OTG_I2C_RX (*(volatile uint32_t *) (USBOTG_I2C_BASE_ADDR + 0x00)) 1072 1255 #define OTG_I2C_TX (*(volatile uint32_t *) (USBOTG_I2C_BASE_ADDR + 0x00)) … … 1076 1259 #define OTG_I2C_CLKLO (*(volatile uint32_t *) (USBOTG_I2C_BASE_ADDR + 0x10)) 1077 1260 1078 #define USBOTG_CLK_BASE_ADDR 0xFFE0CFF0 1261 #ifdef ARM_MULTILIB_ARCH_V4 1262 #define USBOTG_CLK_BASE_ADDR 0xFFE0CFF0 1263 #else 1264 #define USBOTG_CLK_BASE_ADDR 0x2008cff0 1265 #endif 1079 1266 #define OTG_CLK_CTRL (*(volatile uint32_t *) (USBOTG_CLK_BASE_ADDR + 0x04)) 1080 1267 #define OTG_CLK_STAT (*(volatile uint32_t *) (USBOTG_CLK_BASE_ADDR + 0x08)) 1081 1268 1082 1083 1269 /* Ethernet MAC (32 bit data bus) -- all registers are RW unless indicated in parentheses */ 1084 #define MAC_BASE_ADDR 0xFFE00000 /* AHB Peripheral # 0 */ 1270 #ifdef ARM_MULTILIB_ARCH_V4 1271 #define MAC_BASE_ADDR 0xFFE00000 /* AHB Peripheral # 0 */ 1272 #else 1273 #define MAC_BASE_ADDR 0x20084000 1274 #endif 1085 1275 #define MAC_MAC1 (*(volatile uint32_t *) (MAC_BASE_ADDR + 0x000)) /* MAC config reg 1 */ 1086 1276 #define MAC_MAC2 (*(volatile uint32_t *) (MAC_BASE_ADDR + 0x004)) /* MAC config reg 2 */ … … 1139 1329 /* LCD Controller */ 1140 1330 1141 #define LCD_BASE_ADDR 0xFFE10000 1331 #ifdef ARM_MULTILIB_ARCH_V4 1332 #define LCD_BASE_ADDR 0xFFE10000 1333 #else 1334 #define LCD_BASE_ADDR 0x20088000 1335 #endif 1142 1336 #define LCD_CFG (*(volatile uint32_t *) 0xE01FC1B8) 1143 1337 #define LCD_TIMH (*(volatile uint32_t *) (LCD_BASE_ADDR + 0x000)) … … 1938 2132 /* IO */ 1939 2133 2134 #ifdef ARM_MULTILIB_ARCH_V4 2135 #define LPC24XX_PINSEL ((volatile uint32_t *) &PINSEL0) 2136 #define LPC24XX_PINMODE ((volatile uint32_t *) &PINMODE0) 2137 #else 2138 #define IOCON_FUNC(val) BSP_FLD32(val, 0, 2) 2139 #define IOCON_FUNC_GET(reg) BSP_FLD32GET(reg, 0, 2) 2140 #define IOCON_FUNC_SET(reg, val) BSP_FLD32SET(reg, val, 0, 2) 2141 #define IOCON_MODE(val) BSP_FLD32(val, 3, 4) 2142 #define IOCON_MODE_GET(reg) BSP_FLD32GET(reg, 3, 4) 2143 #define IOCON_MODE_SET(reg, val) BSP_FLD32SET(reg, val, 3, 4) 2144 #define IOCON_HYS BSP_BIT32(5) 2145 #define IOCON_INV BSP_BIT32(6) 2146 #define IOCON_ADMODE BSP_BIT32(7) 2147 #define IOCON_FILTER BSP_BIT32(8) 2148 #define IOCON_HS BSP_BIT32(8) 2149 #define IOCON_SLEW BSP_BIT32(9) 2150 #define IOCON_HIDRIVE BSP_BIT32(9) 2151 #define IOCON_OD BSP_BIT32(10) 2152 #define IOCON_DACEN BSP_BIT32(16) 2153 #define LPC17XX_IOCON ((volatile uint32_t *) PINSEL_BASE_ADDR) 2154 #endif 2155 1940 2156 typedef struct { 1941 2157 uint32_t dir; … … 1947 2163 } lpc24xx_fio; 1948 2164 1949 #define LPC24XX_PINSEL ((volatile uint32_t *) &PINSEL0)1950 1951 #define LPC24XX_PINMODE ((volatile uint32_t *) &PINMODE0)1952 1953 2165 #define LPC24XX_FIO ((volatile lpc24xx_fio *) FIO_BASE_ADDR) 2166 2167 #ifdef ARM_MULTILIB_ARCH_V4 1954 2168 1955 2169 /* PCONP */ … … 1958 2172 #define PCONP_ETHERNET (1U << 30) 1959 2173 #define PCONP_USB (1U << 31) 2174 2175 #endif /* ARM_MULTILIB_ARCH_V4 */ 1960 2176 1961 2177 /* I2S */ -
c/src/lib/libbsp/arm/lpc24xx/include/start-config.h
r4c622e5 r4a6cc2a 27 27 28 28 #include <bsp.h> 29 #include <bsp/io.h> 29 30 #include <bsp/start.h> 30 31 #include <bsp/lpc-emc.h> … … 48 49 uint32_t trrd; 49 50 uint32_t tmrd; 51 uint32_t emcdlyctl; 50 52 } lpc24xx_emc_dynamic_config; 51 53 … … 71 73 } lpc24xx_emc_static_chip_config; 72 74 73 extern const BSP_START_DATA_SECTION uint32_t74 lpc24xx_start_config_pinsel _5_9[];75 extern BSP_START_DATA_SECTION const lpc24xx_pin_range 76 lpc24xx_start_config_pinsel []; 75 77 76 extern const BSP_START_DATA_SECTION size_t 77 lpc24xx_start_config_pinsel_5_9_size; 78 79 extern const BSP_START_DATA_SECTION lpc24xx_emc_dynamic_config 78 extern BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_config 80 79 lpc24xx_start_config_emc_dynamic []; 81 80 82 extern const BSP_START_DATA_SECTIONlpc24xx_emc_dynamic_chip_config81 extern BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_chip_config 83 82 lpc24xx_start_config_emc_dynamic_chip []; 84 83 85 extern const BSP_START_DATA_SECTIONsize_t84 extern BSP_START_DATA_SECTION const size_t 86 85 lpc24xx_start_config_emc_dynamic_chip_count; 87 86 88 extern const BSP_START_DATA_SECTIONlpc24xx_emc_static_chip_config87 extern BSP_START_DATA_SECTION const lpc24xx_emc_static_chip_config 89 88 lpc24xx_start_config_emc_static_chip []; 90 89 91 extern const BSP_START_DATA_SECTIONsize_t90 extern BSP_START_DATA_SECTION const size_t 92 91 lpc24xx_start_config_emc_static_chip_count; 93 92 -
c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
r4c622e5 r4a6cc2a 21 21 */ 22 22 23 #include <rtems/score/armv7m.h> 24 23 25 #include <bsp.h> 26 #include <bsp/irq.h> 24 27 #include <bsp/irq-generic.h> 25 28 #include <bsp/lpc24xx.h> … … 27 30 void bsp_interrupt_dispatch(void) 28 31 { 29 /* Read current vector number */ 30 rtems_vector_number vector = VICVectAddr; 32 #ifdef ARM_MULTILIB_ARCH_V4 33 /* Read current vector number */ 34 rtems_vector_number vector = VICVectAddr; 31 35 32 /* Enable interrupts in program status register */33 uint32_t psr = arm_status_irq_enable();36 /* Enable interrupts in program status register */ 37 uint32_t psr = arm_status_irq_enable(); 34 38 35 /* Dispatch interrupt handlers */36 bsp_interrupt_handler_dispatch(vector);39 /* Dispatch interrupt handlers */ 40 bsp_interrupt_handler_dispatch(vector); 37 41 38 /* Restore program status register */39 arm_status_restore(psr);42 /* Restore program status register */ 43 arm_status_restore(psr); 40 44 41 /* Acknowledge interrupt */ 42 VICVectAddr = 0; 45 /* Acknowledge interrupt */ 46 VICVectAddr = 0; 47 #endif 43 48 } -
c/src/lib/libbsp/arm/lpc24xx/irq/irq.c
r4c622e5 r4a6cc2a 21 21 */ 22 22 23 #include <rtems/score/armv7m.h> 24 23 25 #include <bsp.h> 24 26 #include <bsp/irq.h> 25 27 #include <bsp/irq-generic.h> 26 28 #include <bsp/lpc24xx.h> 29 #include <bsp/linker-symbols.h> 27 30 28 31 static inline bool lpc24xx_irq_is_valid(rtems_vector_number vector) … … 38 41 } 39 42 40 VICVectPriorityBase [vector] = priority; 43 #ifdef ARM_MULTILIB_ARCH_V4 44 VICVectPriorityBase [vector] = priority; 45 #endif 41 46 } 42 47 } … … 45 50 { 46 51 if (lpc24xx_irq_is_valid(vector)) { 47 return VICVectPriorityBase [vector]; 52 #ifdef ARM_MULTILIB_ARCH_V4 53 return VICVectPriorityBase [vector]; 54 #endif 48 55 } else { 49 56 return LPC24XX_IRQ_PRIORITY_VALUE_MIN - 1U; … … 53 60 rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector) 54 61 { 55 VICIntEnable = 1U << vector; 62 #ifdef ARM_MULTILIB_ARCH_V4 63 VICIntEnable = 1U << vector; 64 #endif 56 65 57 66 return RTEMS_SUCCESSFUL; … … 60 69 rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector) 61 70 { 62 VICIntEnClear = 1U << vector; 71 #ifdef ARM_MULTILIB_ARCH_V4 72 VICIntEnClear = 1U << vector; 73 #endif 63 74 64 75 return RTEMS_SUCCESSFUL; … … 67 78 rtems_status_code bsp_interrupt_facility_initialize(void) 68 79 { 69 volatile uint32_t *addr = VICVectAddrBase; 70 volatile uint32_t *prio = VICVectPriorityBase; 71 rtems_vector_number i = 0; 80 #ifdef ARM_MULTILIB_ARCH_V4 81 volatile uint32_t *addr = VICVectAddrBase; 82 volatile uint32_t *prio = VICVectPriorityBase; 83 rtems_vector_number i = 0; 72 84 73 /* Disable all interrupts */74 VICIntEnClear = 0xffffffff;85 /* Disable all interrupts */ 86 VICIntEnClear = 0xffffffff; 75 87 76 /* Clear all software interrupts */77 VICSoftIntClear = 0xffffffff;88 /* Clear all software interrupts */ 89 VICSoftIntClear = 0xffffffff; 78 90 79 /* Use IRQ category */80 VICIntSelect = 0;91 /* Use IRQ category */ 92 VICIntSelect = 0; 81 93 82 for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) {83 /* Use the vector address register to store the vector number */84 addr [i] = i;94 for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) { 95 /* Use the vector address register to store the vector number */ 96 addr [i] = i; 85 97 86 /* Give vector lowest priority */87 prio [i] = 15;88 }98 /* Give vector lowest priority */ 99 prio [i] = 15; 100 } 89 101 90 /* Reset priority mask register */91 VICSWPrioMask = 0xffff;102 /* Reset priority mask register */ 103 VICSWPrioMask = 0xffff; 92 104 93 /* Acknowledge interrupts for all priorities */ 94 for (i = LPC24XX_IRQ_PRIORITY_VALUE_MIN; i <= LPC24XX_IRQ_PRIORITY_VALUE_MAX; ++i) { 95 VICVectAddr = 0; 96 } 105 /* Acknowledge interrupts for all priorities */ 106 for ( 107 i = LPC24XX_IRQ_PRIORITY_VALUE_MIN; 108 i <= LPC24XX_IRQ_PRIORITY_VALUE_MAX; 109 ++i 110 ) { 111 VICVectAddr = 0; 112 } 97 113 98 /* Install the IRQ exception handler */ 99 _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL); 114 /* Install the IRQ exception handler */ 115 _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL); 116 #endif 100 117 101 118 return RTEMS_SUCCESSFUL; -
c/src/lib/libbsp/arm/lpc24xx/misc/bspidle.c
r4c622e5 r4a6cc2a 1 1 /** 2 2 * @file 3 *4 * @author Sebastian Huber <sebastian.huber@embedded-brains.de>5 3 * 6 4 * @ingroup lpc24xx … … 10 8 11 9 /* 12 * Copyright (c) 2008 13 * Embedded Brains GmbH 14 * Obere Lagerstr. 30 15 * D-82178 Puchheim 16 * Germany 17 * rtems@embedded-brains.de 10 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. 11 * 12 * embedded brains GmbH 13 * Obere Lagerstr. 30 14 * 82178 Puchheim 15 * Germany 16 * <rtems@embedded-brains.de> 18 17 * 19 18 * The license and distribution terms for this file may be … … 28 27 { 29 28 while (true) { 30 /* 31 * Set power mode to idle. Causes the processor clock to be stopped, while 32 * on-chip peripherals remain active. Any enabled interrupt from a 33 * peripheral or an external interrupt source will cause the processor to 34 * resume execution. 35 */ 36 PCON = 0x1; 29 #ifdef ARM_MULTILIB_ARCH_V4 30 /* 31 * Set power mode to idle. Causes the processor clock to be stopped, 32 * while on-chip peripherals remain active. Any enabled interrupt from a 33 * peripheral or an external interrupt source will cause the processor to 34 * resume execution. 35 */ 36 PCON = 0x1; 37 #endif 37 38 } 38 39 } -
c/src/lib/libbsp/arm/lpc24xx/misc/io.c
r4c622e5 r4a6cc2a 21 21 */ 22 22 23 #include <bsp.h> 23 24 #include <bsp/io.h> 25 #include <bsp/start.h> 24 26 #include <bsp/system-clocks.h> 25 27 26 #define LPC24XX_PIN_SELECT( pin) (pin>> 4U)27 28 #define LPC24XX_PIN_SELECT_SHIFT( pin) ((pin& 0xfU) << 1U)28 #define LPC24XX_PIN_SELECT(index) ((index) >> 4U) 29 30 #define LPC24XX_PIN_SELECT_SHIFT(index) (((index) & 0xfU) << 1U) 29 31 30 32 #define LPC24XX_PIN_SELECT_MASK 0x3U 31 33 32 34 rtems_status_code lpc24xx_gpio_config( 33 unsigned pin,35 unsigned index, 34 36 lpc24xx_gpio_settings settings 35 37 ) 36 38 { 37 if ( pin<= LPC24XX_IO_INDEX_MAX) {39 if (index <= LPC24XX_IO_INDEX_MAX) { 38 40 rtems_interrupt_level level; 39 unsigned port = LPC24XX_IO_PORT(pin); 40 unsigned bit = LPC24XX_IO_PORT_BIT(pin); 41 unsigned select = LPC24XX_PIN_SELECT(pin); 42 unsigned shift = LPC24XX_PIN_SELECT_SHIFT(pin); 43 unsigned resistor = settings & LPC24XX_GPIO_RESISTOR_MASK; 44 unsigned output = (settings & LPC24XX_GPIO_OUTPUT) != 0 ? 1U : 0U; 45 46 /* Get resistor flags */ 47 switch (resistor) { 48 case LPC24XX_GPIO_RESISTOR_PULL_UP: 49 case LPC24XX_GPIO_RESISTOR_DEFAULT: 50 resistor = 0x0U; 51 break; 52 case LPC24XX_GPIO_RESISTOR_NONE: 53 resistor = 0x2U; 54 break; 55 case LPC24XX_GPIO_RESISTOR_PULL_DOWN: 56 resistor = 0x3U; 57 break; 58 default: 59 return RTEMS_INVALID_NUMBER; 60 } 41 uint32_t port = LPC24XX_IO_PORT(index); 42 uint32_t port_bit = LPC24XX_IO_PORT_BIT(index); 43 uint32_t output = (settings & LPC24XX_GPIO_OUTPUT) != 0 ? 1U : 0U; 44 uint32_t resistor = settings & 0x3U; 45 #ifdef ARM_MULTILIB_ARCH_V4 46 uint32_t select = LPC24XX_PIN_SELECT(index); 47 uint32_t shift = LPC24XX_PIN_SELECT_SHIFT(index); 48 49 /* Get resistor flags */ 50 switch (resistor) { 51 case LPC24XX_GPIO_RESISTOR_PULL_UP: 52 resistor = 0x0U; 53 break; 54 case LPC24XX_GPIO_RESISTOR_NONE: 55 resistor = 0x2U; 56 break; 57 case LPC24XX_GPIO_RESISTOR_PULL_DOWN: 58 resistor = 0x3U; 59 break; 60 default: 61 return RTEMS_INVALID_NUMBER; 62 } 63 #endif 61 64 62 65 rtems_interrupt_disable(level); 63 66 64 /* Resistor */ 65 LPC24XX_PINMODE [select] = 66 (LPC24XX_PINMODE [select] & ~(LPC24XX_PIN_SELECT_MASK << shift)) 67 | ((resistor & LPC24XX_PIN_SELECT_MASK) << shift); 67 #ifdef ARM_MULTILIB_ARCH_V4 68 /* Resistor */ 69 LPC24XX_PINMODE [select] = 70 (LPC24XX_PINMODE [select] & ~(LPC24XX_PIN_SELECT_MASK << shift)) 71 | ((resistor & LPC24XX_PIN_SELECT_MASK) << shift); 72 #endif 68 73 69 74 rtems_interrupt_flash(level); … … 71 76 /* Input or output */ 72 77 LPC24XX_FIO [port].dir = 73 (LPC24XX_FIO [port].dir & ~(1U << bit)) | (output <<bit);78 (LPC24XX_FIO [port].dir & ~(1U << port_bit)) | (output << port_bit); 74 79 75 80 rtems_interrupt_enable(level); … … 95 100 96 101 static const lpc24xx_module_entry lpc24xx_module_table [] = { 97 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_ACF, 0, 1, 15), 102 #ifdef ARM_MULTILIB_ARCH_V4 103 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_ACF, 0, 1, 15), 104 #endif 98 105 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_ADC, 1, 1, 12), 99 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_BAT_RAM, 0, 1, 16), 106 #ifdef ARM_MULTILIB_ARCH_V4 107 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_BAT_RAM, 0, 1, 16), 108 #endif 100 109 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_CAN_0, 1, 1, 13), 101 110 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_CAN_1, 1, 1, 14), … … 104 113 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_ETHERNET, 1, 0, 30), 105 114 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_GPDMA, 1, 1, 29), 106 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_GPIO, 0, 1, 17), 115 #ifdef ARM_MULTILIB_ARCH_V4 116 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_GPIO, 0, 1, 17), 117 #else 118 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_GPIO, 0, 1, 15), 119 #endif 107 120 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_I2C_0, 1, 1, 7), 108 121 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_I2C_1, 1, 1, 19), 109 122 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_I2C_2, 1, 1, 26), 110 123 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_I2S, 1, 1, 27), 111 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_LCD, 1, 0, 20), 124 #ifdef ARM_MULTILIB_ARCH_V4 125 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_LCD, 1, 0, 20), 126 #else 127 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_LCD, 1, 0, 0), 128 #endif 112 129 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_MCI, 1, 1, 28), 113 130 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_PCB, 0, 1, 18), … … 115 132 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_PWM_1, 1, 1, 6), 116 133 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_RTC, 1, 1, 9), 117 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_SPI, 1, 1, 8), 134 #ifdef ARM_MULTILIB_ARCH_V4 135 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_SPI, 1, 1, 8), 136 #endif 118 137 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_SSP_0, 1, 1, 21), 119 138 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_SSP_1, 1, 1, 10), … … 127 146 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_UART_2, 1, 1, 24), 128 147 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_UART_3, 1, 1, 25), 129 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_USB, 1, 0, 31), 130 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_WDT, 0, 1, 0) 148 #ifdef ARM_MULTILIB_ARCH_V4 149 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_WDT, 0, 1, 0), 150 #endif 151 LPC24XX_MODULE_ENTRY(LPC24XX_MODULE_USB, 1, 0, 31) 131 152 }; 132 153 … … 146 167 } 147 168 148 if ((clock & ~LPC24XX_MODULE_CLOCK_MASK) != 0U) { 149 return RTEMS_INVALID_NUMBER; 150 } 169 #ifdef ARM_MULTILIB_ARCH_V4 170 if (clock == LPC24XX_MODULE_PCLK_DEFAULT) { 171 #if LPC24XX_PCLKDIV == 1U 172 clock = LPC24XX_MODULE_CCLK; 173 #elif LPC24XX_PCLKDIV == 2U 174 clock = LPC24XX_MODULE_CCLK_2; 175 #elif LPC24XX_PCLKDIV == 4U 176 clock = LPC24XX_MODULE_CCLK_4; 177 #elif LPC24XX_PCLKDIV == 8U 178 clock = LPC24XX_MODULE_CCLK_8; 179 #endif 180 } 181 182 if ((clock & ~LPC24XX_MODULE_CLOCK_MASK) != 0U) { 183 return RTEMS_INVALID_CLOCK; 184 } 185 #endif 151 186 152 187 has_power = lpc24xx_module_table [module].power; … … 158 193 if (has_power) { 159 194 rtems_interrupt_disable(level); 160 PCONP |= 1U << index; 195 #ifdef ARM_MULTILIB_ARCH_V4 196 PCONP |= 1U << index; 197 #endif 161 198 rtems_interrupt_enable(level); 162 199 } … … 164 201 if (module != LPC24XX_MODULE_USB) { 165 202 if (has_clock) { 166 unsigned clock_shift = 2U * index; 167 168 rtems_interrupt_disable(level); 169 if (clock_shift < 32U) { 170 PCLKSEL0 = (PCLKSEL0 & ~(LPC24XX_MODULE_CLOCK_MASK << clock_shift)) 171 | (clock << clock_shift); 172 } else { 173 clock_shift -= 32U; 174 PCLKSEL1 = (PCLKSEL1 & ~(LPC24XX_MODULE_CLOCK_MASK << clock_shift)) 175 | (clock << clock_shift); 176 } 177 rtems_interrupt_enable(level); 203 #ifdef ARM_MULTILIB_ARCH_V4 204 unsigned clock_shift = 2U * index; 205 206 rtems_interrupt_disable(level); 207 if (clock_shift < 32U) { 208 PCLKSEL0 = (PCLKSEL0 & ~(LPC24XX_MODULE_CLOCK_MASK << clock_shift)) 209 | (clock << clock_shift); 210 } else { 211 clock_shift -= 32U; 212 PCLKSEL1 = (PCLKSEL1 & ~(LPC24XX_MODULE_CLOCK_MASK << clock_shift)) 213 | (clock << clock_shift); 214 } 215 rtems_interrupt_enable(level); 216 #endif 178 217 } 179 218 } else { 180 unsigned pllclk = lpc24xx_pllclk(); 181 unsigned usbsel = pllclk / 48000000U - 1U; 182 183 if (usbsel > 15U || (usbsel % 2U != 1U) || (pllclk % 48000000U) != 0U) { 184 return RTEMS_INCORRECT_STATE; 185 } 186 187 USBCLKCFG = usbsel; 219 #ifdef ARM_MULTILIB_ARCH_V4 220 unsigned pllclk = lpc24xx_pllclk(); 221 unsigned usbsel = pllclk / 48000000U - 1U; 222 223 if ( 224 usbsel > 15U 225 || (usbsel % 2U != 1U) 226 || (pllclk % 48000000U) != 0U 227 ) { 228 return RTEMS_INCORRECT_STATE; 229 } 230 231 USBCLKCFG = usbsel; 232 #endif 188 233 } 189 234 } else { 190 235 if (has_power) { 191 236 rtems_interrupt_disable(level); 192 PCONP &= ~(1U << index); 237 #ifdef ARM_MULTILIB_ARCH_V4 238 PCONP &= ~(1U << index); 239 #endif 193 240 rtems_interrupt_enable(level); 194 241 } … … 214 261 215 262 typedef rtems_status_code (*lpc24xx_pin_visitor)( 216 volatile uint32_t *pinsel, 217 uint32_t pinsel_mask, 218 uint32_t pinsel_value, 263 #ifdef ARM_MULTILIB_ARCH_V4 264 volatile uint32_t *pinsel, 265 uint32_t pinsel_mask, 266 uint32_t pinsel_value, 267 #endif 219 268 volatile uint32_t *fio_dir, 220 269 uint32_t fio_bit 221 270 ); 222 271 223 static rtems_status_code lpc24xx_pin_set_function( 224 volatile uint32_t *pinsel, 225 uint32_t pinsel_mask, 226 uint32_t pinsel_value, 272 static BSP_START_TEXT_SECTION __attribute__((flatten)) rtems_status_code 273 lpc24xx_pin_set_function( 274 #ifdef ARM_MULTILIB_ARCH_V4 275 volatile uint32_t *pinsel, 276 uint32_t pinsel_mask, 277 uint32_t pinsel_value, 278 #endif 227 279 volatile uint32_t *fio_dir, 228 280 uint32_t fio_bit 229 281 ) 230 282 { 231 rtems_interrupt_level level; 232 233 rtems_interrupt_disable(level); 234 *pinsel = (*pinsel & ~pinsel_mask) | pinsel_value; 235 rtems_interrupt_enable(level); 283 #ifdef ARM_MULTILIB_ARCH_V4 284 rtems_interrupt_level level; 285 286 rtems_interrupt_disable(level); 287 *pinsel = (*pinsel & ~pinsel_mask) | pinsel_value; 288 rtems_interrupt_enable(level); 289 #endif 236 290 237 291 return RTEMS_SUCCESSFUL; 238 292 } 239 293 240 static rtems_status_code lpc24xx_pin_check_function( 241 volatile uint32_t *pinsel, 242 uint32_t pinsel_mask, 243 uint32_t pinsel_value, 294 static BSP_START_TEXT_SECTION rtems_status_code lpc24xx_pin_check_function( 295 #ifdef ARM_MULTILIB_ARCH_V4 296 volatile uint32_t *pinsel, 297 uint32_t pinsel_mask, 298 uint32_t pinsel_value, 299 #endif 244 300 volatile uint32_t *fio_dir, 245 301 uint32_t fio_bit 246 302 ) 247 303 { 248 if ((*pinsel & pinsel_mask) == pinsel_value) { 249 return RTEMS_SUCCESSFUL; 250 } else { 251 return RTEMS_IO_ERROR; 252 } 253 } 254 255 static rtems_status_code lpc24xx_pin_set_input( 256 volatile uint32_t *pinsel, 257 uint32_t pinsel_mask, 258 uint32_t pinsel_value, 304 #ifdef ARM_MULTILIB_ARCH_V4 305 if ((*pinsel & pinsel_mask) == pinsel_value) { 306 return RTEMS_SUCCESSFUL; 307 } else { 308 return RTEMS_IO_ERROR; 309 } 310 #endif 311 } 312 313 static BSP_START_TEXT_SECTION __attribute__((flatten)) rtems_status_code 314 lpc24xx_pin_set_input( 315 #ifdef ARM_MULTILIB_ARCH_V4 316 volatile uint32_t *pinsel, 317 uint32_t pinsel_mask, 318 uint32_t pinsel_value, 319 #endif 259 320 volatile uint32_t *fio_dir, 260 321 uint32_t fio_bit … … 265 326 rtems_interrupt_disable(level); 266 327 *fio_dir &= ~fio_bit; 267 *pinsel &= ~pinsel_mask; 328 #ifdef ARM_MULTILIB_ARCH_V4 329 *pinsel &= ~pinsel_mask; 330 #endif 268 331 rtems_interrupt_enable(level); 269 332 … … 271 334 } 272 335 273 static rtems_status_code lpc24xx_pin_check_input( 274 volatile uint32_t *pinsel, 275 uint32_t pinsel_mask, 276 uint32_t pinsel_value, 336 static BSP_START_TEXT_SECTION rtems_status_code lpc24xx_pin_check_input( 337 #ifdef ARM_MULTILIB_ARCH_V4 338 volatile uint32_t *pinsel, 339 uint32_t pinsel_mask, 340 uint32_t pinsel_value, 341 #endif 277 342 volatile uint32_t *fio_dir, 278 343 uint32_t fio_bit 279 344 ) 280 345 { 281 if ((*pinsel & pinsel_mask) == 0 && (*fio_dir & fio_bit) == 0) { 282 return RTEMS_SUCCESSFUL; 283 } else { 284 return RTEMS_IO_ERROR; 285 } 286 } 287 288 static const lpc24xx_pin_visitor lpc24xx_pin_visitors [] = { 346 rtems_status_code sc = RTEMS_IO_ERROR; 347 bool is_input = (*fio_dir & fio_bit) == 0; 348 349 if (is_input) { 350 #ifdef ARM_MULTILIB_ARCH_V4 351 bool is_gpio = (*pinsel & pinsel_mask) == 0; 352 #endif 353 354 if (is_gpio) { 355 sc = RTEMS_SUCCESSFUL; 356 } 357 } 358 359 return sc; 360 } 361 362 static BSP_START_DATA_SECTION const lpc24xx_pin_visitor 363 lpc24xx_pin_visitors [] = { 289 364 [LPC24XX_PIN_SET_FUNCTION] = lpc24xx_pin_set_function, 290 365 [LPC24XX_PIN_CHECK_FUNCTION] = lpc24xx_pin_check_function, … … 293 368 }; 294 369 295 rtems_status_code lpc24xx_pin_config(370 BSP_START_TEXT_SECTION rtems_status_code lpc24xx_pin_config( 296 371 const lpc24xx_pin_range *pins, 297 372 lpc24xx_pin_action action … … 303 378 lpc24xx_pin_visitor visitor = lpc24xx_pin_visitors [action]; 304 379 lpc24xx_pin_range terminal = LPC24XX_PIN_TERMINAL; 305 306 while (sc == RTEMS_SUCCESSFUL && pins->value != terminal.value) { 307 uint32_t port = pins->fields.port; 308 uint32_t index = pins->fields.index_begin; 309 uint32_t last = pins->fields.index_last; 310 uint32_t function = pins->fields.function; 380 lpc24xx_pin_range pin_range = *pins; 381 uint32_t previous_port_bit = pin_range.fields.port_bit; 382 383 while (sc == RTEMS_SUCCESSFUL && pin_range.value != terminal.value) { 384 uint32_t port = pin_range.fields.port; 385 uint32_t port_bit = pin_range.fields.port_bit; 386 uint32_t port_bit_last = port_bit; 387 uint32_t range = pin_range.fields.range; 388 #ifdef ARM_MULTILIB_ARCH_V4 389 uint32_t function = pin_range.fields.function; 390 #endif 311 391 volatile uint32_t *fio_dir = &LPC24XX_FIO [port].dir; 312 392 313 while (sc == RTEMS_SUCCESSFUL && index <= last) { 314 uint32_t pin = LPC24XX_IO_INDEX_BY_PORT(port, index); 315 uint32_t select = LPC24XX_PIN_SELECT(pin); 316 uint32_t shift = LPC24XX_PIN_SELECT_SHIFT(pin); 317 volatile uint32_t *pinsel = &LPC24XX_PINSEL [select]; 318 uint32_t pinsel_mask = LPC24XX_PIN_SELECT_MASK << shift; 319 uint32_t pinsel_value = (function & LPC24XX_PIN_SELECT_MASK) << shift; 320 uint32_t fio_bit = 1U << index; 321 322 sc = (*visitor)(pinsel, pinsel_mask, pinsel_value, fio_dir, fio_bit); 323 324 ++index; 393 if (range) { 394 port_bit = previous_port_bit; 325 395 } 326 396 397 while (sc == RTEMS_SUCCESSFUL && port_bit <= port_bit_last) { 398 uint32_t index = LPC24XX_IO_INDEX_BY_PORT(port, port_bit); 399 uint32_t fio_bit = 1U << port_bit; 400 #ifdef ARM_MULTILIB_ARCH_V4 401 uint32_t select = LPC24XX_PIN_SELECT(index); 402 uint32_t shift = LPC24XX_PIN_SELECT_SHIFT(index); 403 volatile uint32_t *pinsel = &LPC24XX_PINSEL [select]; 404 uint32_t pinsel_mask = LPC24XX_PIN_SELECT_MASK << shift; 405 uint32_t pinsel_value = (function & LPC24XX_PIN_SELECT_MASK) << shift; 406 407 sc = (*visitor)(pinsel, pinsel_mask, pinsel_value, fio_dir, fio_bit); 408 #endif 409 410 ++port_bit; 411 } 412 327 413 ++pins; 414 previous_port_bit = port_bit; 415 pin_range = *pins; 328 416 } 329 417 } else { -
c/src/lib/libbsp/arm/lpc24xx/misc/lcd.c
r4c622e5 r4a6cc2a 25 25 #include <bsp/lpc24xx.h> 26 26 #include <bsp/lcd.h> 27 #include <bsp/lpc-lcd.h> 27 28 #include <bsp/utility.h> 28 29 #include <bsp/system-clocks.h> 29 30 30 #define LCD_ENABLE BSP_BIT32(0) 31 #ifdef ARM_MULTILIB_ARCH_V4 32 #define LCD_ENABLE BSP_BIT32(0) 33 #endif 31 34 32 35 rtems_status_code lpc24xx_lcd_set_mode( … … 62 65 assert(sc == RTEMS_SUCCESSFUL); 63 66 64 PINSEL11 = BSP_FLD32(mode, 1, 3) | LCD_ENABLE; 67 #ifdef ARM_MULTILIB_ARCH_V4 68 PINSEL11 = BSP_FLD32(mode, 1, 3) | LCD_ENABLE; 69 #endif 65 70 66 71 sc = lpc24xx_pin_config(pins, LPC24XX_PIN_SET_FUNCTION); … … 84 89 assert(sc == RTEMS_SUCCESSFUL); 85 90 86 PINSEL11 = 0; 91 #ifdef ARM_MULTILIB_ARCH_V4 92 PINSEL11 = 0; 93 #endif 87 94 88 95 sc = lpc24xx_module_disable(LPC24XX_MODULE_LCD); … … 96 103 lpc24xx_lcd_mode lpc24xx_lcd_current_mode(void) 97 104 { 98 uint32_t pinsel11 = PINSEL11; 105 #ifdef ARM_MULTILIB_ARCH_V4 106 uint32_t pinsel11 = PINSEL11; 99 107 100 if ((PCONP & BSP_BIT32(20)) != 0 && (pinsel11 & LCD_ENABLE) != 0) { 101 return BSP_FLD32GET(pinsel11, 1, 3); 102 } else { 103 return LCD_MODE_DISABLED; 104 } 108 if ((PCONP & BSP_BIT32(20)) != 0 && (pinsel11 & LCD_ENABLE) != 0) { 109 return BSP_FLD32GET(pinsel11, 1, 3); 110 } else { 111 return LCD_MODE_DISABLED; 112 } 113 #endif 105 114 } -
c/src/lib/libbsp/arm/lpc24xx/misc/restart.c
r4c622e5 r4a6cc2a 29 29 void bsp_restart(void *addr) 30 30 { 31 ARM_SWITCH_REGISTERS; 32 rtems_interrupt_level level; 31 #ifdef ARM_MULTILIB_ARCH_V4 32 ARM_SWITCH_REGISTERS; 33 rtems_interrupt_level level; 33 34 34 rtems_interrupt_disable(level);35 rtems_interrupt_disable(level); 35 36 36 asm volatile ( 37 ARM_SWITCH_TO_ARM 38 "mov pc, %[addr]\n" 39 ARM_SWITCH_BACK 40 : ARM_SWITCH_OUTPUT 41 : [addr] "r" (addr) 42 ); 37 asm volatile ( 38 ARM_SWITCH_TO_ARM 39 "mov pc, %[addr]\n" 40 ARM_SWITCH_BACK 41 : ARM_SWITCH_OUTPUT 42 : [addr] "r" (addr) 43 ); 44 #endif 43 45 } -
c/src/lib/libbsp/arm/lpc24xx/misc/system-clocks.c
r4c622e5 r4a6cc2a 8 8 9 9 /* 10 * Copyright (c) 2008 11 * Embedded Brains GmbH 12 * Obere Lagerstr. 30 13 * D-82178 Puchheim 14 * Germany 15 * rtems@embedded-brains.de 10 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. 16 11 * 17 * The license and distribution terms for this file may be found in the file 18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. 12 * embedded brains GmbH 13 * Obere Lagerstr. 30 14 * 82178 Puchheim 15 * Germany 16 * <rtems@embedded-brains.de> 17 * 18 * The license and distribution terms for this file may be 19 * found in the file LICENSE in this distribution or at 20 * http://www.rtems.com/license/LICENSE. 21 * 22 * $Id$ 19 23 */ 20 24 … … 63 67 { 64 68 unsigned start = lpc24xx_timer(); 65 unsigned delay = us * (LPC24XX_ CCLK / 1000000);69 unsigned delay = us * (LPC24XX_PCLK / 1000000); 66 70 unsigned elapsed = 0; 67 71 … … 73 77 unsigned lpc24xx_pllclk(void) 74 78 { 75 unsigned clksrc = GET_CLKSRCSEL_CLKSRC(CLKSRCSEL); 76 unsigned pllinclk = 0; 77 unsigned pllclk = 0; 79 #ifdef ARM_MULTILIB_ARCH_V4 80 unsigned clksrc = GET_CLKSRCSEL_CLKSRC(CLKSRCSEL); 81 unsigned pllinclk = 0; 82 unsigned pllclk = 0; 78 83 79 /* Get PLL input frequency */80 switch (clksrc) {81 case 0:82 pllinclk = LPC24XX_OSCILLATOR_INTERNAL;83 break;84 case 1:85 pllinclk = LPC24XX_OSCILLATOR_MAIN;86 break;87 case 2:88 pllinclk = LPC24XX_OSCILLATOR_RTC;89 break;90 default:91 return 0;92 }84 /* Get PLL input frequency */ 85 switch (clksrc) { 86 case 0: 87 pllinclk = LPC24XX_OSCILLATOR_INTERNAL; 88 break; 89 case 1: 90 pllinclk = LPC24XX_OSCILLATOR_MAIN; 91 break; 92 case 2: 93 pllinclk = LPC24XX_OSCILLATOR_RTC; 94 break; 95 default: 96 return 0; 97 } 93 98 94 /* Get PLL output frequency */95 if ((PLLSTAT & PLLSTAT_PLLC) != 0) {96 uint32_t pllcfg = PLLCFG;97 unsigned n = GET_PLLCFG_NSEL(pllcfg) + 1;98 unsigned m = GET_PLLCFG_MSEL(pllcfg) + 1;99 /* Get PLL output frequency */ 100 if ((PLLSTAT & PLLSTAT_PLLC) != 0) { 101 uint32_t pllcfg = PLLCFG; 102 unsigned n = GET_PLLCFG_NSEL(pllcfg) + 1; 103 unsigned m = GET_PLLCFG_MSEL(pllcfg) + 1; 99 104 100 pllclk = (pllinclk / n) * 2 * m; 101 } else { 102 pllclk = pllinclk; 103 } 105 pllclk = (pllinclk / n) * 2 * m; 106 } else { 107 pllclk = pllinclk; 108 } 109 #endif 104 110 105 111 return pllclk; … … 108 114 unsigned lpc24xx_cclk(void) 109 115 { 110 /* Get PLL output frequency */ 111 unsigned pllclk = lpc24xx_pllclk(); 116 #ifdef ARM_MULTILIB_ARCH_V4 117 /* Get PLL output frequency */ 118 unsigned pllclk = lpc24xx_pllclk(); 112 119 113 /* Get CPU frequency */ 114 unsigned cclk = pllclk / (GET_CCLKCFG_CCLKSEL(CCLKCFG) + 1); 120 /* Get CPU frequency */ 121 unsigned cclk = pllclk / (GET_CCLKCFG_CCLKSEL(CCLKCFG) + 1); 122 #endif 115 123 116 124 return cclk; -
c/src/lib/libbsp/arm/lpc24xx/preinstall.am
r4c622e5 r4a6cc2a 122 122 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/lcd.h 123 123 124 $(PROJECT_INCLUDE)/bsp/lpc17xx.h: include/lpc17xx.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) 125 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/lpc17xx.h 126 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/lpc17xx.h 127 124 128 $(PROJECT_INCLUDE)/bsp/lpc24xx.h: include/lpc24xx.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) 125 129 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/lpc24xx.h -
c/src/lib/libbsp/arm/lpc24xx/ssp/ssp.c
r4c622e5 r4a6cc2a 26 26 #include <bsp/system-clocks.h> 27 27 #include <bsp/dma.h> 28 #include <bsp/io.h> 28 29 29 30 #define RTEMS_STATUS_CHECKS_USE_PRINTK … … 182 183 unsigned pre = 183 184 ((pclk + LPC24XX_SSP_BAUD_RATE - 1) / LPC24XX_SSP_BAUD_RATE + 1) & ~1U; 185 lpc24xx_module module = LPC24XX_MODULE_SSP_0; 184 186 rtems_vector_number vector = UINT32_MAX; 185 187 … … 214 216 regs->cr1 = 0; 215 217 216 /* Set clock select and get vector number */217 218 switch ((uintptr_t) regs) { 218 219 case SSP0_BASE_ADDR: 219 rtems_interrupt_disable(level); 220 PCLKSEL1 = SET_PCLKSEL1_PCLK_SSP0(PCLKSEL1, 1); 221 rtems_interrupt_enable(level); 222 220 module = LPC24XX_MODULE_SSP_0; 223 221 vector = LPC24XX_IRQ_SPI_SSP_0; 224 222 break; 225 223 case SSP1_BASE_ADDR: 226 rtems_interrupt_disable(level); 227 PCLKSEL0 = SET_PCLKSEL0_PCLK_SSP1(PCLKSEL0, 1); 228 rtems_interrupt_enable(level); 229 224 module = LPC24XX_MODULE_SSP_1; 230 225 vector = LPC24XX_IRQ_SSP_1; 231 226 break; … … 233 228 return RTEMS_IO_ERROR; 234 229 } 230 231 /* Set clock select */ 232 sc = lpc24xx_module_enable(module, LPC24XX_MODULE_PCLK_DEFAULT); 233 RTEMS_CHECK_SC(sc, "enable module clock"); 235 234 236 235 /* Set serial clock rate to save value */ -
c/src/lib/libbsp/arm/lpc24xx/startup/bspreset.c
r4c622e5 r4a6cc2a 23 23 #include <bsp/bootcard.h> 24 24 #include <bsp/lpc24xx.h> 25 #include <bsp/start.h> 25 26 26 void bsp_reset(void)27 BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void) 27 28 { 28 29 rtems_interrupt_level level; … … 30 31 rtems_interrupt_disable(level); 31 32 32 /* Trigger watchdog reset */ 33 WDCLKSEL = 0; 34 WDTC = 0xff; 35 WDMOD = 0x3; 36 WDFEED = 0xaa; 37 WDFEED = 0x55; 33 #ifdef ARM_MULTILIB_ARCH_V4 34 /* Trigger watchdog reset */ 35 WDCLKSEL = 0; 36 WDTC = 0xff; 37 WDMOD = 0x3; 38 WDFEED = 0xaa; 39 WDFEED = 0x55; 40 #endif 38 41 39 42 while (true) { -
c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c
r4c622e5 r4a6cc2a 72 72 }; 73 73 74 lpc24xx_module_enable(LPC24XX_MODULE_UART_0, LPC24XX_MODULE_ CCLK);74 lpc24xx_module_enable(LPC24XX_MODULE_UART_0, LPC24XX_MODULE_PCLK_DEFAULT); 75 75 lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION); 76 76 BSP_CONSOLE_UART_INIT(lpc24xx_cclk() / 16 / LPC24XX_UART_BAUD); … … 81 81 { 82 82 /* Initialize Timer 1 */ 83 lpc24xx_module_enable(LPC24XX_MODULE_TIMER_1, LPC24XX_MODULE_ CCLK);83 lpc24xx_module_enable(LPC24XX_MODULE_TIMER_1, LPC24XX_MODULE_PCLK_DEFAULT); 84 84 85 85 /* Initialize standard timer */ -
c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c
r4c622e5 r4a6cc2a 23 23 #include <stdbool.h> 24 24 25 #include <rtems/score/armv7m.h> 26 25 27 #include <bspopts.h> 28 #include <bsp/io.h> 26 29 #include <bsp/start.h> 27 #include <bsp/linker-symbols.h>28 30 #include <bsp/lpc24xx.h> 29 31 #include <bsp/lpc-emc.h> 30 32 #include <bsp/start-config.h> 31 33 32 static void BSP_START_TEXT_SECTIONlpc24xx_cpu_delay(unsigned ticks)34 static BSP_START_TEXT_SECTION void lpc24xx_cpu_delay(unsigned ticks) 33 35 { 34 36 unsigned i = 0; … … 42 44 } 43 45 44 static void BSP_START_TEXT_SECTIONlpc24xx_udelay(unsigned us)46 static BSP_START_TEXT_SECTION void lpc24xx_udelay(unsigned us) 45 47 { 46 48 lpc24xx_cpu_delay(us * (LPC24XX_CCLK / 1000000)); 47 49 } 48 50 49 static void BSP_START_TEXT_SECTION lpc24xx_init_emc_pinsel(void) 50 { 51 bsp_start_memcpy( 52 (int *) &PINSEL5, 53 (const int *) &lpc24xx_start_config_pinsel_5_9, 54 lpc24xx_start_config_pinsel_5_9_size 51 static BSP_START_TEXT_SECTION void lpc24xx_init_pinsel(void) 52 { 53 lpc24xx_pin_config( 54 &lpc24xx_start_config_pinsel [0], 55 LPC24XX_PIN_SET_FUNCTION 55 56 ); 56 57 } 57 58 58 static void BSP_START_TEXT_SECTIONlpc24xx_init_emc_static(void)59 static BSP_START_TEXT_SECTION void lpc24xx_init_emc_static(void) 59 60 { 60 61 size_t i = 0; … … 80 81 } 81 82 82 static void BSP_START_TEXT_SECTION lpc24xx_init_emc_memory_map(void) 83 { 84 /* Use normal memory map */ 85 EMC_CTRL &= ~0x2U; 86 } 87 88 static void BSP_START_TEXT_SECTION lpc24xx_init_emc_dynamic(void) 83 static BSP_START_TEXT_SECTION void lpc24xx_init_emc_dynamic(void) 89 84 { 90 85 size_t chip_count = lpc24xx_start_config_emc_dynamic_chip_count; … … 160 155 } 161 156 162 emc->dynamiccontrol = dynamiccontrol; 163 } 164 } 165 } 166 167 static void BSP_START_TEXT_SECTION lpc24xx_pll_config( 157 emc->dynamiccontrol = 0; 158 } 159 } 160 } 161 162 static BSP_START_TEXT_SECTION void lpc24xx_init_main_oscillator(void) 163 { 164 #ifdef ARM_MULTILIB_ARCH_V4 165 if ((SCS & 0x40) == 0) { 166 SCS |= 0x20; 167 while ((SCS & 0x40) == 0) { 168 /* Wait */ 169 } 170 } 171 #endif 172 } 173 174 #ifdef ARM_MULTILIB_ARCH_V4 175 176 static BSP_START_TEXT_SECTION void lpc24xx_pll_config( 168 177 uint32_t val 169 178 ) … … 188 197 * from the PLL output. 189 198 */ 190 static void BSP_START_TEXT_SECTIONlpc24xx_set_pll(199 static BSP_START_TEXT_SECTION void lpc24xx_set_pll( 191 200 unsigned clksrc, 192 201 unsigned nsel, … … 244 253 } 245 254 246 static void BSP_START_TEXT_SECTION lpc24xx_init_pll(void) 247 { 248 /* Enable main oscillator */ 249 if ((SCS & 0x40) == 0) { 250 SCS |= 0x20; 251 while ((SCS & 0x40) == 0) { 252 /* Wait */ 253 } 254 } 255 256 /* Set PLL */ 257 #if LPC24XX_OSCILLATOR_MAIN == 12000000U 258 #if LPC24XX_CCLK == 72000000U 259 lpc24xx_set_pll(1, 0, 11, 3); 260 #elif LPC24XX_CCLK == 51612800U 261 lpc24xx_set_pll(1, 30, 399, 5); 255 #endif /* ARM_MULTILIB_ARCH_V4 */ 256 257 static BSP_START_TEXT_SECTION void lpc24xx_init_pll(void) 258 { 259 #ifdef ARM_MULTILIB_ARCH_V4 260 #if LPC24XX_OSCILLATOR_MAIN == 12000000U 261 #if LPC24XX_CCLK == 72000000U 262 lpc24xx_set_pll(1, 0, 11, 3); 263 #elif LPC24XX_CCLK == 51612800U 264 lpc24xx_set_pll(1, 30, 399, 5); 265 #else 266 #error "unexpected CCLK" 267 #endif 268 #elif LPC24XX_OSCILLATOR_MAIN == 3686400U 269 #if LPC24XX_CCLK == 58982400U 270 lpc24xx_set_pll(1, 0, 47, 5); 271 #else 272 #error "unexpected CCLK" 273 #endif 262 274 #else 263 #error "unexpected CCLK" 264 #endif 265 #elif LPC24XX_OSCILLATOR_MAIN == 3686400U 266 #if LPC24XX_CCLK == 58982400U 267 lpc24xx_set_pll(1, 0, 47, 5); 275 #error "unexpected main oscillator frequency" 276 #endif 277 #endif 278 } 279 280 static BSP_START_TEXT_SECTION void lpc24xx_init_memory_map(void) 281 { 282 #ifdef ARM_MULTILIB_ARCH_V4 283 /* Re-map interrupt vectors to internal RAM */ 284 MEMMAP = SET_MEMMAP_MAP(MEMMAP, 2); 285 #endif 286 287 /* Use normal memory map */ 288 EMC_CTRL &= ~0x2U; 289 } 290 291 static BSP_START_TEXT_SECTION void lpc24xx_init_memory_accelerator(void) 292 { 293 #ifdef ARM_MULTILIB_ARCH_V4 294 /* Fully enable memory accelerator module functions (MAM) */ 295 MAMCR = 0; 296 #if LPC24XX_CCLK <= 20000000U 297 MAMTIM = 0x1; 298 #elif LPC24XX_CCLK <= 40000000U 299 MAMTIM = 0x2; 300 #elif LPC24XX_CCLK <= 60000000U 301 MAMTIM = 0x3; 268 302 #else 269 #error "unexpected CCLK" 270 #endif 271 #else 272 #error "unexpected main oscillator frequency" 273 #endif 274 } 275 276 static void BSP_START_TEXT_SECTION lpc24xx_clear_bss(void) 277 { 278 const int *end = (const int *) bsp_section_bss_end; 279 int *out = (int *) bsp_section_bss_begin; 280 281 /* Clear BSS */ 282 while (out != end) { 283 *out = 0; 284 ++out; 285 } 286 } 287 288 void BSP_START_TEXT_SECTION bsp_start_hook_0(void) 289 { 290 lpc24xx_init_pll(); 291 lpc24xx_init_emc_pinsel(); 292 lpc24xx_init_emc_static(); 293 } 294 295 void BSP_START_TEXT_SECTION bsp_start_hook_1(void) 296 { 297 /* Re-map interrupt vectors to internal RAM */ 298 MEMMAP = SET_MEMMAP_MAP(MEMMAP, 2); 299 300 /* Fully enable memory accelerator module functions (MAM) */ 301 MAMCR = 0; 302 #if LPC24XX_CCLK <= 20000000U 303 MAMTIM = 0x1; 304 #elif LPC24XX_CCLK <= 40000000U 305 MAMTIM = 0x2; 306 #elif LPC24XX_CCLK <= 60000000U 307 MAMTIM = 0x3; 308 #else 309 MAMTIM = 0x4; 310 #endif 311 MAMCR = 0x2; 312 313 /* Enable fast IO for ports 0 and 1 */ 314 SCS |= 0x1; 315 316 /* Set fast IO */ 317 FIO0DIR = 0; 318 FIO1DIR = 0; 319 FIO2DIR = 0; 320 FIO3DIR = 0; 321 FIO4DIR = 0; 322 FIO0CLR = 0xffffffff; 323 FIO1CLR = 0xffffffff; 324 FIO2CLR = 0xffffffff; 325 FIO3CLR = 0xffffffff; 326 FIO4CLR = 0xffffffff; 327 328 lpc24xx_init_emc_memory_map(); 329 lpc24xx_init_emc_dynamic(); 330 303 MAMTIM = 0x4; 304 #endif 305 MAMCR = 0x2; 306 307 /* Enable fast IO for ports 0 and 1 */ 308 SCS |= 0x1; 309 #endif 310 } 311 312 static BSP_START_TEXT_SECTION void lpc24xx_stop_gpdma(void) 313 { 331 314 #ifdef LPC24XX_STOP_GPDMA 332 if ((PCONP & PCONP_GPDMA) != 0) { 315 #ifdef ARM_MULTILIB_ARCH_V4 316 bool has_power = (PCONP & PCONP_GPDMA) != 0; 317 #endif 318 319 if (has_power) { 333 320 GPDMA_CONFIG = 0; 334 PCONP &= ~PCONP_GPDMA; 335 } 336 #endif 337 321 322 #ifdef ARM_MULTILIB_ARCH_V4 323 PCONP &= ~PCONP_GPDMA; 324 #endif 325 } 326 #endif 327 } 328 329 static BSP_START_TEXT_SECTION void lpc24xx_stop_ethernet(void) 330 { 338 331 #ifdef LPC24XX_STOP_ETHERNET 339 if ((PCONP & PCONP_ETHERNET) != 0) { 332 #ifdef ARM_MULTILIB_ARCH_V4 333 bool has_power = (PCONP & PCONP_ETHERNET) != 0; 334 #endif 335 336 if (has_power) { 340 337 MAC_COMMAND = 0x38; 341 338 MAC_MAC1 = 0xcf00; 342 339 MAC_MAC1 = 0; 343 PCONP &= ~PCONP_ETHERNET; 344 } 345 #endif 346 340 341 #ifdef ARM_MULTILIB_ARCH_V4 342 PCONP &= ~PCONP_ETHERNET; 343 #endif 344 } 345 #endif 346 } 347 348 static BSP_START_TEXT_SECTION void lpc24xx_stop_usb(void) 349 { 347 350 #ifdef LPC24XX_STOP_USB 348 if ((PCONP & PCONP_USB) != 0) { 351 #ifdef ARM_MULTILIB_ARCH_V4 352 bool has_power = (PCONP & PCONP_USB) != 0; 353 #endif 354 355 if (has_power) { 349 356 OTG_CLK_CTRL = 0; 350 PCONP &= ~PCONP_USB; 351 } 352 #endif 353 354 /* Copy .text section */ 355 bsp_start_memcpy( 356 (int *) bsp_section_text_begin, 357 (const int *) bsp_section_text_load_begin, 358 (size_t) bsp_section_text_size 359 ); 360 361 /* Copy .rodata section */ 362 bsp_start_memcpy( 363 (int *) bsp_section_rodata_begin, 364 (const int *) bsp_section_rodata_load_begin, 365 (size_t) bsp_section_rodata_size 366 ); 367 368 /* Copy .data section */ 369 bsp_start_memcpy( 370 (int *) bsp_section_data_begin, 371 (const int *) bsp_section_data_load_begin, 372 (size_t) bsp_section_data_size 373 ); 374 375 /* Copy .fast_text section */ 376 bsp_start_memcpy( 377 (int *) bsp_section_fast_text_begin, 378 (const int *) bsp_section_fast_text_load_begin, 379 (size_t) bsp_section_fast_text_size 380 ); 381 382 /* Copy .fast_data section */ 383 bsp_start_memcpy( 384 (int *) bsp_section_fast_data_begin, 385 (const int *) bsp_section_fast_data_load_begin, 386 (size_t) bsp_section_fast_data_size 387 ); 388 389 /* Clear .bss section */ 390 lpc24xx_clear_bss(); 357 358 #ifdef ARM_MULTILIB_ARCH_V4 359 PCONP &= ~PCONP_USB; 360 #endif 361 } 362 #endif 363 } 364 365 BSP_START_TEXT_SECTION void bsp_start_hook_0(void) 366 { 367 lpc24xx_init_main_oscillator(); 368 lpc24xx_init_pll(); 369 lpc24xx_init_pinsel(); 370 lpc24xx_init_emc_static(); 371 } 372 373 BSP_START_TEXT_SECTION void bsp_start_hook_1(void) 374 { 375 lpc24xx_init_memory_map(); 376 lpc24xx_init_memory_accelerator(); 377 lpc24xx_init_emc_dynamic(); 378 lpc24xx_stop_gpdma(); 379 lpc24xx_stop_ethernet(); 380 lpc24xx_stop_usb(); 381 bsp_start_copy_sections(); 391 382 392 383 /* At this point we can use objects outside the .start section */ -
c/src/lib/libbsp/arm/lpc24xx/startup/start-config-emc-dynamic.c
r4c622e5 r4a6cc2a 26 26 #include <bsp/lpc24xx.h> 27 27 28 const BSP_START_DATA_SECTIONlpc24xx_emc_dynamic_config28 BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_config 29 29 lpc24xx_start_config_emc_dynamic [] = { 30 #if defined(LPC24XX_EMC_M ICRON)30 #if defined(LPC24XX_EMC_MT48LC4M16A2) 31 31 /* Dynamic Memory 0: Micron M T48LC 4M16 A2 P 75 IT */ 32 32 { … … 68 68 69 69 /* Load mode register to active or refresh command period 2 tCK */ 70 .tmrd = 1 71 } 72 #elif defined(LPC24XX_EMC_W9825G2JB75I) 73 /* Dynamic Memory 0: Winbond W9825G2JB75I at 51612800Hz (tCK = 19.4ns) */ 74 { 75 /* (n * 16) clock cycles -> 15.5us <= 15.6 us */ 76 .refresh = 50, 77 78 /* Use command delayed strategy */ 79 .readconfig = 1, 80 81 /* (n + 1) clock cycles -> 38.8ns >= 20ns */ 82 .trp = 1, 83 84 /* (n + 1) clock cycles -> 58.1ns >= 45ns */ 85 .tras = 2, 86 87 /* (n + 1) clock cycles -> 77.5ns >= 75ns (tXSR) */ 88 .tsrex = 3, 89 90 /* (n + 1) clock cycles -> 38.8ns >= 20ns (tRCD) */ 91 .tapr = 1, 92 93 /* n clock cycles -> 77.5ns >= tWR + tRP -> 2 * tCK + 20ns */ 94 .tdal = 4, 95 96 /* (n + 1) clock cycles == 2 * tCK */ 97 .twr = 1, 98 99 /* (n + 1) clock cycles = 77.5ns >= 65ns */ 100 .trc = 3, 101 102 /* (n + 1) clock cycles = 77.5ns >= 65ns (tRC) */ 103 .trfc = 3, 104 105 /* (n + 1) clock cycles = 77.5ns >= 75ns */ 106 .txsr = 3, 107 108 /* (n + 1) clock cycles == 2 * tCK */ 109 .trrd = 1, 110 111 /* (n + 1) clock cycles == 2 * tCK (tRSC)*/ 70 112 .tmrd = 1 71 113 } … … 86 128 .tmrd = 2 87 129 } 130 #elif defined(LPC24XX_EMC_IS42S32800B) 131 #if LPC24XX_EMCCLK == 72000000U 132 { 133 /* tCK = 13.888ns at 72MHz */ 134 135 /* (n * 16) clock cycles -> 15.556us <= 15.6us */ 136 .refresh = 70, 137 138 .readconfig = 1, 139 140 /* (n + 1) clock cycles -> 27.8ns >= 20ns */ 141 .trp = 1, 142 143 /* (n + 1) clock cycles -> 55.5ns >= 45ns */ 144 .tras = 3, 145 146 /* (n + 1) clock cycles -> 69.4ns >= 70ns (tRC) */ 147 .tsrex = 5, 148 149 /* (n + 1) clock cycles -> 41.7ns >= FIXME */ 150 .tapr = 2, 151 152 /* n clock cycles -> 55.5ns >= tWR + tRP = 47.8ns */ 153 .tdal = 4, 154 155 /* (n + 1) clock cycles == 2 * tCK */ 156 .twr = 1, 157 158 /* (n + 1) clock cycles -> 83.3ns >= 70ns */ 159 .trc = 5, 160 161 /* (n + 1) clock cycles -> 83.3ns >= 70ns */ 162 .trfc = 5, 163 164 /* (n + 1) clock cycles -> 69.4ns >= 70ns (tRC) */ 165 .txsr = 5, 166 167 /* (n + 1) clock cycles -> 27.8ns >= 14ns */ 168 .trrd = 1, 169 170 /* (n + 1) clock cycles == 2 * tCK */ 171 .tmrd = 1, 172 173 /* FIXME */ 174 .emcdlyctl = 0x1112 175 } 176 #elif LPC24XX_EMCCLK == 60000000U 177 { 178 .refresh = 0x3a, 179 .readconfig = 1, 180 .trp = 1, 181 .tras = 3, 182 .tsrex = 5, 183 .tapr = 2, 184 .tdal = 3, 185 .twr = 1, 186 .trc = 4, 187 .trfc = 4, 188 .txsr = 5, 189 .trrd = 1, 190 .tmrd = 1, 191 .emcdlyctl = 0x1112 192 } 193 #else 194 #error "unexpected EMCCLK" 195 #endif 88 196 #endif 89 197 }; 90 198 91 const BSP_START_DATA_SECTIONlpc24xx_emc_dynamic_chip_config199 BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_chip_config 92 200 lpc24xx_start_config_emc_dynamic_chip [] = { 93 #if defined(LPC24XX_EMC_M ICRON)201 #if defined(LPC24XX_EMC_MT48LC4M16A2) 94 202 { 95 203 .chip_select = (volatile lpc_emc_dynamic *) &EMC_DYN_CFG0, … … 97 205 /* 98 206 * Use SDRAM, 0 0 001 01 address mapping, disabled buffer, unprotected 99 * writes. 207 * writes. 4 banks, 12 row lines, 8 column lines. 100 208 */ 101 209 .config = 0x280, … … 103 211 .rascas = EMC_DYN_RASCAS_RAS(2) | EMC_DYN_RASCAS_CAS(2, 0), 104 212 .mode = 0xa0000000 | (0x23 << (1 + 2 + 8)) 213 } 214 #elif defined(LPC24XX_EMC_W9825G2JB75I) 215 { 216 .chip_select = (volatile lpc_emc_dynamic *) &EMC_DYN_CFG0, 217 218 /* 32-bit data bus, 4 banks, 12 row lines, 9 column lines, RBC */ 219 .config = 0x4280, 220 221 /* RAS based on tRCD = 20ns */ 222 .rascas = EMC_DYN_RASCAS_RAS(2) | EMC_DYN_RASCAS_CAS(2, 0), 223 224 /* CAS 2, burst length 8, */ 225 .mode = 0xa0000000 | (0x23 << (2 + 2 + 9)) 105 226 } 106 227 #elif defined(LPC24XX_EMC_K4S561632E) … … 111 232 .mode = 0xa0000000 | (0x33 << 12) 112 233 } 234 #elif defined(LPC24XX_EMC_IS42S32800B) 235 { 236 .chip_select = (volatile lpc_emc_dynamic *) &EMC_DYN_CFG0, 237 238 /* 256MBit, 8Mx32, 4 banks, row = 12, column = 9, RBC */ 239 .config = 0x4480, 240 241 #if LPC24XX_EMCCLK == 72000000U 242 .rascas = EMC_DYN_RASCAS_RAS(3) | EMC_DYN_RASCAS_CAS(3, 0), 243 .mode = 0xa0000000 | (0x32 << (2 + 2 + 9)) 244 #elif LPC24XX_EMCCLK == 60000000U 245 .rascas = EMC_DYN_RASCAS_RAS(2) | EMC_DYN_RASCAS_CAS(2, 0), 246 .mode = 0xa0000000 | (0x22 << (2 + 2 + 9)) 247 #else 248 #error "unexpected EMCCLK" 249 #endif 250 } 113 251 #endif 114 252 }; 115 253 116 const BSP_START_DATA_SECTIONsize_t254 BSP_START_DATA_SECTION const size_t 117 255 lpc24xx_start_config_emc_dynamic_chip_count = 118 256 sizeof(lpc24xx_start_config_emc_dynamic_chip) -
c/src/lib/libbsp/arm/lpc24xx/startup/start-config-emc-static.c
r4c622e5 r4a6cc2a 26 26 #include <bsp/lpc24xx.h> 27 27 28 const BSP_START_DATA_SECTIONlpc24xx_emc_static_chip_config28 BSP_START_DATA_SECTION const lpc24xx_emc_static_chip_config 29 29 lpc24xx_start_config_emc_static_chip [] = { 30 #if def LPC24XX_EMC_NUMONYX30 #if defined(LPC24XX_EMC_NUMONYX_M29W160E) 31 31 /* 32 32 * Static Memory 1: Numonyx M29W160EB … … 67 67 } 68 68 } 69 #endif /* LPC24XX_EMC_NUMONYX */ 69 #elif defined(LPC24XX_EMC_SST39VF3201) 70 /* Static Memory 1: SST SST39VF3201 at 51612800Hz (tCK = 19.4ns) */ 71 { 72 .chip_select = (volatile lpc_emc_static *) EMC_STA_BASE_0, 73 .config = { 74 /* 75 * 16 bit, page mode disabled, active LOW chip select, extended wait 76 * disabled, writes not protected, byte lane state LOW/LOW. 77 */ 78 .config = 0x81, 79 80 /* (n + 1) clock cycles -> 19.4ns >= 0ns (tCS, tAS) */ 81 .waitwen = 0, 82 83 /* (n + 1) clock cycles -> 19.4ns >= 0ns (tOES) */ 84 .waitoen = 0, 85 86 /* (n + 1) clock cycles -> 77.5ns >= 70ns (tRC) */ 87 .waitrd = 2, 88 89 /* (n + 1) clock cycles -> 77.5ns >= 70ns (tRC) */ 90 .waitpage = 2, 91 92 /* (n + 2) clock cycles -> 38.8ns >= 20ns (tCHZ, TOHZ) */ 93 .waitwr = 0, 94 95 /* (n + 1) clock cycles -> 38.8ns >= 20ns (tCHZ, TOHZ) */ 96 .waitrun = 1 97 } 98 } 99 #endif 70 100 }; 71 101 72 const BSP_START_DATA_SECTIONsize_t102 BSP_START_DATA_SECTION const size_t 73 103 lpc24xx_start_config_emc_static_chip_count = 74 104 sizeof(lpc24xx_start_config_emc_static_chip) -
c/src/lib/libbsp/arm/lpc24xx/startup/start-config-pinsel.c
r4c622e5 r4a6cc2a 25 25 #include <bsp/start-config.h> 26 26 27 const BSP_START_DATA_SECTION uint32_t lpc24xx_start_config_pinsel_5_9 [] = { 28 #if defined(LPC24XX_EMC_MICRON) \ 29 || defined(LPC24XX_EMC_K4S561632E) \ 30 || defined(LPC24XX_EMC_NUMONYX) 31 0x05010115, 32 0x55555555, 33 0x0, 34 #ifdef LPC24XX_EMC_K4S561632E 35 0x15555555, 36 0x0a040000 37 #else 38 0x55555555, 39 0x40050155 40 #endif 27 BSP_START_DATA_SECTION const lpc24xx_pin_range 28 lpc24xx_start_config_pinsel [] = { 29 #if defined(LPC24XX_EMC_MT48LC4M16A2) \ 30 && defined(LPC24XX_EMC_NUMONYX_M29W160E) 31 LPC24XX_PIN_EMC_A_0_20, 32 LPC24XX_PIN_EMC_D_0_15, 33 LPC24XX_PIN_EMC_RAS, 34 LPC24XX_PIN_EMC_CAS, 35 LPC24XX_PIN_EMC_WE, 36 LPC24XX_PIN_EMC_DYCS_0, 37 LPC24XX_PIN_EMC_CLK_0, 38 LPC24XX_PIN_EMC_CKE_0, 39 LPC24XX_PIN_EMC_DQM_0, 40 LPC24XX_PIN_EMC_DQM_1, 41 LPC24XX_PIN_EMC_OE, 42 LPC24XX_PIN_EMC_CS_1, 41 43 #endif 44 #if defined(LPC24XX_EMC_W9825G2JB75I) \ 45 && defined(LPC24XX_EMC_SST39VF3201) 46 LPC24XX_PIN_EMC_A_0_22, 47 LPC24XX_PIN_EMC_D_0_31, 48 LPC24XX_PIN_EMC_RAS, 49 LPC24XX_PIN_EMC_CAS, 50 LPC24XX_PIN_EMC_WE, 51 LPC24XX_PIN_EMC_DYCS_0, 52 LPC24XX_PIN_EMC_CLK_0, 53 LPC24XX_PIN_EMC_CKE_0, 54 LPC24XX_PIN_EMC_DQM_0, 55 LPC24XX_PIN_EMC_DQM_1, 56 LPC24XX_PIN_EMC_DQM_2, 57 LPC24XX_PIN_EMC_DQM_3, 58 LPC24XX_PIN_EMC_OE, 59 LPC24XX_PIN_EMC_CS_0, 60 #endif 61 #if defined(LPC24XX_EMC_IS42S32800B) 62 LPC24XX_PIN_EMC_A_0_14, 63 LPC24XX_PIN_EMC_D_0_31, 64 LPC24XX_PIN_EMC_RAS, 65 LPC24XX_PIN_EMC_CAS, 66 LPC24XX_PIN_EMC_WE, 67 LPC24XX_PIN_EMC_DYCS_0, 68 LPC24XX_PIN_EMC_CLK_0, 69 LPC24XX_PIN_EMC_CKE_0, 70 LPC24XX_PIN_EMC_DQM_0, 71 LPC24XX_PIN_EMC_DQM_1, 72 LPC24XX_PIN_EMC_DQM_2, 73 LPC24XX_PIN_EMC_DQM_3, 74 #endif 75 LPC24XX_PIN_TERMINAL 42 76 }; 43 44 const BSP_START_DATA_SECTION size_t45 lpc24xx_start_config_pinsel_5_9_size =46 sizeof(lpc24xx_start_config_pinsel_5_9);
Note: See TracChangeset
for help on using the changeset viewer.