X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9835768ca5fecdb70c96b5576563c19754f5260a..751c29384cf680128ae7a3194f42a1b9d7ea4937:/projectconfig.h?ds=sidebyside diff --git a/projectconfig.h b/projectconfig.h index 2eb55c0..5b6c7ad 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 @@ -187,6 +187,7 @@ MCP4725 0xC0 1100000x TSL2561 0x72 0111001x TCS3414 0x72 0111001x + PN532 0x48 0100100x [1] Alternative addresses may exists, but the addresses listed in this table are the values used in the code base @@ -197,9 +198,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 (0) + #define CFG_FIRMWARE_VERSION_REVISION (0) /*=========================================================================*/ @@ -229,6 +230,72 @@ /*=========================================================================*/ +/*========================================================================= + GPIO INTERRUPTS + ----------------------------------------------------------------------- + + IF you wish to use the GPIO interrupt handlers elsewhere in your code, + you should probably define a seperate IRQHandler for the appropriate + GPIO bank rather than using the definitions in core/gpio/gpio.c (to + avoid causing problems in other projects, and to make updates easier, + etc.) To disable the default IRQHandler, simply comment out the + define below for the appropriate GPIO bank and implement the handler + somewhere else. + + GPIO_ENABLE_IRQ0 If defined, PIOINT0_IRQHandler will be declared and + handled in core/gpio/gpio.c + GPIO_ENABLE_IRQ1 If defined, PIOINT1_IRQHandler will be declared and + handled in core/gpio/gpio.c + GPIO_ENABLE_IRQ2 If defined, PIOINT2_IRQHandler will be declared and + handled in core/gpio/gpio.c + GPIO_ENABLE_IRQ3 If defined, PIOINT3_IRQHandler will be declared and + handled in core/gpio/gpio.c + + -----------------------------------------------------------------------*/ + #ifdef CFG_BRD_LPC1343_REFDESIGN + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif + + #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif + + #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif + + #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif + + #ifdef CFG_BRD_LPC1343_802154USBSTICK + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif + + #ifdef CFG_BRD_LPC1343_OLIMEX_P + // #define GPIO_ENABLE_IRQ0 + #define GPIO_ENABLE_IRQ1 + // #define GPIO_ENABLE_IRQ2 + // #define GPIO_ENABLE_IRQ3 + #endif +/*=========================================================================*/ + + /*========================================================================= ALTERNATE RESET PIN ----------------------------------------------------------------------- @@ -329,6 +396,48 @@ /*=========================================================================*/ +/*========================================================================= + ADC + ----------------------------------------------------------------------- + + ADC_AVERAGING_ENABLE To get better results, the ADC code can take + a number of samples and return the average + value. This is slower, but can give more + accurate results compared to single-reading. + + To enable averaging, set ADC_AVERAGING_ENABLE + to a non-zero value. + ADC_AVERAGING_SAMPLES The number of ADC samples to read and + average if ADC averaging is enabled. + + -----------------------------------------------------------------------*/ + #ifdef CFG_BRD_LPC1343_REFDESIGN + #define ADC_AVERAGING_ENABLE (1) + #define ADC_AVERAGING_SAMPLES (5) + #endif + + #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL + #define ADC_AVERAGING_ENABLE (1) + #define ADC_AVERAGING_SAMPLES (5) + #endif + + #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART + #define ADC_AVERAGING_ENABLE (0) + #define ADC_AVERAGING_SAMPLES (5) + #endif + + #ifdef CFG_BRD_LPC1343_802154USBSTICK + #define ADC_AVERAGING_ENABLE (0) + #define ADC_AVERAGING_SAMPLES (5) + #endif + + #ifdef CFG_BRD_LPC1343_OLIMEX_P + #define ADC_AVERAGING_ENABLE (0) + #define ADC_AVERAGING_SAMPLES (5) + #endif +/*=========================================================================*/ + + /*========================================================================= ON-BOARD LED ----------------------------------------------------------------------- @@ -515,6 +624,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 @@ -526,36 +636,42 @@ 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" @@ -919,7 +1035,7 @@ a pre-determined LCD screen to be included during build. Only one LCD driver can be included during the build process (for ex. - 'drivers/lcd/hw/ILI9325.c') + 'drivers/displays/hw/ILI9325.c') CFG_TFTLCD_INCLUDESMALLFONTS If set to 1, smallfont support will be included for 3x6, 5x8, 7x8 and 8x8 fonts. This should only be enabled if these small @@ -1089,6 +1205,9 @@ #if CFG_CHIBI_PROMISCUOUS != 0 && CFG_CHIBI_PROMISCUOUS != 1 #error "CFG_CHIBI_PROMISCUOUS must be equal to either 1 or 0" #endif + #if !defined GPIO_ENABLE_IRQ1 + #error "GPIO_ENABLE_IRQ1 must be enabled when using Chibi (Chibi IRQ is on GPIO1.8)" + #endif #endif #ifdef CFG_TFTLCD @@ -1127,4 +1246,8 @@ #endif #endif +#if ADC_AVERAGING_ENABLE && ADC_AVERAGING_SAMPLES < 1 + #error "ADC_AVERAGING_SAMPLES must be 1 or higher when ADC averaging is enabled" +#endif + #endif