X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/a7be12a4e68fcaaa92f81a394bc316a592ec6270..c3d0166a6f09de2bf1a742db4e3811d164080de5:/projectconfig.h diff --git a/projectconfig.h b/projectconfig.h index 1d69e9c..b0bf5be 100644 --- a/projectconfig.h +++ b/projectconfig.h @@ -7,7 +7,7 @@ Software License Agreement (BSD License) - Copyright (c) 2010, microBuilder SARL + Copyright (c) 2012, microBuilder SARL All rights reserved. Redistribution and use in source and binary forms, with or without @@ -110,13 +110,24 @@ microBuilder.eu USB stick 802.15.4 868/915MHz RF transceiver + CFG_BRD_LPC1343_OLIMEX_P + ============================== + + Simple Olimex LPC1343 breakout board + + CFG_BRD_LPC1343_LPCXPRESSO + ============================== + + LPC1343 LPCXpresso board + -----------------------------------------------------------------------*/ - // #define CFG_BRD_LPC1343_REFDESIGN + #define CFG_BRD_LPC1343_REFDESIGN // #define CFG_BRD_LPC1343_REFDESIGN_MINIMAL - #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB + // #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB // #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART // #define CFG_BRD_LPC1343_802154USBSTICK // #define CFG_BRD_LPC1343_OLIMEX_P + // #define CFG_BRD_LPC1343_LPCXPRESSO /*=========================================================================*/ @@ -141,7 +152,7 @@ ST7565 X X X X X X X X X X X X X . . . X ST7735 . . . . X X X X X X . . . . . . . SHARPMEM . . . . X X X X . . . . . . . . . - SSD1306 . . . . X X X . X X . . . . . . . + SSD1306 SPI . . . . X X X . X X . . . . . . . SSD1351 . . . . X X X X X . . . . . . . . MCP121 . . . . . . . . . . . . . . X . . PN532 [3] . . . . . . . . . . . . . . X X . @@ -160,14 +171,14 @@ ST7565 . . . . . X X X X . ST7535 . . . . . . . . . . SHARPMEM . . . . . . . . . . - SSD1306 . . . . . . . . . . + SSD1306 SPI . . . . . . . . . . INTERFACE . . . . . . . . . X[2] [1] PMU uses 32-bit Timer 0 for SW wakeup from deep-sleep. This timer can safely be used by other peripherals, but may need to be reconfigured when you wakeup from deep-sleep. [2] INTERFACE can be configured to use either USBCDC or UART - [3] 3.2 only used when with the I2C bus (for IRQ) + [3] P3.2 is only used with the I2C bus (for IRQ) **************************************************************************/ @@ -184,10 +195,13 @@ ISL12022M (SRAM) 0xAE 1010111x LM75B 0x90 1001000x MCP24AA 0xA0 1010000x - MCP4725 0xC0 1100000x + MCP4725 0xC0 1100000x *** + TEA5767 0xC0 1100000x *** TSL2561 0x72 0111001x TCS3414 0x72 0111001x PN532 0x48 0100100x + SSD1306_I2C 0x78 0111100x // Assumes SA0 = GND + INA219 0xF0 10000000x // Assumes A0+A1 = GND [1] Alternative addresses may exists, but the addresses listed in this table are the values used in the code base @@ -198,9 +212,9 @@ /*========================================================================= FIRMWARE VERSION SETTINGS -----------------------------------------------------------------------*/ - #define CFG_FIRMWARE_VERSION_MAJOR (0) - #define CFG_FIRMWARE_VERSION_MINOR (9) - #define CFG_FIRMWARE_VERSION_REVISION (8) + #define CFG_FIRMWARE_VERSION_MAJOR (1) + #define CFG_FIRMWARE_VERSION_MINOR (1) + #define CFG_FIRMWARE_VERSION_REVISION (0) /*=========================================================================*/ @@ -293,6 +307,13 @@ // #define GPIO_ENABLE_IRQ2 // #define GPIO_ENABLE_IRQ3 #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif /*=========================================================================*/ @@ -358,6 +379,11 @@ #define CFG_UART_BAUDRATE (115200) #define CFG_UART_BUFSIZE (512) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define CFG_UART_BAUDRATE (115200) + #define CFG_UART_BUFSIZE (512) + #endif /*=========================================================================*/ @@ -393,6 +419,11 @@ #define CFG_SSP0_SCKPIN_2_11 // #define CFG_SSP0_SCKPIN_0_6 #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define CFG_SSP0_SCKPIN_2_11 + // #define CFG_SSP0_SCKPIN_0_6 + #endif /*=========================================================================*/ @@ -435,6 +466,11 @@ #define ADC_AVERAGING_ENABLE (0) #define ADC_AVERAGING_SAMPLES (5) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define ADC_AVERAGING_ENABLE (0) + #define ADC_AVERAGING_SAMPLES (5) + #endif /*=========================================================================*/ @@ -482,6 +518,13 @@ #define CFG_LED_ON (0) #define CFG_LED_OFF (1) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define CFG_LED_PORT (0) + #define CFG_LED_PIN (7) + #define CFG_LED_ON (0) + #define CFG_LED_OFF (1) + #endif /*=========================================================================*/ @@ -543,6 +586,13 @@ #define CFG_SDCARD_CDPORT (3) #define CFG_SDCARD_CDPIN (0) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define CFG_SDCARD + #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 + #define CFG_SDCARD_CDPORT (3) + #define CFG_SDCARD_CDPIN (0) + #endif /*=========================================================================*/ @@ -569,7 +619,7 @@ -----------------------------------------------------------------------*/ #define CFG_USB_VID (0x239A) #define CFG_USB_PID (0x1002) - + #ifdef CFG_BRD_LPC1343_REFDESIGN // #define CFG_USBHID #define CFG_USBCDC @@ -617,6 +667,14 @@ #define CFG_USBCDC_INITTIMEOUT (5000) #define CFG_USBCDC_BUFFERSIZE (256) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define CFG_USBHID + #define CFG_USBCDC + #define CFG_USBCDC_BAUDRATE (115200) + #define CFG_USBCDC_INITTIMEOUT (5000) + #define CFG_USBCDC_BUFFERSIZE (256) + #endif /*=========================================================================*/ @@ -624,6 +682,7 @@ PRINTF REDIRECTION ----------------------------------------------------------------------- + CFG_PRINTF_MAXSTRINGSIZE Maximum size of string buffer for printf CFG_PRINTF_UART Will cause all printf statements to be redirected to UART CFG_PRINTF_USBCDC Will cause all printf statements to be @@ -635,40 +694,53 @@ output will be ignored. -----------------------------------------------------------------------*/ #ifdef CFG_BRD_LPC1343_REFDESIGN + #define CFG_PRINTF_MAXSTRINGSIZE (255) // #define CFG_PRINTF_UART #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\r\n" #endif #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL + #define CFG_PRINTF_MAXSTRINGSIZE (255) #define CFG_PRINTF_UART // #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\r\n" #endif #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB + #define CFG_PRINTF_MAXSTRINGSIZE (255) // #define CFG_PRINTF_UART #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\r\n" #endif #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART + #define CFG_PRINTF_MAXSTRINGSIZE (255) #define CFG_PRINTF_UART // #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\n" #endif #ifdef CFG_BRD_LPC1343_802154USBSTICK + #define CFG_PRINTF_MAXSTRINGSIZE (255) // #define CFG_PRINTF_UART #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\r\n" #endif #ifdef CFG_BRD_LPC1343_OLIMEX_P + #define CFG_PRINTF_MAXSTRINGSIZE (255) // #define CFG_PRINTF_UART #define CFG_PRINTF_USBCDC #define CFG_PRINTF_NEWLINE "\r\n" #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define CFG_PRINTF_MAXSTRINGSIZE (255) + // #define CFG_PRINTF_UART + #define CFG_PRINTF_USBCDC + #define CFG_PRINTF_NEWLINE "\r\n" + #endif /*=========================================================================*/ @@ -712,6 +784,13 @@ addition to CFG_INTERFACE_ENABLEIRQ if this is also enabled. The character used is defined below. + CFG_INTERFACE_LONGSYSINFO If this is set to 1 extra information will + be included in the Sys Info ('V') command + on the CLI. This can be useful when trying + to debug problems on remote HW, or with + unknown firmware. It will also use about + 0.5KB flash, though, so only enable it is + necessary. NOTE: The command-line interface will use either USB-CDC or UART depending on whether @@ -729,6 +808,7 @@ #define CFG_INTERFACE_IRQPIN (7) #define CFG_INTERFACE_SHORTERRORS (0) #define CFG_INTERFACE_CONFIRMREADY (0) + #define CFG_INTERFACE_LONGSYSINFO (0) #endif #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL @@ -742,6 +822,7 @@ #define CFG_INTERFACE_IRQPIN (7) #define CFG_INTERFACE_SHORTERRORS (0) #define CFG_INTERFACE_CONFIRMREADY (0) + #define CFG_INTERFACE_LONGSYSINFO (0) #endif #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB @@ -759,6 +840,7 @@ #define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">" #define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<" #define CFG_INTERFACE_CONFIRMREADY_TEXT "." + #define CFG_INTERFACE_LONGSYSINFO (0) #endif #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART @@ -776,6 +858,7 @@ #define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">" #define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<" #define CFG_INTERFACE_CONFIRMREADY_TEXT "." + #define CFG_INTERFACE_LONGSYSINFO (0) #endif #ifdef CFG_BRD_LPC1343_802154USBSTICK @@ -789,6 +872,7 @@ #define CFG_INTERFACE_IRQPIN (7) #define CFG_INTERFACE_SHORTERRORS (0) #define CFG_INTERFACE_CONFIRMREADY (0) + #define CFG_INTERFACE_LONGSYSINFO (0) #endif #ifdef CFG_BRD_LPC1343_OLIMEX_P @@ -802,6 +886,21 @@ #define CFG_INTERFACE_IRQPIN (7) #define CFG_INTERFACE_SHORTERRORS (0) #define CFG_INTERFACE_CONFIRMREADY (0) + #define CFG_INTERFACE_LONGSYSINFO (0) + #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + #define CFG_INTERFACE + #define CFG_INTERFACE_MAXMSGSIZE (256) + #define CFG_INTERFACE_PROMPT "LPC-P1343 >> " + #define CFG_INTERFACE_SILENTMODE (0) + #define CFG_INTERFACE_DROPCR (0) + #define CFG_INTERFACE_ENABLEIRQ (0) + #define CFG_INTERFACE_IRQPORT (0) + #define CFG_INTERFACE_IRQPIN (7) + #define CFG_INTERFACE_SHORTERRORS (0) + #define CFG_INTERFACE_CONFIRMREADY (0) + #define CFG_INTERFACE_LONGSYSINFO (0) #endif /*=========================================================================*/ @@ -878,6 +977,11 @@ // #define CFG_I2CEEPROM #define CFG_I2CEEPROM_SIZE (3072) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define CFG_I2CEEPROM + #define CFG_I2CEEPROM_SIZE (3072) + #endif /*=========================================================================*/ @@ -1017,6 +1121,16 @@ #define CFG_CHIBI_PROMISCUOUS (0) #define CFG_CHIBI_BUFFERSIZE (128) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define CFG_CHIBI + #define CFG_CHIBI_MODE (0) // OQPSK_868MHZ + #define CFG_CHIBI_POWER (0xE9) // CHB_PWR_EU2_3DBM + #define CFG_CHIBI_CHANNEL (0) // 868-868.6 MHz + #define CFG_CHIBI_PANID (0x1234) + #define CFG_CHIBI_PROMISCUOUS (0) + #define CFG_CHIBI_BUFFERSIZE (128) + #endif /*=========================================================================*/ @@ -1036,6 +1150,12 @@ support for larger fonts generated with Dot Factory http://www.pavius.net/downloads/tools/53-the-dot-factory + CFG_TFTLCD_USEAAFONTS If set to a non-zero value, anti-aliased + fonts will be used instead of regular 1-bit + font. These result in much higher- + quality text, but the fonts are 2 or 4 + times larger than plain bitmap fonts and + take a bit more rendering time to display. CFG_TFTLCD_TS_DEFAULTTHRESHOLD Default minimum threshold to trigger a touch event with the touch screen (and exit from 'tsWaitForEvent' in touchscreen.c). @@ -1056,6 +1176,7 @@ #ifdef CFG_BRD_LPC1343_REFDESIGN // #define CFG_TFTLCD #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) #define CFG_TFTLCD_TS_KEYPADDELAY (100) #endif @@ -1063,6 +1184,7 @@ #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL // #define CFG_TFTLCD #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) #define CFG_TFTLCD_TS_KEYPADDELAY (100) #endif @@ -1070,6 +1192,7 @@ #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART #define CFG_TFTLCD #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) #define CFG_TFTLCD_TS_KEYPADDELAY (100) #endif @@ -1077,6 +1200,7 @@ #ifdef CFG_BRD_LPC1343_802154USBSTICK // #define CFG_TFTLCD #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) #define CFG_TFTLCD_TS_KEYPADDELAY (100) #endif @@ -1084,9 +1208,18 @@ #ifdef CFG_BRD_LPC1343_OLIMEX_P // #define CFG_TFTLCD #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) #define CFG_TFTLCD_TS_KEYPADDELAY (100) #endif + + #ifdef CFG_BRD_LPC1343_LPCXPRESSO + // #define CFG_TFTLCD + #define CFG_TFTLCD_INCLUDESMALLFONTS (0) + #define CFG_TFTLCD_USEAAFONTS (0) + #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50) + #define CFG_TFTLCD_TS_KEYPADDELAY (100) + #endif /*=========================================================================*/ @@ -1098,12 +1231,13 @@ the 128x64 pixel ST7565 LCD to be included CFG_SSD1306 If defined, this will cause drivers for the 128x64 pixel SSD1306 OLED display to be - included + included (using bit-banged SPI) CFG_SHARPMEM If defined, this will cause drivers for Sharp Memory Displays to be included DEPENDENCIES: ST7565 requires the use of pins 2.1-6. DEPENDENCIES: SSD1306 requires the use of pins 2.1-6. + DEPENDENCIES: SSD1306_I2C requires the use of pins 2.2. DEPENDENCIES: SHARPMEM requires the use of pins 2.1-4. -----------------------------------------------------------------------*/ // #define CFG_ST7565 @@ -1149,8 +1283,9 @@ !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB && \ !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART && \ !defined CFG_BRD_LPC1343_802154USBSTICK && \ - !defined CFG_BRD_LPC1343_OLIMEX_P - #error "You must defined a target board (CFG_BRD_LPC1343_REFDESIGN or CFG_BRD_LPC1343_REFDESIGN_MINIMAL or CFG_BRD_LPC1343_TFTLCDSTANDALONE or CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART or CFG_BRD_LPC1343_802154USBSTICK)" + !defined CFG_BRD_LPC1343_OLIMEX_P && \ + !defined CFG_BRD_LPC1343_LPCXPRESSO + #error "You must defined a target board (CFG_BRD_LPC1343_REFDESIGN or CFG_BRD_LPC1343_REFDESIGN_MINIMAL or CFG_BRD_LPC1343_TFTLCDSTANDALONE or CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART or CFG_BRD_LPC1343_802154USBSTICK or CFG_BRD_LPC1343_LPCXPRESSO)" #endif #if defined CFG_PRINTF_USBCDC && defined CFG_PRINTF_UART