board_reform2.h (31269B)
1 /**************************************************************************/ 2 /*! 3 @file board_lpcxpresso1347.h 4 @author K. Townsend (microBuilder.eu) 5 6 @brief Board file for the LPC1347 LPCXpresso board from NXP 7 @ingroup Boards 8 9 @section LICENSE 10 11 Software License Agreement (BSD License) 12 13 Copyright (c) 2012 K. Townsend 14 All rights reserved. 15 16 Redistribution and use in source and binary forms, with or without 17 modification, are permitted provided that the following conditions are met: 18 1. Redistributions of source code must retain the above copyright 19 notice, this list of conditions and the following disclaimer. 20 2. Redistributions in binary form must reproduce the above copyright 21 notice, this list of conditions and the following disclaimer in the 22 documentation and/or other materials provided with the distribution. 23 3. Neither the name of the copyright holders nor the 24 names of its contributors may be used to endorse or promote products 25 derived from this software without specific prior written permission. 26 27 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 */ 38 /**************************************************************************/ 39 #ifndef __BOARD_REFORM2_H__ 40 #define __BOARD_REFORM2_H__ 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 #include "sysdefs.h" 47 48 /*========================================================================= 49 MCU SELECTION 50 51 Include one of the following definitions depending on if you are 52 using the LPC11U37 or LPC1347. They're generally interchangeable, but 53 the LPC11Uxx and LPC13xx CMSIS implementations have some differences 54 in naming convention, and occasionally a feature is only available on 55 the M3 (DWT for example). Selecting the appropriate MCU allows 56 the right code to be included when differences between the CMSIS 57 implementations are present. 58 59 -----------------------------------------------------------------------*/ 60 #define CFG_MCU_LPC11U24FBD48_401 61 // #define CFG_MCU_LPC11U37FBD48_401 62 // #define CFG_MCU_LPC1347FBD48 63 // #define CFG_MCU_LPC1347FHN33 64 65 /* Basic error checking */ 66 #if !defined CFG_MCU_LPC1347FBD48 && \ 67 !defined CFG_MCU_LPC11U37FBD48_401 && \ 68 !defined CFG_MCU_LPC11U24FBD48_401 && \ 69 !defined CFG_MCU_LPC1347FHN33 70 #error "An MCU must be selected in projectconfig.h (Ex. CFG_MCU_LPC11U37FBD48_401, CFG_MCU_LPC1347FBD48, etc.)" 71 #endif 72 73 /* Set flag to indicate which CMSIS library to use */ 74 #if (defined CFG_MCU_LPC1347FBD48 || defined CFG_MCU_LPC1347FHN33) 75 #define CFG_MCU_FAMILY_LPC13UXX 76 #elif (defined CFG_MCU_LPC11U24FBD48_401 || defined CFG_MCU_LPC11U37FBD48_401) 77 #define CFG_MCU_FAMILY_LPC11UXX 78 #endif 79 80 /* Include the correct MCU header file */ 81 #if defined CFG_MCU_FAMILY_LPC13UXX 82 #include "LPC13Uxx.h" 83 #endif 84 #if defined CFG_MCU_FAMILY_LPC11UXX 85 #include "LPC11Uxx.h" 86 #endif 87 /*=========================================================================*/ 88 89 90 /*========================================================================= 91 FIRMWARE VERSION SETTINGS 92 -----------------------------------------------------------------------*/ 93 #define CFG_FIRMWARE_VERSION_MAJOR (0) 94 #define CFG_FIRMWARE_VERSION_MINOR (0) 95 #define CFG_FIRMWARE_VERSION_REVISION (0) 96 /*=========================================================================*/ 97 98 99 /*========================================================================= 100 PIN USAGE 101 ----------------------------------------------------------------------- 102 This table tries to give an indication of which GPIO pins and 103 peripherals are used by the available drivers and SW examples. Only 104 dedicated GPIO pins available on the LPC1347 Reference Board are shown 105 below. Any unused peripheral blocks like I2C, SSP, ADC, etc., can 106 also be used as GPIO if they are available. 107 108 PORT 0 109 ========================================================= 110 0 1 2 3 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 111 112 HX8340B . . . . . . . . . . . . . . . . . . . . . . 113 HX8347G . . . . . . . . . . . . . . . . . . . . . . 114 CHIBI . . . . . . . . . . . . . . . . . . . . . . 115 SSD1306 I2C . . . . . . . . . . . . . . . . . . . . . . 116 FAT32/MMC . . . . . . . . . . . . . . . . . . . X . . 117 PN532 I2C . . . . . . . . . . . . . . X X . . . . . . 118 PCF2129A . . . . . . . . . . . . . . X X . . . . . . 119 120 PORT 1 121 =========================================================================== 122 0 1 2 3 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 123 + + + + + + + + + + + + - 124 125 HX8340B . . . . . . . . . . . . . . . . . . . . . . X X X X X . 126 HX8347G . . . . . . . . . . X X X X . . X X X X X X X X X X . . 127 CHIBI . . . . . . . . . . X X X . . . . . . . . . . . . . . . 128 SSD1306 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 FAT32/MMC . . . . . . . . . . . . . . . . . . . . X X . . . . . . 130 PN532 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 PCF2129A . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 133 TIMERS SSP ADC UART 134 ====================== === =============== ==== 135 16B0 16B1 32B0 32B1 0 1 0 1 2 3 4 5 6 7 0 136 137 HX8340B . . . . . . . . . . . . . . . 138 HX8347G . . . . . . . . . . . . . . . 139 CHIBI . . . . X . . . . . . . . . . 140 SSD1306 I2C . . . . . . . . . . . . . . . 141 FAT32/MMC . . . . . X . . . . . . . . . 142 143 [+] Only available on QFP64 package 144 [-] Only available on QFP48 package 145 146 =========================================================================*/ 147 148 149 /*========================================================================= 150 GPIO INTERRUPTS 151 ----------------------------------------------------------------------- 152 This table shows where GPIO interrupts are mapped in this project 153 (Note that the LPC11U and LPC13U use different names for the 154 IRQ Handlers in the standard headers) 155 156 Interrupt Location 157 ------------------------------------------ ------------------------- 158 PIN_INT0_IRQHandler - FLEX_INT0_IRQHandler chb_drvr.c 159 PIN_INT1_IRQHandler - FLEX_INT1_IRQHandler pcf2129.c 160 PIN_INT2_IRQHandler - FLEX_INT2_IRQHandler spi.c (cc3000) 161 PIN_INT3_IRQHandler - FLEX_INT3_IRQHandler 162 PIN_INT4_IRQHandler - FLEX_INT4_IRQHandler 163 PIN_INT5_IRQHandler - FLEX_INT5_IRQHandler 164 PIN_INT6_IRQHandler - FLEX_INT6_IRQHandler 165 PIN_INT7_IRQHandler - FLEX_INT7_IRQHandler 166 GINT0_IRQHandler 167 GINT0_IRQHandler 168 -----------------------------------------------------------------------*/ 169 /*=========================================================================*/ 170 171 172 /*========================================================================= 173 SUPPORTED PERIPHERALS 174 ----------------------------------------------------------------------- 175 Because all ISRs are referenced in the startup code, GCC typically 176 won't optimise out the ISR functions during compilation even if the 177 ISRs will never be entered, resulting in larger binaries than required 178 (for example if no I2C sensors are used, be sure to disable I2C support 179 since the I2C ISR is quite large). 180 181 Use the defines below to include or exclude support for specific 182 peripherals. 183 184 NOTE: GPIO ISRs are handled separately in GPIO INTERRUPTS below 185 -----------------------------------------------------------------------*/ 186 #define CFG_ENABLE_I2C 187 #define CFG_ENABLE_UART 188 //#define CFG_ENABLE_USB 189 #define CFG_ENABLE_TIMER32 190 /*=========================================================================*/ 191 192 /*========================================================================= 193 EEPROM 194 ----------------------------------------------------------------------- 195 EEPROM is used to persist certain user modifiable values to make 196 sure that these changes remain in effect after a reset or hard 197 power-down. The addresses in EEPROM for these various system 198 settings/values are defined below. The first 256 bytes of EEPROM 199 are reserved for this (0x0000..0x00FF). 200 201 CFG_EEPROM_SIZE The number of bytes available on the EEPROM 202 CFG_EEPROM_RESERVED The last byte of reserved EEPROM memory 203 204 EEPROM Address (0x0000..0x00FF) 205 =============================== 206 0 1 2 3 4 5 6 7 8 9 A B C D E F 207 000x x x . . x x x x x x x x . . . . Chibi 208 001x . . . . . . . . . . . . . . . . 209 002x . . . . . . . . . . . . . . . . 210 003x . . . . . . . . . . . . . . . . 211 004x . . . . . . . . . . . . . . . . 212 005x . . . . . . . . . . . . . . . . 213 006x . . . . . . . . . . . . . . . . 214 007x . . . . . . . . . . . . . . . . 215 008x . . . . . . . . . . . . . . . . 216 009x . . . . . . . . . . . . . . . . 217 00Ax . . . . . . . . . . . . . . . . 218 00Bx . . . . . . . . . . . . . . . . 219 00Cx . . . . . . . . . . . . . . . . 220 00Dx . . . . . . . . . . . . . . . . 221 00Ex . . . . . . . . . . . . . . . . 222 00Fx . . . . . . . . . . . . . . . . 223 224 -----------------------------------------------------------------------*/ 225 #define CFG_EEPROM_SIZE (4032) 226 #define CFG_EEPROM_RESERVED (0x00FF) // Protect first 256 bytes of memory 227 #define CFG_EEPROM_CHIBI_NODEADDR (uint16_t)(0x0000) // 2 228 #define CFG_EEPROM_CHIBI_IEEEADDR (uint16_t)(0x0004) // 8 229 /*=========================================================================*/ 230 231 232 /*========================================================================= 233 ON-BOARD LED 234 ----------------------------------------------------------------------- 235 236 CFG_LED_PORT The port for the on board LED 237 CFG_LED_PIN The pin for the on board LED 238 CFG_LED_ON The pin state to turn the LED on (0 = low, 1 = high) 239 CFG_LED_OFF The pin state to turn the LED off (0 = low, 1 = high) 240 241 -----------------------------------------------------------------------*/ 242 #define CFG_LED_PORT (0) 243 #define CFG_LED_PIN (7) 244 #define CFG_LED_ON (1) 245 #define CFG_LED_OFF (0) 246 /*=========================================================================*/ 247 248 249 /*========================================================================= 250 ADC 251 ----------------------------------------------------------------------- 252 253 CFG_ADC_MODE_LOWPOWER If set to 1, this will configure the ADC 254 for low-power operation (LPC1347 only) 255 CFG_ADC_MODE_10BIT If set to 1, this will configure the ADC 256 for 10-bit mode (LPC1347 only) 257 258 -----------------------------------------------------------------------*/ 259 #define CFG_ADC_MODE_LOWPOWER (0) 260 #define CFG_ADC_MODE_10BIT (0) 261 /*=========================================================================*/ 262 263 264 /*========================================================================= 265 UART 266 ----------------------------------------------------------------------- 267 268 CFG_UART_BAUDRATE The default UART speed. This value is used 269 when initialising UART, and should be a 270 standard value like 57600, 9600, etc. 271 NOTE: This value may be overridden if 272 another value is stored in EEPROM! 273 CFG_UART_BUFSIZE The length in bytes of the UART RX FIFO. This 274 will determine the maximum number of received 275 characters to store in memory. 276 277 -----------------------------------------------------------------------*/ 278 #define CFG_UART_BAUDRATE (57600) 279 #define CFG_UART_BUFSIZE (256) 280 /*=========================================================================*/ 281 282 283 /*========================================================================= 284 SPI 285 ----------------------------------------------------------------------- 286 287 CFG_SSP_SCK0_LOCATION The location of the SCK pin for SSP0 288 CFG_SSP_MISO1_LOCATION The location of the MISO1 pin for SSP1 289 CFG_SSP_MOSI1_LOCATION The location of the MOSI1 pin for SSP1 290 CFG_SSP_SCK1_LOCATION The location of the SCK pin for SSP1 291 292 -----------------------------------------------------------------------*/ 293 #define CFG_SSP_SCK0_0_6 (6) // Used by USBConnect 294 #define CFG_SSP_SCK0_0_10 (10) // Used by SWD 295 #define CFG_SSP_SCK0_1_29 (29) 296 297 #define CFG_SSP_MISO1_0_22 (22) 298 #define CFG_SSP_MISO1_1_21 (21) 299 #define CFG_SSP_MOSI1_0_21 (21) 300 #define CFG_SSP_MOSI1_1_22 (22) 301 #define CFG_SSP_SCK1_1_15 (15) 302 #define CFG_SSP_SCK1_1_20 (20) 303 304 // Select the appropriate pin locations here 305 #define CFG_SSP_SCK0_LOCATION (CFG_SSP_SCK0_0_10) 306 #define CFG_SSP_MISO1_LOCATION (CFG_SSP_MISO1_1_21) 307 #define CFG_SSP_MOSI1_LOCATION (CFG_SSP_MOSI1_1_22) 308 #define CFG_SSP_SCK1_LOCATION (CFG_SSP_SCK1_1_20) 309 310 // Set the phase and polarity for SSP0 and SSP1 311 #define CFG_SSP_CPOL0 (0) 312 #define CFG_SSP_CPHA0 (1) 313 #define CFG_SSP_CPOL1 (1) 314 #define CFG_SSP_CPHA1 (1) 315 /*=========================================================================*/ 316 317 318 /*========================================================================= 319 PRINTF REDIRECTION 320 ----------------------------------------------------------------------- 321 322 CFG_PRINTF_MAXSTRINGSIZE Maximum size of string buffer for printf 323 CFG_PRINTF_UART Will cause all printf statements to be 324 redirected to UART 325 CFG_PRINTF_USBCDC Will cause all printf statements to be 326 redirect to USB Serial 327 CFG_PRINTF_NEWLINE This is typically "\r\n" for Windows or 328 "\n" for *nix 329 330 Note: If no printf redirection definitions are present, all printf 331 output will be ignored. 332 -----------------------------------------------------------------------*/ 333 #define CFG_PRINTF_MAXSTRINGSIZE (255) 334 335 #define CFG_PRINTF_UART 336 //#define CFG_PRINTF_USBCDC 337 // #define CFG_PRINTF_DEBUG 338 339 #define CFG_PRINTF_NEWLINE "\n" 340 341 /*=========================================================================*/ 342 343 344 /*========================================================================= 345 SIMPLE BINARY PROTOCOL 346 ----------------------------------------------------------------------- 347 348 CFG_PROTOCOL If this field is defined the binary command 349 parser will be included 350 -----------------------------------------------------------------------*/ 351 //#define CFG_PROTOCOL 352 353 //#define CFG_PROTOCOL_VIA_HID 354 // #define CFG_PROTOCOL_VIA_BULK 355 356 #if defined(CFG_PROTOCOL) && !defined(CFG_PROTOCOL_VIA_HID) && !defined(CFG_PROTOCOL_VIA_BULK) 357 #error CFG_PROTOCOL must be enabled with either CFG_PROTOCOL_VIA_HID or CFG_PROTOCOL_VIA_BULK 358 #endif 359 /*=========================================================================*/ 360 361 362 /*========================================================================= 363 TFT LCD 364 ----------------------------------------------------------------------- 365 366 CFG_TFTLCD If defined, this will cause drivers for 367 a pre-determined LCD screen to be included 368 during build. Only one LCD driver can be 369 included during the build process (for ex. 370 'drivers/displays/hw/ILI9325.c') 371 CFG_TFTLCD_INCLUDESMALLFONTS If set to 1, smallfont support will be 372 included for 3x6, 5x8, 7x8 and 8x8 fonts. 373 This should only be enabled if these small 374 fonts are required since there is already 375 support for larger fonts generated with 376 Dot Factory 377 http://www.pavius.net/downloads/tools/53-the-dot-factory 378 CFG_TFTLCD_USEAAFONTS If set to a non-zero value, anti-aliased 379 fonts will be used instead of regular 1-bit 380 font. These result in much higher- 381 quality text, but the fonts are 2 or 4 382 times larger than plain bitmap fonts and 383 take a bit more rendering time to display. 384 CFG_TFTLCD_TS_DEFAULTTHRESHOLD Default minimum threshold to trigger a 385 touch event with the touch screen (and exit 386 from 'tsWaitForEvent' in touchscreen.c). 387 Should be an 8-bit value somewhere between 388 8 and 75 in normal circumstances. This is 389 the default value and may be overriden by 390 a value stored in EEPROM. 391 CFG_TFTLCD_TS_KEYPADDELAY The delay in milliseconds between key 392 presses in dialogue boxes 393 ----------------------------------------------------------------------*/ 394 // #define CFG_TFTLCD 395 #define CFG_TFTLCD_INCLUDESMALLFONTS (1) 396 #define CFG_TFTLCD_USEAAFONTS (0) 397 #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) 398 #define CFG_TFTLCD_TS_KEYPADDELAY (100) 399 /*=========================================================================*/ 400 401 402 /*========================================================================= 403 MICRO-SD CARD 404 ----------------------------------------------------------------------- 405 406 CFG_SDCARD If this field is defined SD Card and FAT32 407 file system support will be included 408 CFG_SDCARD_SPIPORT SSP Port used for the SD card (0 or 1) 409 CFG_SDCARD_READONLY If this is set to 1, all commands to 410 write to the SD card will be removed 411 saving some flash space. 412 CFG_SDCARD_CDPORT The card detect port number 413 CFG_SDCARD_CDPIN The card detect pin number 414 415 NOTE: All config settings for FAT32 are defined 416 in ffconf.h 417 -----------------------------------------------------------------------*/ 418 // #define CFG_SDCARD 419 #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 420 #define CFG_SDCARD_SPIPORT (0) 421 #define CFG_SDCARD_SSELPORT (0) 422 #define CFG_SDCARD_SSELPIN (0) 423 #define CFG_SDCARD_CDPORT (0) 424 #define CFG_SDCARD_CDPIN (0) 425 #define CFG_SDCARD_ENBLPORT (0) 426 #define CFG_SDCARD_ENBLPIN (0) 427 428 #ifdef CFG_SDCARD 429 #if !((CFG_SDCARD_READONLY == 0) || (CFG_SDCARD_READONLY == 1)) 430 #error "Invalid value for CFG_SDCARD_READONLY" 431 #endif 432 #if !((CFG_SDCARD_SPIPORT == 0) || (CFG_SDCARD_SPIPORT == 1)) 433 #error "Invalid SPI port for CFG_SDCARD_SPIPORT" 434 #endif 435 #endif 436 /*=========================================================================*/ 437 438 439 /*========================================================================= 440 CHIBI WIRELESS STACK 441 ----------------------------------------------------------------------- 442 443 CFG_CHIBI If defined, the CHIBI wireless stack will be 444 included during build. Requires external HW. 445 CFG_CHIBI_MODE The mode to use when receiving and transmitting 446 wireless data. See chb_drvr.h for possible values 447 CFG_CHIBI_POWER The power level to use when transmitting. See 448 chb_drvr.h for possible values 449 CFG_CHIBI_CHANNEL 802.15.4 Channel (0 = 868MHz, 1-10 = 915MHz) 450 CFG_CHIBI_PANID 16-bit PAN Identifier (ex.0x1234) 451 CFG_CHIBI_PROMISCUOUS Set to 1 to enabled promiscuous mode or 452 0 to disable it. If promiscuous mode is 453 enabled be sure to set CFG_CHIBI_BUFFERSIZE 454 to an appropriately large value (ex. 1024) 455 CFG_CHIBI_BUFFERSIZE The size of the message buffer in bytes 456 -----------------------------------------------------------------------*/ 457 // #define CFG_CHIBI 458 #define CFG_CHIBI_MODE (0) // OQPSK_868MHZ 459 #define CFG_CHIBI_POWER (0xE9) // CHB_PWR_EU2_3DBM 460 #define CFG_CHIBI_CHANNEL (0) // 868-868.6 MHz 461 #define CFG_CHIBI_PANID (0x1234) 462 #define CFG_CHIBI_PROMISCUOUS (0) 463 #define CFG_CHIBI_BUFFERSIZE (256) 464 465 // Pin config settings 466 #define CFG_CHIBI_SPIPORT (0) // Must be 0 or 1 467 #define CFG_CHIBI_SSPORT (0) 468 #define CFG_CHIBI_SSPIN (0) 469 #define CFG_CHIBI_EINTPORT (0) 470 #define CFG_CHIBI_EINTPIN (0) 471 #define CFG_CHIBI_RSTPORT (0) 472 #define CFG_CHIBI_RSTPIN (0) 473 #define CFG_CHIBI_SLPTRPORT (0) 474 #define CFG_CHIBI_SLPTRPIN (0) 475 #define CFG_CHIBI_CC1190_HGM_PORT (0) // Not used 476 #define CFG_CHIBI_CC1190_HGM_PIN (0) // Not used 477 478 #ifdef CFG_CHIBI 479 #if !((CFG_CHIBI_SPIPORT == 0) || (CFG_CHIBI_SPIPORT == 1)) 480 #error "Invalid SPI port for CFG_CHIBI_SPIPORT" 481 #endif 482 #endif 483 /*=========================================================================*/ 484 485 486 /*========================================================================= 487 CC3000 WIFI MODULES 488 ----------------------------------------------------------------------- 489 490 CFG_CC3000 If defined, CC3000 support will be 491 included during build. Requires 492 external HW 493 -----------------------------------------------------------------------*/ 494 // #define CFG_CC3000 495 #define CFG_CC3000_SPI_PORT (0) 496 #define CFG_CC3000_EN_PORT (0) 497 #define CFG_CC3000_EN_PIN (14) 498 #define CFG_CC3000_IRQ_PORT (0) 499 #define CFG_CC3000_IRQ_PIN (16) 500 #define CFG_CC3000_CS_PORT (0) 501 #define CFG_CC3000_CS_PIN (17) 502 /*=========================================================================*/ 503 504 505 /*========================================================================= 506 PN532/NFC STACK 507 ----------------------------------------------------------------------- 508 509 CFG_PN532 If defined, the PN532/NFC stack will be 510 included during build. Requires 511 external HW 512 CFG_PN532_MEM_POOL_SIZE_BYTES Size of the dynamic memory pool in bytes 513 (used by pn532/mem_allocator/ when 514 working with NDEF messages) 515 -----------------------------------------------------------------------*/ 516 // #define CFG_PN532 517 #define CFG_PN532_RSTPD_PORT (0) 518 #define CFG_PN532_RSTPD_PIN (16) 519 #define CFG_PN532_I2C_IRQPORT (0) 520 #define CFG_PN532_I2C_IRQPIN (17) 521 #define CFG_PN532_MEM_POOL_SIZE_BYTES (512) 522 /*=========================================================================*/ 523 524 525 /*========================================================================= 526 RTC SUPPORT 527 ----------------------------------------------------------------------- 528 529 CFG_RTC If defined, RTC support will be included. 530 Requires external HW. 531 -----------------------------------------------------------------------*/ 532 // #define CFG_RTC 533 534 #if defined(CFG_RTC) && !defined(CFG_ENABLE_I2C) 535 #error "CFG_ENABLE_I2C must be defined with CFG_RTC" 536 #endif 537 /*=========================================================================*/ 538 539 540 /*========================================================================= 541 STEPPER MOTOR SUPPORT 542 ----------------------------------------------------------------------- 543 544 CFG_STEPPER If defined, basic stepper motor support 545 will be included. Requires external HW. 546 -----------------------------------------------------------------------*/ 547 // #define CFG_STEPPER 548 #define CFG_STEPPER_TIMER32 (0) 549 #define CFG_STEPPER_IN1_PORT (0) 550 #define CFG_STEPPER_IN1_PIN (8) 551 #define CFG_STEPPER_IN2_PORT (0) 552 #define CFG_STEPPER_IN2_PIN (9) 553 #define CFG_STEPPER_IN3_PORT (0) 554 #define CFG_STEPPER_IN3_PIN (14) 555 #define CFG_STEPPER_IN4_PORT (0) 556 #define CFG_STEPPER_IN4_PIN (13) 557 /*=========================================================================*/ 558 559 560 /*========================================================================= 561 USB 562 563 CFG_USB_STRING_MANUFACTURER Manufacturer name that will appear in the 564 device descriptor during USB enumeration 565 CFG_USB_STRING_PRODUCT Product name that will appear in the 566 device descriptor during USB enumeration 567 CFG_USB_VENDORID 16-bit USB vendor ID 568 USB_PRODUCT_ID Define this to set a custom product ID 569 if you do not wish to use the 'auto' 570 product ID feature 571 CFG_CDC Enable USB CDC support 572 CFG_USB_HID_KEYBOARD Enable USB HID keyboard emulation 573 CFG_USB_HID_MOUSE Enable USB HID mouse emulation for a five 574 button 'Windows' mouse with scroll wheels 575 CFG_USB_HID_GENERIC Enable USB HID Generic support for custom 576 in and out reports, with report size set 577 via CFG_USB_HID_GENERIC_REPORT_SIZE 578 CFG_USB_MSC Enable USB Mass Storage support, pointing 579 to the SD card reader (requires mmc.c from 580 the FATFS drivers, but doesn't use FATFS) 581 582 583 You can combine more than one USB class below and they will be 584 automatically combined in a USB composite device within the limit of 585 available USB endpoints. The USB Product ID is calculated automatically 586 based on the combination of classes defined below. 587 588 NOTE: Windows requires the .inf file in '/core/usb' for CDC support 589 -----------------------------------------------------------------------*/ 590 #ifdef CFG_ENABLE_USB 591 #define CFG_USB_STRING_MANUFACTURER "microBuilder.eu" 592 #define CFG_USB_STRING_PRODUCT "LPC1347 LPCXpresso" 593 #define CFG_USB_VENDORID (0x1FC9) 594 595 #define CFG_USB_CDC 596 597 // #define CFG_USB_HID_KEYBOARD 598 // #define CFG_USB_HID_MOUSE 599 #define CFG_USB_HID_GENERIC 600 #define CFG_USB_HID_GENERIC_REPORT_SIZE (64) 601 602 // #define CFG_USB_MSC 603 604 // #define CFG_USB_CUSTOM_CLASS 605 606 #if (defined(CFG_USB_CDC) || defined(CFG_USB_HID_KEYBOARD) || \ 607 defined(CFG_USB_HID_MOUSE) || defined(CFG_USB_HID_GENERIC) || \ 608 defined(CFG_USB_MSC) || defined(CFG_USB_CUSTOM_CLASS)) 609 #define CFG_USB 610 #if defined(CFG_USB_HID_KEYBOARD) || defined(CFG_USB_HID_MOUSE) || defined(CFG_USB_HID_GENERIC) 611 #define CFG_USB_HID 612 #if defined(CFG_USB_HID_GENERIC) && (CFG_USB_HID_GENERIC_REPORT_SIZE > 64) 613 #error "CFG_USB_HID_GENERIC_REPORT_SIZE exceeds the maximum value of 64 bytes (based on USB specs 2.0 for 'Full Speed Interrupt Endpoint Size')" 614 #endif 615 #endif 616 #endif 617 #endif 618 /*=========================================================================*/ 619 620 621 /*========================================================================= 622 CONFIG FILE VALIDATION 623 624 Basic error checking to make sure that incompatible defines are not 625 enabled at the same time, etc. 626 627 -----------------------------------------------------------------------*/ 628 #if defined(CFG_INTERFACE) && !( defined CFG_PRINTF_UART || defined CFG_PRINTF_USBCDC || defined CFG_PRINTF_DEBUG) 629 #error "At least one CFG_PRINTF target must be defined with CFG_INTERFACE" 630 #endif 631 632 #if defined(CFG_PRINTF_UART) && !defined(CFG_ENABLE_UART) 633 #error "CFG_ENABLE_UART must be enabled with CFG_PRINTF_UART" 634 #endif 635 636 #if defined(CFG_PRINTF_USBCDC) && !defined(CFG_USB_CDC) 637 #error "CFG_USB_CDC must be defined with CFG_PRINTF_USBCDC" 638 #endif 639 640 #if defined(CFG_USB_MSC) && !defined(CFG_SDCARD) 641 #error "CFG_USB_MSC must be defined with CFG_SDCARD" 642 #endif 643 644 #if defined(CFG_PROTOCOL) 645 #if defined(CFG_PROTOCOL_VIA_HID) && !defined(CFG_USB_HID_GENERIC) 646 #error "CFG_PROTOCOL_VIA_HID requires CFG_USB_HID_GENERIC" 647 #endif 648 649 #if defined(CFG_PROTOCOL_VIA_BULK) && !defined(CFG_USB_CUSTOM_CLASS) 650 #error "CFG_PROTOCOL_VIA_BULK requires CFG_USB_CUSTOM_CLASS to be defined" 651 #endif 652 #endif 653 /*=========================================================================*/ 654 655 #ifdef __cplusplus 656 } 657 #endif 658 659 #endif