diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a09c55f --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.o +*~ +firmware.* +lpc1xxx/memory.ld +lpcrc +*.rej +*.orig +*.patch +a.* +? diff --git a/Makefile b/Makefile index f7c250e..991dc03 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,8 @@ -########################################################################## -# User configuration and firmware specific object files -########################################################################## - -# The target, flash and ram of the LPC1xxx microprocessor. -# Use for the target the value: LPC11xx, LPC13xx or LPC17xx -TARGET = LPC13xx -FLASH = 32K -SRAM = 8K +include boards/defaults +include projectconfig +include configparser.make -# For USB HID support the LPC134x reserves 384 bytes from the sram, -# if you don't want to use the USB features, just use 0 here. -SRAM_USB = 384 - -VPATH = -OBJS = main.o +OBJS += main.o ########################################################################## # Debug settings @@ -34,95 +23,15 @@ OPTDEFINES = -D __NEWLIB__ ########################################################################## VPATH += project -OBJS += commands.o - -VPATH += project/commands -OBJS += cmd_chibi_addr.o cmd_chibi_tx.o -OBJS += cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o -OBJS += cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o -OBJS += cmd_roundedcorner.o cmd_pwm.o - -VPATH += project/commands/drawing -OBJS += cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o -OBJS += cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o -OBJS += cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o -OBJS += cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o ########################################################################## # Optional driver files ########################################################################## -# Chibi Light-Weight Wireless Stack (AT86RF212) -VPATH += drivers/rf/chibi -OBJS += chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o - -# 4K EEPROM -VPATH += drivers/storage/eeprom drivers/storage/eeprom/mcp24aa -OBJS += eeprom.o mcp24aa.o - -# LM75B temperature sensor -VPATH += drivers/sensors/lm75b -OBJS += lm75b.o - # ISL12022M RTC VPATH += drivers/rtc/isl12022m OBJS += isl12022m.o -# TFT LCD support -VPATH += drivers/displays/tft drivers/displays/tft/hw -OBJS += drawing.o touchscreen.o colors.o theme.o bmp.o - -# GUI Controls -VPATH += drivers/displays/tft/controls -OBJS += button.o hsbchart.o huechart.o label.o -OBJS += labelcentered.o progressbar.o - -# Bitmap (non-AA) fonts -VPATH += drivers/displays/tft/fonts -OBJS += fonts.o -OBJS += dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o -OBJS += dejavusansmono8.o dejavusansmonobold8.o -OBJS += verdana9.o verdana14.o verdanabold14.o - -# Anti-aliased fonts -VPATH += drivers/displays/tft/aafonts/aa2 drivers/displays/tft/aafonts/aa4 -OBJS += aafonts.o -OBJS += DejaVuSansCondensed14_AA2.o DejaVuSansCondensedBold14_AA2.o -OBJS += DejaVuSansMono10_AA2.o DejaVuSansMono13_AA2.o DejaVuSansMono14_AA2.o - -# LCD Driver (Only one can be included at a time!) -# OBJS += hx8340b.o -# OBJS += hx8347d.o -OBJS += ILI9328.o -# OBJS += ILI9325.o -# OBJS += ssd1331.o -# OBJS += ssd1351.o -# OBJS += st7735.o -# OBJS += st7783.o - -# Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.) -VPATH += drivers/displays -VPATH += drivers/displays/bitmap/sharpmem -VPATH += drivers/displays/bitmap/st7565 -VPATH += drivers/displays/bitmap/ssd1306 -OBJS += smallfonts.o sharpmem.o st7565.o ssd1306.o - -#Character Displays (VFD text displays, etc.) -VPATH += drivers/displays/character/samsung_20T202DA2JA -OBJS += samsung_20T202DA2JA.o - -# ChaN FatFS and SD card support -VPATH += drivers/fatfs -OBJS += ff.o mmc.o - -# Motors -VPATH += drivers/motor/stepper -OBJS += stepper.o - -# RSA Encryption/Descryption -VPATH += drivers/rsa -OBJS += rsa.o - # DAC VPATH += drivers/dac/mcp4725 drivers/dac/mcp4901 OBJS += mcp4725.o mcp4901.o @@ -158,13 +67,13 @@ OBJS += mpl115a2.o VPATH += core core/adc core/cmd core/cpu core/gpio core/i2c core/pmu VPATH += core/ssp core/systick core/timer16 core/timer32 core/uart -VPATH += core/usbhid-rom core/wdt core/usbcdc core/pwm core/iap +VPATH += core/wdt core/iap VPATH += core/libc OBJS += stdio.o string.o -OBJS += adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o -OBJS += timer32.o uart.o uart_buf.o usbconfig.o usbhid.o -OBJS += wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o -OBJS += sysinit.o pwm.o iap.o +OBJS += adc.o cpu.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o +OBJS += timer32.o uart.o uart_buf.o +OBJS += wdt.o +OBJS += sysinit.o iap.o ########################################################################## # GNU GCC compiler prefix and location @@ -208,13 +117,16 @@ OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o # Compiler settings, parameters and flags ########################################################################## ifeq (TRUE,$(DEBUGBUILD)) - CFLAGS = -c -g -O0 $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin $(OPTDEFINES) - ASFLAGS = -c -g -O0 $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp + CFLAGS = -g -O0 + ASFLAGS = -g -O0 else - CFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin $(OPTDEFINES) - ASFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp + CFLAGS = -g -Os + ASFLAGS = -g -Os endif + +xCFLAGS = -c $(CFLAGS) $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin $(OPTDEFINES) $(DEFS) +xASFLAGS = -c $(ASFLAGS) $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections LDLIBS = -lm OCFLAGS = --strip-unneeded @@ -222,10 +134,12 @@ OCFLAGS = --strip-unneeded all: firmware %.o : %.c - $(CC) $(CFLAGS) -o $@ $< + @echo CC $< + @$(CC) $(xCFLAGS) -o $@ $< %.o : %.s - $(AS) $(ASFLAGS) -o $@ $< + @echo AS $< + @$(AS) $(xASFLAGS) -o $@ $< firmware: $(OBJS) $(SYS_OBJS) -@echo "MEMORY" > $(LD_TEMP) diff --git a/boards/LPC1343_802154USBSTICK b/boards/LPC1343_802154USBSTICK new file mode 100644 index 0000000..3f7c2f3 --- /dev/null +++ b/boards/LPC1343_802154USBSTICK @@ -0,0 +1,18 @@ +GPIO_ENABLE_IRQ1 = 1 + +CFG_SSP0_SCKPIN = 0_6 + +CFG_LED_PORT = 3 +CFG_LED_PIN = 2 + +CFG_USBCDC = 1 + +CFG_PRINTF_USBCDC = 1 +CFG_PRINTF_NEWLINE = "\r\n" + +CFG_INTERFACE_PROMPT = "CMD >> " + +CFG_I2CEEPROM = 1 + +CFG_CHIBI = 1 +CFG_CHIBI_BUFFERSIZE = 1024 diff --git a/boards/LPC1343_LPCXPRESSO b/boards/LPC1343_LPCXPRESSO new file mode 100644 index 0000000..9681315 --- /dev/null +++ b/boards/LPC1343_LPCXPRESSO @@ -0,0 +1,9 @@ +GPIO_ENABLE_IRQ1 = 1 + +CFG_LED_PORT = 0 +CFG_LED_PIN = 7 + +CFG_USBCDC = 1 + +CFG_PRINTF_USBCDC = 1 +CFG_PRINTF_NEWLINE = "\r\n" diff --git a/boards/LPC1343_OLIMEX_P b/boards/LPC1343_OLIMEX_P new file mode 100644 index 0000000..f71b6d7 --- /dev/null +++ b/boards/LPC1343_OLIMEX_P @@ -0,0 +1,9 @@ +GPIO_ENABLE_IRQ1 = 1 + +CFG_LED_PORT = 3 +CFG_LED_PIN = 2 + +CFG_USBCDC = 1 + +CFG_PRINTF_USBCDC = 1 +CFG_PRINTF_NEWLINE = "\r\n" diff --git a/boards/LPC1343_REFDESIGN b/boards/LPC1343_REFDESIGN new file mode 100644 index 0000000..d311785 --- /dev/null +++ b/boards/LPC1343_REFDESIGN @@ -0,0 +1,7 @@ +include boards/LPC1343_REFDESIGN_MINIMAL + +CFG_USBCDC = 1 + +CFG_PRINTF_USBCDC = 1 + +CFG_I2CEEPROM = 1 diff --git a/boards/LPC1343_REFDESIGN_MINIMAL b/boards/LPC1343_REFDESIGN_MINIMAL new file mode 100644 index 0000000..539ed49 --- /dev/null +++ b/boards/LPC1343_REFDESIGN_MINIMAL @@ -0,0 +1,5 @@ +GPIO_ENABLE_IRQ1 = 1 + +ADC_AVERAGING_ENABLE = 1 + +CFG_PRINTF_NEWLINE = "\r\n" diff --git a/boards/LPC1343_TFTLCDSTANDALONE_UART b/boards/LPC1343_TFTLCDSTANDALONE_UART new file mode 100644 index 0000000..f7bef3f --- /dev/null +++ b/boards/LPC1343_TFTLCDSTANDALONE_UART @@ -0,0 +1,25 @@ +GPIO_ENABLE_IRQ1 = 1 + +CFG_ALTRESET = 1 +CFG_ALTRESET_PORT = 1 +CFG_ALTRESET_PIN = 5 # P1.5 = RTS + +CFG_UART_BAUDRATE = 57600 + +CFG_USBCDC_BAUDRATE = 57600 + +CFG_PRINTF_UART = 1 + +CFG_INTERFACE_PROMPT = "CMD >> " +CFG_INTERFACE_SILENTMODE = 1 +CFG_INTERFACE_DROPCR = 1 +CFG_INTERFACE_ENABLEIRQ = 1 +CFG_INTERFACE_SHORTERRORS = 1 +CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND = "?" +CFG_INTERFACE_SHORTERRORS_TOOMANYARGS = ">" +CFG_INTERFACE_SHORTERRORS_TOOFEWARGS = "<" +CFG_INTERFACE_CONFIRMREADY_TEXT = "." + +CFG_I2CEEPROM = 1 + +CFG_TFTLCD = 1 diff --git a/boards/LPC1343_TFTLCDSTANDALONE_USB b/boards/LPC1343_TFTLCDSTANDALONE_USB new file mode 100644 index 0000000..633940b --- /dev/null +++ b/boards/LPC1343_TFTLCDSTANDALONE_USB @@ -0,0 +1,16 @@ +GPIO_ENABLE_IRQ1 = 1 + +CFG_USBCDC = 1 + +CFG_PRINTF_USBCDC = 1 +CFG_PRINTF_NEWLINE = "\r\n" + +CFG_INTERFACE_PROMPT = "CMD >> " +CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND = "?" +CFG_INTERFACE_SHORTERRORS_TOOMANYARGS = ">" +CFG_INTERFACE_SHORTERRORS_TOOFEWARGS = "<" +CFG_INTERFACE_CONFIRMREADY_TEXT = "." + +CFG_I2CEEPROM = 1 + +CFG_TFTLCD = 1 diff --git a/boards/defaults b/boards/defaults new file mode 100644 index 0000000..6f9935f --- /dev/null +++ b/boards/defaults @@ -0,0 +1,74 @@ +CFG_CPU_CCLK = 72000000 # 1 tick = 13.88nS +CFG_SYSTICK_DELAY_IN_MS = 1 + +CFG_UART_BAUDRATE = 115200 +CFG_UART_BUFSIZE = 512 + +CFG_SSP0_SCKPIN = 2_11 + +ADC_AVERAGING_SAMPLES = 5 + +CFG_LED_PORT = 2 +CFG_LED_PIN = 10 +CFG_LED_ON = 0 +CFG_LED_OFF = 1 + +CFG_SDCARD_READONLY = 1 +CFG_SDCARD_CDPORT = 3 +CFG_SDCARD_CDPIN = 0 + +CFG_USB_VID = 239A +CFG_USB_PID = 1002 +CFG_USB_SOFTCONNECT = 1 + +CFG_USBCDC_BAUDRATE = 115200 +CFG_USBCDC_INITTIMEOUT = 5000 +CFG_USBCDC_BUFFERSIZE = 256 + +CFG_PRINTF_MAXSTRINGSIZE = 255 +CFG_PRINTF_NEWLINE = "\n" + +CFG_INTERFACE_MAXMSGSIZE = 256 +CFG_INTERFACE_PROMPT = "LPC1343 >> " +CFG_INTERFACE_SILENTMODE = 0 +CFG_INTERFACE_DROPCR = 0 +CFG_INTERFACE_ENABLEIRQ = 0 +CFG_INTERFACE_IRQPORT = 0 +CFG_INTERFACE_IRQPIN = 7 +CFG_INTERFACE_SHORTERRORS = 0 +CFG_INTERFACE_CONFIRMREADY = 0 +CFG_INTERFACE_LONGSYSINFO = 0 + +CFG_PWM_DEFAULT_PULSEWIDTH = CFG_CPU_CCLK / 1000 +CFG_PWM_DEFAULT_DUTYCYCLE = 50 + +CFG_I2CEEPROM_SIZE = 3072 + +CFG_EEPROM_RESERVED = FF # Protect first 256 bytes of memory +CFG_EEPROM_CHIBI_IEEEADDR = 00 # 8 +CFG_EEPROM_CHIBI_SHORTADDR = 09 # 2 +CFG_EEPROM_UART_SPEED = 20 # 4 +CFG_EEPROM_TOUCHSCREEN_CALIBRATED = 30 # 1 +CFG_EEPROM_TOUCHSCREEN_CAL_AN = 31 # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_BN = 35 # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_CN = 39 # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_DN = 3D # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_EN = 41 # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_FN = 45 # 4 +CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER = 49 # 4 +CFG_EEPROM_TOUCHSCREEN_THRESHHOLD = 4D # 1 + +CFG_CHIBI_MODE = 0 # OQPSK_868MHZ +CFG_CHIBI_POWER = 0xE9 # CHB_PWR_EU2_3DBM +CFG_CHIBI_CHANNEL = 0 # 868-868.6 MHz +CFG_CHIBI_PANID = 1234 +CFG_CHIBI_PROMISCUOUS = 0 +CFG_CHIBI_BUFFERSIZE = 128 + +CFG_TFTLCD_DRIVER = ILI9328 +CFG_TFTLCD_INCLUDESMALLFONTS = 0 +CFG_TFTLCD_USEAAFONTS = 0 +CFG_TFTLCD_TS_DEFAULTTHRESHOLD = 50 +CFG_TFTLCD_TS_KEYPADDELAY = 100 + +CFG_RSA_BITS = 32 diff --git a/configparser.make b/configparser.make new file mode 100644 index 0000000..d4ef0bd --- /dev/null +++ b/configparser.make @@ -0,0 +1,308 @@ +DEFS += -DCFG_CPU_CCLK='(${CFG_CPU_CCLK})' +DEFS += -DCFG_SYSTICK_DELAY_IN_MS='(${CFG_SYSTICK_DELAY_IN_MS})' +DEFS += -DCFG_FIRMWARE_VERSION_MAJOR='(${CFG_FIRMWARE_VERSION_MAJOR})' -DCFG_FIRMWARE_VERSION_MINOR='(${CFG_FIRMWARE_VERSION_MINOR})' -DCFG_FIRMWARE_VERSION_REVISION='(${CFG_FIRMWARE_VERSION_REVISION})' + +ifeq (${GPIO_ENABLE_IRQ0},1) + DEFS += -DGPIO_ENABLE_IRQ0 +endif +ifeq (${GPIO_ENABLE_IRQ1},1) + DEFS += -DGPIO_ENABLE_IRQ1 +endif +ifeq (${GPIO_ENABLE_IRQ2},1) + DEFS += -DGPIO_ENABLE_IRQ2 +endif +ifeq (${GPIO_ENABLE_IRQ3},1) + DEFS += -DGPIO_ENABLE_IRQ3 +endif + +ifeq (${CFG_ALTRESET},1) + DEFS += -DCFG_ALTRESET -DCFG_ALTRESET_PORT='(${CFG_ALTRESET_PORT})' -DCFG_ALTRESET_PIN='(${CFG_ALTRESET_PIN})' +endif + +DEFS += -DCFG_UART_BAUDRATE='(${CFG_UART_BAUDRATE})' -DCFG_UART_BUFSIZE='(${CFG_UART_BUFSIZE})' + +ifneq (${CFG_SSP0_SCKPIN},) + DEFS += -DCFG_SSP0_SCKPIN_${CFG_SSP0_SCKPIN} +endif + +ifeq (${ADC_AVERAGING_ENABLE},1) + DEFS += -DADC_AVERAGING_ENABLE='(1)' -DADC_AVERAGING_SAMPLES='(${ADC_AVERAGING_SAMPLES})' +else + DEFS += -DADC_AVERAGING_ENABLE='(0)' +endif + +DEFS += -DCFG_LED_PORT='(${CFG_LED_PORT})' -DCFG_LED_PIN='(${CFG_LED_PIN})' -DCFG_LED_ON='(${CFG_LED_ON})' -DCFG_LED_OFF='(${CFG_LED_OFF})' + +ifeq (${CFG_SDCARD},1) + ifeq (${CFG_STEPPER},1) +$(error CFG_SDCARD and CFG_STEPPER can not be defined at the same time since they both use pin 3.0.) + endif + ifeq (${CFG_SSP0_SCKPIN},) +$(error CFG_SDCARD requires CFG_SSP0_SCKPIN to use SSP) + endif + + DEFS += -DCFG_SDCARD -DCFG_SDCARD_READONLY='(${CFG_SDCARD_READONLY})' -DCFG_SDCARD_CDPORT='(${CFG_SDCARD_CDPORT})' -DCFG_SDCARD_CDPIN='(${CFG_SDCARD_CDPIN})' + VPATH += drivers/fatfs + OBJS += ff.o mmc.o +endif + +SRAM_USB = 0 +ifneq (${CFG_USBHID}${CFG_USBCDC},) + DEFS += -DCFG_USB_VID='(0x${CFG_USB_VID})' -DCFG_USB_PID='(0x${CFG_USB_PID})' + DEFS += -DCFG_USB_SOFTCONNECT='(${CFG_USB_SOFTCONNECT})' + OBJS += usbcore.o usbdesc.o usbhw.o usbuser.o + + ifeq (${CFG_USBHID},1) + DEFS += -DCFG_USBHID + VPATH += core/usbhid-rom + OBJS += usbconfig.o usbhid.o + SRAM_USB = 384 + ifeq (${CFG_USBCDC},1) +$(error Only one USB class can be defined at a time (CFG_USBCDC or CFG_USBHID)) + endif + endif + ifeq (${CFG_USBCDC},1) + DEFS += -DCFG_USBCDC -DCFG_USBCDC_BAUDRATE='(${CFG_USBCDC_BAUDRATE})' -DCFG_USBCDC_INITTIMEOUT='(${CFG_USBCDC_INITTIMEOUT})' -DCFG_USBCDC_BUFFERSIZE='(${CFG_USBCDC_BUFFERSIZE})' + VPATH += core/usbcdc + OBJS += cdcuser.o cdc_buf.o + endif +endif + +ifneq (${CFG_PRINTF_UART}${CFG_PRINTF_USBCDC},) + DEFS += -DCFG_PRINTF_MAXSTRINGSIZE='(${CFG_PRINTF_MAXSTRINGSIZE})' -DCFG_PRINTF_NEWLINE='(${CFG_PRINTF_NEWLINE})' + + ifeq (${CFG_PRINTF_UART},1) + DEFS += -DCFG_PRINTF_UART + ifeq (${CFG_PRINTF_USBCDC},1) +$(error CFG_PRINTF_UART or CFG_PRINTF_USBCDC cannot both be defined at once) + endif + ifneq (${CFG_USBCDC},1) +$(error CFG_PRINTF_CDC requires CFG_USBCDC to be defined as well) + endif + endif + ifeq (${CFG_PRINTF_USBCDC},1) + DEFS += -DCFG_PRINTF_USBCDC + endif +endif + +ifeq (${CFG_INTERFACE},1) + ifeq (${CFG_PRINTF_USBCDC},1) + ifeq (${CFG_INTERFACE_SILENTMODE},1) + $(warning CFG_INTERFACE_SILENTMODE typically isn't enabled with CFG_PRINTF_USBCDC) + endif + else + ifeq (${CFG_PRINTF_UART},) +$(error CFG_PRINTF_UART or CFG_PRINTF_USBCDC must be defined for for CFG_INTERFACE Input/Output) + endif + endif + + DEFS += -DCFG_INTERFACE -DCFG_INTERFACE_MAXMSGSIZE='(${CFG_INTERFACE_MAXMSGSIZE})' -DCFG_INTERFACE_PROMPT='${CFG_INTERFACE_PROMPT}' -DCFG_INTERFACE_SILENTMODE='(${CFG_INTERFACE_SILENTMODE})' -DCFG_INTERFACE_DROPCR='(${CFG_INTERFACE_DROPCR})' -DCFG_INTERFACE_ENABLEIRQ='(${CFG_INTERFACE_ENABLEIRQ})' -DCFG_INTERFACE_IRQPORT='(${CFG_INTERFACE_IRQPORT})' -DCFG_INTERFACE_IRQPIN='(${CFG_INTERFACE_IRQPIN})' -DCFG_INTERFACE_LONGSYSINFO='(${CFG_INTERFACE_LONGSYSINFO})' + ifeq (${CFG_SHORTERRORS},1) + DEFS += -DCFG_INTERFACE_SHORTERRORS='(1)' -DCFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND='${CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND}' -DCFG_INTERFACE_SHORTERRORS_TOOMANYARGS='${CFG_INTERFACE_SHORTERRORS_TOOMANYARGS}' -DCFG_INTERFACE_SHORTERRORS_TOOFEWARGS='${CFG_INTERFACE_SHORTERRORS_TOOFEWARGS}' + else + DEFS += -DCFG_INTERFACE_SHORTERRORS='(0)' + endif + ifeq (${CFG_INTERFACE_CONFIRMREADY},1) + DEFS += -DCFG_INTERFACE_CONFIRMREADY='(1)' -DCFG_INTERFACE_CONFIRMREADY_TEXT='${CFG_INTERFACE_CONFIRMREADY_TEXT}' + else + DEFS += -DCFG_INTERFACE_CONFIRMREADY='(0)' + endif + + OBJS += cmd.o + OBJS += commands.o + + VPATH += project/commands + OBJS += cmd_reset.o cmd_sysinfo.o cmd_uart.o cmd_roundedcorner.o + + ifeq (${CFG_CHIBI},1) + OBJS += cmd_chibi_addr.o cmd_chibi_tx.o + endif + ifeq (${CFG_I2CEEPROM},1) + OBJS += cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o + endif + ifeq (${CFG_SDCARD},1) + OBJS += cmd_sd_dir.o + endif + ifeq (${CFG_PWM},1) + OBJS += cmd_pwm.o + endif + + VPATH += project/commands/drawing + OBJS += cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o + OBJS += cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o + OBJS += cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o + OBJS += cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o +endif + +ifeq (${CFG_PWM},1) + DEFS += -DCFG_PWM -DCFG_PWM_DEFAULT_PULSEWIDTH='(${CFG_PWM_DEFAULT_PULSEWIDTH})' -DCFG_PWM_DEFAULT_DUTYCYCLE='(${CFG_PWM_DEFAULT_DUTYCYCLE})' + VPATH += core/pwm + OBJS += pwm.o +endif + +ifeq (${CFG_STEPPER},1) + DEFS += -DCFG_STEPPER + VPATH += drivers/motor/stepper + OBJS += stepper.o +endif + +ifeq (${CFG_I2CEEPROM},1) + ifeq (${CFG_SSP0_SCKPIN},) +$(error CFG_I2CEEPROM requires CFG_SSP0_SCKPIN to use SSP) + endif + + DEFS += -DCFG_I2CEEPROM -DCFG_I2CEEPROM_SIZE='(${CFG_I2CEEPROM_SIZE})' + VPATH += drivers/storage/eeprom drivers/storage/eeprom/mcp24aa + OBJS += eeprom.o mcp24aa.o + + DEFS += -DCFG_EEPROM_RESERVED='(0x${CFG_EEPROM_RESERVED})' + DEFS += -DCFG_EEPROM_CHIBI_IEEEADDR='(uint16_t)(0x${CFG_EEPROM_CHIBI_IEEEADDR})' + DEFS += -DCFG_EEPROM_CHIBI_SHORTADDR='(uint16_t)(0x${CFG_EEPROM_CHIBI_SHORTADDR})' + DEFS += -DCFG_EEPROM_UART_SPEED='(uint16_t)(0x${CFG_EEPROM_UART_SPEED})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CALIBRATED='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CALIBRATED})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_AN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_AN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_BN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_BN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_CN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_CN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_DN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_DN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_EN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_EN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_FN='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_FN})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER})' + DEFS += -DCFG_EEPROM_TOUCHSCREEN_THRESHHOLD='(uint16_t)(0x${CFG_EEPROM_TOUCHSCREEN_THRESHHOLD})' +endif + +ifeq (${CFG_LM75B},1) + DEFS += -DCFG_LM75B + VPATH += drivers/sensors/lm75b + OBJS += lm75b.o +endif + +ifeq (${CFG_CHIBI},1) + ifeq (${CFG_SSP0_SCKPIN},) +$(error CFG_CHIBI requires CFG_SSP0_SCKPIN to use SSP) + endif + ifneq (${CFG_I2CEEPROM},1) +$(error CFG_CHIBI requires CFG_I2CEEPROM to store and retrieve addresses) + endif + ifeq (${CFG_SDCARD},1) +$(error CFG_CHIBI and CFG_SDCARD can not be defined at the same time. Only one SPI block is available on the LPC1343.) + endif + ifeq (${CFG_TFTLCD},1) +$(error CFG_CHIBI and CFG_TFTLCD can not be defined at the same time since they both use pins 1.8, 1.9 and 1.10.) + endif + ifeq (${CFG_PWM},1) +$(error CFG_CHIBI and CFG_PWM can not be defined at the same time since they both use pin 1.9.) + endif + ifneq (${CFG_CHIBI_PROMISCUOUS},1) + ifneq (${CFG_CHIBI_PROMISCUOUS},0) +$(error CFG_CHIBI_PROMISCUOUS must be equal to either 1 or 0) + endif + endif + ifneq (${GPIO_ENABLE_IRQ1},1) +$(error GPIO_ENABLE_IRQ1 must be enabled when using Chibi (Chibi IRQ is on GPIO1.8)) + endif + + DEFS += -DCFG_CHIBI + DEFS += -DCFG_CHIBI_MODE='(${CFG_CHIBI_MODE})' + DEFS += -DCFG_CHIBI_POWER='(${CFG_CHIBI_POWER})' + DEFS += -DCFG_CHIBI_CHANNEL='(${CFG_CHIBI_CHANNEL})' + DEFS += -DCFG_CHIBI_PANID='(0x${CFG_CHIBI_PANID})' + DEFS += -DCFG_CHIBI_PROMISCUOUS='(${CFG_CHIBI_PROMISCUOUS})' + DEFS += -DCFG_CHIBI_BUFFERSIZE='(${CFG_CHIBI_BUFFERSIZE})' + VPATH += drivers/rf/chibi + OBJS += chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o +endif + +ifeq (${CFG_TFTLCD},1) + ifeq (${CFG_ST7565},1) +$(error CFG_TFTLCD and CFG_ST7565 can not be defined at the same time.) + endif + ifeq (${CFG_SSD1306},1) +$(error CFG_TFTLCD and CFG_SSD1306 can not be defined at the same time.) + endif + ifeq (${CFG_SHARPMEM},1) +$(error CFG_TFTLCD and CFG_SHARPMEM can not be defined at the same time.) + endif + ifeq (${CFG_PWM},1) +$(error CFG_TFTLCD and CFG_PWM can not be defined at the same time since they both use pin 1.9.) + endif + ifneq (${CFG_I2CEEPROM},1) +$(error CFG_TFTLCD requires CFG_I2CEEPROM to store and retrieve configuration settings) + endif + + ifeq (${CFG_TFTLCD_DRIVER},hx8347d) + ifeq (${CFG_SSP0_SCKPIN},) +$(error CFG_TFTLCD_DRIVER=hx8347d requires CFG_SSP0_SCKPIN to use SSP) + endif + endif + + DEFS += -DCFG_TFTLCD + DEFS += -DCFG_TFTLCD_INCLUDESMALLFONTS='(${CFG_TFTLCD_INCLUDESMALLFONTS})' + DEFS += -DCFG_TFTLCD_USEAAFONTS='(${CFG_TFTLCD_USEAAFONTS})' + DEFS += -DCFG_TFTLCD_TS_DEFAULTTHRESHOLD='(${CFG_TFTLCD_TS_DEFAULTTHRESHOLD})' + DEFS += -DCFG_TFTLCD_TS_KEYPADDELAY='(${CFG_TFTLCD_TS_KEYPADDELAY})' + + # TFT LCD support + VPATH += drivers/displays/tft drivers/displays/tft/hw + OBJS += drawing.o touchscreen.o colors.o theme.o bmp.o + + # GUI Controls + VPATH += drivers/displays/tft/controls + OBJS += button.o hsbchart.o huechart.o label.o + OBJS += labelcentered.o progressbar.o + + # Bitmap (non-AA) fonts + VPATH += drivers/displays/tft/fonts + OBJS += fonts.o + OBJS += dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o + OBJS += dejavusansmono8.o dejavusansmonobold8.o + OBJS += verdana9.o verdana14.o verdanabold14.o + + # Anti-aliased fonts + VPATH += drivers/displays/tft/aafonts/aa2 drivers/displays/tft/aafonts/aa4 + OBJS += aafonts.o + OBJS += DejaVuSansCondensed14_AA2.o DejaVuSansCondensedBold14_AA2.o + OBJS += DejaVuSansMono10_AA2.o DejaVuSansMono13_AA2.o DejaVuSansMono14_AA2.o + + # LCD Driver (Only one can be included at a time!) + OBJS += ${CFG_TFTLCD_DRIVER}.o + + #Character Displays (VFD text displays, etc.) + VPATH += drivers/displays/character/samsung_20T202DA2JA + OBJS += samsung_20T202DA2JA.o +endif + +ifneq (${CFG_ST7565}${CFG_SSD1306}${CFG_SHARPMEM},) + # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.) + VPATH += drivers/displays + OBJS += smallfonts.o + + ifeq (${CFG_ST7565},1) + DEFS += -DCFG_ST7565 + VPATH += drivers/displays/bitmap/st7565 + OBJS += st7565.o + ifeq (${CFG_SSD1306},1) +$(error CFG_ST7565 and CFG_SSD1306 can not be defined at the same time) + endif + endif + ifeq (${CFG_SSD1306},1) + DEFS += -DCFG_SSD1306 + VPATH += drivers/displays/bitmap/ssd1306 + OBJS += ssd1306.o + endif + ifeq (${CFG_SHARPMEM},1) + DEFS += -DCFG_SHARPMEM + VPATH += drivers/displays/bitmap/sharpmem + OBJS += sharpmem.o + endif +endif + +ifeq (${CFG_RSA},1) + ifneq (${CFG_RSA_BITS},32) + ifneq (${CFG_RSA_BITS},64) +$(error CFG_RSA_BITS must be equal to either 32 or 64.) + endif + endif + DEFS += -DCFG_RSA -DCFG_RSA_BITS='(${CFG_RSA_BITS})' + VPATH += drivers/rsa + OBJS += rsa.o +endif diff --git a/core/usbcdc/usbhw.c b/core/usbcdc/usbhw.c index 88add23..7ef9d82 100644 --- a/core/usbcdc/usbhw.c +++ b/core/usbcdc/usbhw.c @@ -67,8 +67,10 @@ void USBIOClkConfig( void ) IOCON_PIO0_1 |= IOCON_PIO0_1_FUNC_CLKOUT; // CLK OUT IOCON_PIO0_3 &= ~IOCON_PIO0_3_FUNC_MASK; IOCON_PIO0_3 |= IOCON_PIO0_3_FUNC_USB_VBUS; // VBus +#if CFG_USB_SOFTCONNECT IOCON_PIO0_6 &= ~IOCON_PIO0_6_FUNC_MASK; IOCON_PIO0_6 |= IOCON_PIO0_6_FUNC_USB_CONNECT; // Soft Connect +#endif return; } diff --git a/core/usbhid-rom/usbhid.c b/core/usbhid-rom/usbhid.c index ce53742..e91337a 100644 --- a/core/usbhid-rom/usbhid.c +++ b/core/usbhid-rom/usbhid.c @@ -173,8 +173,10 @@ void usbHIDInit (void) IOCON_PIO0_1 |= IOCON_PIO0_1_FUNC_CLKOUT; // CLK OUT IOCON_PIO0_3 &= ~IOCON_PIO0_3_FUNC_MASK; IOCON_PIO0_3 |= IOCON_PIO0_3_FUNC_USB_VBUS; // VBus +#if CFG_USB_SOFTCONNECT IOCON_PIO0_6 &= ~IOCON_PIO0_6_FUNC_MASK; IOCON_PIO0_6 |= IOCON_PIO0_6_FUNC_USB_CONNECT; // Soft Connect +#endif // Disable internal resistor on VBUS (0.3) gpioSetPullup(&IOCON_PIO0_3, gpioPullupMode_Inactive); diff --git a/projectconfig b/projectconfig new file mode 100644 index 0000000..b5f8a03 --- /dev/null +++ b/projectconfig @@ -0,0 +1,757 @@ +# @file projectconfig.h +# @author K. Townsend (microBuilder.eu) +# +# @section LICENSE +# +# Software License Agreement (BSD License) +# +# Copyright (c) 2012, microBuilder SARL +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holders nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# The target, flash and ram of the LPC1xxx microprocessor. +# Use for the target the value: LPC11xx, LPC13xx or LPC17xx +TARGET = LPC13xx +FLASH = 32K +SRAM = 8K + +# ========================================================================= +# BOARD SELECTION +# +# Because several boards use this code library with sometimes slightly +# different pin configuration, you will need to specify which board you +# are using by enabling one of the following definitions. The code base +# will then try to configure itself accordingly for that board. +# +# LPC1343_REFDESIGN +# ================= +# +# microBuilder.eu LPC1343 Reference Design base board with +# on-board peripherals initialised (EEPROM, USB or UART CLI, etc.) +# +# This is the recommended starting point for new development +# since it makes it easy to send printf output to USB CDC, access +# the on-board EEPROM, etc. +# +# LPC1343_REFDESIGN_MINIMAL +# ========================= +# +# microBuilder.eu LPC1343 Reference Design base board with +# only the most common peripherals initialised by default. +# +# Results in smallest code since EEPROM, USB, etc., are not +# initialised on startup. By default, only the following +# peripherals are initialised by systemInit(): +# +# - CPU (Configures the PLL, etc.) +# - GPIO +# - SysTick Timer +# - UART (with printf support) * +# +# * Can be removed to save 0.8kb in debug and 0.3 kb in +# release. Comment out 'CFG_PRINTF_UART' to disable it. +# +# The code size can be further reduced by several KB by removing +# any IRQ Handlers that are not used. The I2C IRQHandler, for +# example, uses ~1KB of flash in debug and ~400KB in release mode, +# but because it is referenced in the startup code it is always +# included even if I2C is never used in the project. +# +# Other IRQ Handlers that you might be able to comment out +# to save some space are: +# +# IRQ Handler Debug Release +# ------------------------- ------ ------- +# I2C_IRQHandler 1160 b 400 b +# SSP_IRQHandler 160 b 76 b +# UART_IRQHandler 246 b 116 b +# WAKEUP_IRQHandler 160 b 100 b +# WDT_IRQHandler 50 b 28 b +# +# LPC1343_TFTLCDSTANDALONE_USB +# ============================ +# +# microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with USB enabled +# for the CLI interface. +# +# LPC1343_TFTLCDSTANDALONE_UART +# ============================= +# +# microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with UART enabled +# for the CLI interface. +# +# LPC1343_802154USBSTICK +# ====================== +# +# microBuilder.eu USB stick 802.15.4 868/915MHz RF transceiver +# +# LPC1343_OLIMEX_P +# ================ +# +# Simple Olimex LPC1343 breakout board +# +# LPC1343_LPCXPRESSO +# ================== +# +# LPC1343 LPCXpresso board +# + +include boards/LPC1343_REFDESIGN +#include boards/LPC1343_REFDESIGN_MINIMAL +#include boards/LPC1343_TFTLCDSTANDALONE_USB +#include boards/LPC1343_TFTLCDSTANDALONE_UART +#include boards/LPC1343_802154USBSTICK +#include boards/LPC1343_OLIMEX_P +#include boards/LPC1343_LPCXPRESSO +# ========================================================================= +# +# +# ************************************************************************* +# PIN USAGE +# ----------------------------------------------------------------------- +# This table tries to give an indication of which GPIO pins and +# peripherals are used by the available drivers and SW examples. Only +# dedicated GPIO pins available on the LPC1343 Reference Board are shown +# below. Any unused peripheral blocks like I2C, SSP, ADC, etc., can +# also be used as GPIO if they are available. +# +# PORT 1 PORT 2 PORT 3 +# ========= ================= ======= +# 8 9 10 11 1 2 3 4 5 6 7 8 9 0 1 2 3 +# +# SDCARD . . . . . . . . . . . . . X . . . +# PWM . X . . . . . . . . . . . . . . . +# STEPPER . . . . . . . . . . . . . X X X X +# CHIBI X X X . . . . . . . . . . . . . . +# ILI9325/8 X X X X X X X X X X X X X . . . X +# 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 SPI . . . . X X X . X X . . . . . . . +# SSD1351 . . . . X X X X X . . . . . . . . +# MCP121 . . . . . . . . . . . . . . X . . +# PN532 [3] . . . . . . . . . . . . . . X X . +# +# TIMERS SSP ADC UART +# ====================== === ======= ==== +# 16B0 16B1 32B0 32B1 0 0 1 2 3 0 +# +# SDCARD . . . . X . . . . . +# PWM . X . . . . . . . . +# PMU [1] . . X . . . . . . . +# USB . . . X . . . . . . +# STEPPER . . X . . . . . . . +# CHIBI x . . . X . . . . . +# ILI9325/8 . . . . . X X X X . +# ST7565 . . . . . X X X X . +# ST7535 . . . . . . . . . . +# SHARPMEM . . . . . . . . . . +# 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] P3.2 is only used with the I2C bus (for IRQ) +# +# ************************************************************************* +# +# +# ************************************************************************* +# I2C Addresses +# ----------------------------------------------------------------------- +# The following addresses are used by the different I2C sensors included +# in the code base [1] +# +# HEX BINARY +# ==== ======== +# ISL12022M (RTC) 0xDE 1101111x +# ISL12022M (SRAM) 0xAE 1010111x +# LM75B 0x90 1001000x +# MCP24AA 0xA0 1010000x +# 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 +# +# ************************************************************************* +# +# +# ========================================================================= +# FIRMWARE VERSION SETTINGS +# ----------------------------------------------------------------------- +CFG_FIRMWARE_VERSION_MAJOR = 1 +CFG_FIRMWARE_VERSION_MINOR = 1 +CFG_FIRMWARE_VERSION_REVISION = 0 +# ========================================================================= +# +# From here on, your board will configure reasonable defaults +# +# ========================================================================= +# CORE CPU SETTINGS +# ----------------------------------------------------------------------- +# +# CFG_CPU_CCLK Value is for reference only. 'core/cpu/cpu.c' must +# be modified to change the clock speed, but the value +# should be indicated here since CFG_CPU_CCLK is used by +# other peripherals to determine timing. +# +# ----------------------------------------------------------------------- +#CFG_CPU_CCLK = 72000000 # 1 tick = 13.88nS +# ========================================================================= +# +# +# ========================================================================= +# SYSTICK TIMER +# ----------------------------------------------------------------------- +# +# CFG_SYSTICK_DELAY_IN_MS The number of milliseconds between each tick +# of the systick timer. +# +# ----------------------------------------------------------------------- +#CFG_SYSTICK_DELAY_IN_MS = 1 +# ========================================================================= +# +# +# ========================================================================= +# 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 +# +# ----------------------------------------------------------------------- +#GPIO_ENABLE_IRQ0 = 1 +#GPIO_ENABLE_IRQ1 = 1 +#GPIO_ENABLE_IRQ2 = 1 +#GPIO_ENABLE_IRQ3 = 1 +# ========================================================================= +# +# +# ========================================================================= +# ALTERNATE RESET PIN +# ----------------------------------------------------------------------- +# +# CFG_ALTRESET If defined, indicates that a GPIO pin should be +# configured as an alternate reset pin in addition +# to the dedicated reset pin. +# CFG_ALTRESET_PORT The GPIO port where the alt reset pin is located +# CFG_ALTRESET_PIN The GPIO pin where the alt reset pin is located +# +# ----------------------------------------------------------------------- +#CFG_ALTRESET = 1 +#CFG_ALTRESET_PORT = 1 +#CFG_ALTRESET_PIN = 5 # P1.5 = RTS +# ========================================================================= +# +# +# ========================================================================= +# UART +# ----------------------------------------------------------------------- +# +# CFG_UART_BAUDRATE The default UART speed. This value is used +# when initialising UART, and should be a +# standard value like 57600, 9600, etc. +# NOTE: This value may be overridden if +# another value is stored in EEPROM! +# CFG_UART_BUFSIZE The length in bytes of the UART RX FIFO. This +# will determine the maximum number of received +# characters to store in memory. +# +# ----------------------------------------------------------------------- +#CFG_UART_BAUDRATE = 115200 +#CFG_UART_BUFSIZE = 512 +# ========================================================================= +# +# +# ========================================================================= +# SSP +# ----------------------------------------------------------------------- +# +# CFG_SSP0_SCKPIN=2_11 Indicates which pin should be used for SCK0 +# CFG_SSP0_SCKPIN=0_6 +# +# ----------------------------------------------------------------------- +#CFG_SSP0_SCKPIN = 2_11 +# ========================================================================= +# +# +# ========================================================================= +# 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. +# +# ----------------------------------------------------------------------- +#ADC_AVERAGING_ENABLE = 1 +#ADC_AVERAGING_SAMPLES = 5 +# ========================================================================= +# +# +# ========================================================================= +# ON-BOARD LED +# ----------------------------------------------------------------------- +# +# CFG_LED_PORT The port for the on board LED +# CFG_LED_PIN The pin for the on board LED +# CFG_LED_ON The pin state to turn the LED on (0 = low, 1 = high) +# CFG_LED_OFF The pin state to turn the LED off (0 = low, 1 = high) +# +# ----------------------------------------------------------------------- +#CFG_LED_PORT = 2 +#CFG_LED_PIN = 10 +#CFG_LED_ON = 0 +#CFG_LED_OFF = 1 +# ========================================================================= +# +# +# ========================================================================= +# MICRO-SD CARD +# ----------------------------------------------------------------------- +# +# CFG_SDCARD If this field is defined SD Card and FAT32 +# file system support will be included +# CFG_SDCARD_READONLY If this is set to 1, all commands to +# write to the SD card will be removed +# saving some flash space. +# CFG_SDCARD_CDPORT The card detect port number +# CFG_SDCARD_CDPIN The card detect pin number +# +# NOTE: All config settings for FAT32 are defined +# in ffconf.h +# +# BENCHMARK: With SPI set to 6.0MHz, FATFS can read +# ~300KB/s (w/512 byte read buffer) +# +# PIN LAYOUT: The pin layout that is used by this driver +# can be seen in the following schematic: +# /tools/schematics/Breakout_TFTLCD_ILI9325_v1.3 +# +# DEPENDENCIES: SDCARD requires the use of SSP0. +# ----------------------------------------------------------------------- +#CFG_SDCARD = 1 +#CFG_SDCARD_READONLY = 1 # Must be 0 or 1 +#CFG_SDCARD_CDPORT = 3 +#CFG_SDCARD_CDPIN = 0 +# ========================================================================= +# +# +# ========================================================================= +# USB +# ----------------------------------------------------------------------- +# +# CFG_USBHID If this field is defined USB HID support will +# be included. Currently uses ROM-based USB HID +# CFG_USBCDC If this field is defined USB CDC support will +# be included, with the USB Serial Port speed +# set to 115200 BPS by default +# CFG_USBCDC_BAUDRATE The default TX/RX speed. This value is used +# when initialising USBCDC, and should be a +# standard value like 57600, 9600, etc. +# CFG_USBCDC_INITTIMEOUT The maximum delay in milliseconds to wait for +# USB to connect. Must be a multiple of 10! +# CFG_USBCDC_BUFFERSIZE Size of the buffer (in bytes) that stores +# printf data until it can be sent out in +# 64 byte frames. The buffer is required since +# only one frame per ms can be sent using USB +# CDC (see 'puts' in systeminit.c). +# +# ----------------------------------------------------------------------- +#CFG_USB_VID = 239A +#CFG_USB_PID = 1002 +# +##CFG_USBHID = 1 +#CFG_USBCDC = 1 +#CFG_USBCDC_BAUDRATE = 115200 +#CFG_USBCDC_INITTIMEOUT = 5000 +#CFG_USBCDC_BUFFERSIZE = 256 +# ========================================================================= +# +# +# ========================================================================= +# 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 +# redirect to USB Serial +# CFG_PRINTF_NEWLINE This is typically "\r\n" for Windows or +# "\n" for *nix +# +# Note: If no printf redirection definitions are present, all printf +# output will be ignored. +# ----------------------------------------------------------------------- +#CFG_PRINTF_MAXSTRINGSIZE = 255 +##CFG_PRINTF_UART = 1 +#CFG_PRINTF_USBCDC = 1 +#CFG_PRINTF_NEWLINE = "\n" +# ========================================================================= +# +# +# ========================================================================= +# COMMAND LINE INTERFACE +# ----------------------------------------------------------------------- +# +# CFG_INTERFACE If this field is defined the UART or USBCDC +# based command-line interface will be included +# CFG_INTERFACE_MAXMSGSIZE The maximum number of bytes to accept for an +# incoming command +# CFG_INTERFACE_PROMPT The command prompt to display at the start +# of every new data entry line +# CFG_INTERFACE_SILENTMODE If this is set to 1 only text generated in +# response to commands will be send to the +# output buffer. The command prompt will not +# be displayed and incoming text will not be +# echoed back to the output buffer (allowing +# you to see the text you have input). This +# is normally only desirable in a situation +# where another MCU is communicating with +# the LPC1343. +# CFG_INTERFACE_DROPCR If this is set to 1 all incoming \r +# characters will be dropped +# CFG_INTERFACE_ENABLEIRQ If this is set to 1 the IRQ pin will be +# set high when a command starts executing +# and will go low when the command has +# finished executing or the LCD is not busy. +# This allows another device to know when a +# new command can safely be sent. +# CFG_INTERFACE_IRQPORT The gpio port for the IRQ/busy pin +# CFG_INTERFACE_IRQPIN The gpio pin number for the IRQ/busy pin +# CFG_INTERFACE_SHORTERRORS If this is enabled only short 1 character +# error messages will be returned (followed +# by CFG_PRINTF_NEWLINE), rather than more +# verbose error messages. The specific +# characters used are defined below. +# CFG_INTERFACE_CONFIRMREADY If this is set to 1 a text confirmation +# will be sent when the command prompt is +# ready for a new command. This is in +# 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 +# CFG_PRINTF_UART or CFG_PRINTF_USBCDC are +# selected. +# ----------------------------------------------------------------------- +#CFG_INTERFACE = 1 +#CFG_INTERFACE_MAXMSGSIZE = 256 +#CFG_INTERFACE_PROMPT = "CMD >> " +#CFG_INTERFACE_SILENTMODE = 0 +#CFG_INTERFACE_DROPCR = 0 +#CFG_INTERFACE_ENABLEIRQ = 0 +#CFG_INTERFACE_IRQPORT = 0 +#CFG_INTERFACE_IRQPIN = 7 +#CFG_INTERFACE_SHORTERRORS = 0 +#CFG_INTERFACE_CONFIRMREADY = 0 +#CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND = "?" +#CFG_INTERFACE_SHORTERRORS_TOOMANYARGS = ">" +#CFG_INTERFACE_SHORTERRORS_TOOFEWARGS = "<" +#CFG_INTERFACE_CONFIRMREADY_TEXT = "." +#CFG_INTERFACE_LONGSYSINFO = 0 +# ========================================================================= +# +# +# ========================================================================= +# PWM SETTINGS +# ----------------------------------------------------------------------- +# +# CFG_PWM If this is defined, a basic PWM driver +# will be included using 16-bit Timer 1 and +# Pin 1.9 (MAT0) for the PWM output. In +# order to allow for a fixed number of +# pulses to be generated, some PWM-specific +# code is required in the 16-Bit Timer 1 +# ISR. See "core/timer16/timer16.c" for +# more information. +# CFG_PWM_DEFAULT_PULSEWIDTH The default pulse width in ticks +# CFG_PWM_DEFAULT_DUTYCYCLE The default duty cycle in percent +# +# DEPENDENCIES: PWM output requires the use of 16-bit +# timer 1 and pin 1.9 (CT16B1_MAT0). +# ----------------------------------------------------------------------- +#CFG_PWM = 1 +#CFG_PWM_DEFAULT_PULSEWIDTH = CFG_CPU_CCLK / 1000 +#CFG_PWM_DEFAULT_DUTYCYCLE = 50 +# ========================================================================= +# +# +# ========================================================================= +# STEPPER MOTOR SETTINGS +# ----------------------------------------------------------------------- +# +# CFG_STEPPER If this is defined, a simple bi-polar +# stepper motor will be included for common +# H-bridge chips like the L293D or SN754410N +# +# DEPENDENCIES: STEPPER requires the use of pins 3.0-3 and +# 32-bit Timer 0. +# ----------------------------------------------------------------------- +##CFG_STEPPER = 1 +# ========================================================================= +# +# +# ========================================================================= +# EEPROM +# ----------------------------------------------------------------------- +# +# CFG_I2CEEPROM If defined, drivers for the onboard EEPROM +# will be included during build +# CFG_I2CEEPROM_SIZE The number of bytes available on the EEPROM +# +# ----------------------------------------------------------------------- +#CFG_I2CEEPROM = 1 +#CFG_I2CEEPROM_SIZE = 3072 +# ========================================================================= +# +# +# ========================================================================= +# EEPROM MEMORY MAP +# ----------------------------------------------------------------------- +# EEPROM is used to persist certain user modifiable values to make +# sure that these changes remain in effect after a reset or hard +# power-down. The addresses in EEPROM for these various system +# settings/values are defined below. The first 256 bytes of EEPROM +# are reserved for this (0x0000..0x00FF). +# +# CFG_EEPROM_RESERVED The last byte of reserved EEPROM memory +# +# EEPROM Address (0x0000..0x00FF) +# =============================== +# 0 1 2 3 4 5 6 7 8 9 A B C D E F +# 000x x x x x x x x x . x x . . . . . Chibi +# 001x . . . . . . . . . . . . . . . . +# 002x x x x x . . . . . . . . . . . . UART +# 003x x x x x x x x x x x x x x x x x Touch Screen Calibration +# 004x x x x x x x x x x x x x x x . . Touch Screen Calibration +# 005x . . . . . . . . . . . . . . . . +# 006x . . . . . . . . . . . . . . . . +# 007x . . . . . . . . . . . . . . . . +# 008x . . . . . . . . . . . . . . . . +# 009x . . . . . . . . . . . . . . . . +# 00Ax . . . . . . . . . . . . . . . . +# 00Bx . . . . . . . . . . . . . . . . +# 00Cx . . . . . . . . . . . . . . . . +# 00Dx . . . . . . . . . . . . . . . . +# 00Ex . . . . . . . . . . . . . . . . +# 00Fx . . . . . . . . . . . . . . . . +# +# ----------------------------------------------------------------------- +#CFG_EEPROM_RESERVED = 00FF # Protect first 256 bytes of memory +#CFG_EEPROM_CHIBI_IEEEADDR = 0000 # 8 +#CFG_EEPROM_CHIBI_SHORTADDR = 0009 # 2 +#CFG_EEPROM_UART_SPEED = 0020 # 4 +#CFG_EEPROM_TOUCHSCREEN_CALIBRATED = 0030 # 1 +#CFG_EEPROM_TOUCHSCREEN_CAL_AN = 0031 # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_BN = 0035 # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_CN = 0039 # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_DN = 003D # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_EN = 0041 # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_FN = 0045 # 4 +#CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER = 0049 # 4 +#CFG_EEPROM_TOUCHSCREEN_THRESHHOLD = 004D # 1 +# ========================================================================= +# +# +# ========================================================================= +# LM75B TEMPERATURE SENSOR +# ----------------------------------------------------------------------- +# +# CFG_LM75B If defined, drivers for an optional LM75B +# temperature sensor will be included during +# build (requires external HW) +# +# ----------------------------------------------------------------------- +##CFG_LM75B = 1 +# ========================================================================= +# +# +# ========================================================================= +# CHIBI WIRELESS STACK +# ----------------------------------------------------------------------- +# +# CFG_CHIBI If defined, the CHIBI wireless stack will be +# included during build. Requires external HW. +# CFG_CHIBI_MODE The mode to use when receiving and transmitting +# wireless data. See chb_drvr.h for possible values +# CFG_CHIBI_POWER The power level to use when transmitting. See +# chb_drvr.h for possible values +# CFG_CHIBI_CHANNEL 802.15.4 Channel (0 = 868MHz, 1-10 = 915MHz) +# CFG_CHIBI_PANID 16-bit PAN Identifier (ex.0x1234) +# CFG_CHIBI_PROMISCUOUS Set to 1 to enabled promiscuous mode or +# 0 to disable it. If promiscuous mode is +# enabled be sure to set CFG_CHIBI_BUFFERSIZE +# to an appropriately large value (ex. 1024) +# CFG_CHIBI_BUFFERSIZE The size of the message buffer in bytes +# +# DEPENDENCIES: Chibi requires the use of SSP0, 16-bit timer +# 0 and pins 3.1, 3.2, 3.3. It also requires +# the presence of CFG_I2CEEPROM. +# +# NOTE: These settings are not relevant to all boards! +# 'tools/schematics/AT86RF212LPC1114_v1.6.pdf' +# show how 'CHIBI' is meant to be connected +# ----------------------------------------------------------------------- +#CFG_CHIBI = 1 +#CFG_CHIBI_MODE = 0 # OQPSK_868MHZ +#CFG_CHIBI_POWER = 0xE9 # CHB_PWR_EU2_3DBM +#CFG_CHIBI_CHANNEL = 0 # 868-868.6 MHz +#CFG_CHIBI_PANID = 1234 +#CFG_CHIBI_PROMISCUOUS = 0 +#CFG_CHIBI_BUFFERSIZE = 128 +# ========================================================================= +# +# +# ========================================================================= +# TFT LCD +# ----------------------------------------------------------------------- +# +# CFG_TFTLCD If defined, this will cause drivers for +# a pre-determined LCD screen to be included +# during build. +# CFG_TFTLCD_DRIVER Only one LCD driver can be included during +# the build process: hx8340b, hx8347d, +# ILI9328, ILI9325, ssd1331, ssd1351, st7735, +# or st7783 +# 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 +# fonts are required since there is already +# 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). +# Should be an 8-bit value somewhere between +# 8 and 75 in normal circumstances. This is +# the default value and may be overriden by +# a value stored in EEPROM. +# CFG_TFTLCD_TS_KEYPADDELAY The delay in milliseconds between key +# presses in dialogue boxes +# +# PIN LAYOUT: The pin layout that is used by this driver +# can be seen in the following schematic: +# /tools/schematics/Breakout_TFTLCD_ILI9325_v1.3 +# +# DEPENDENCIES: TFTLCD requires the use of pins 1.8, 1.9, +# 1.10, 1.11, 3.3 and 2.1-9. +# ----------------------------------------------------------------------- +#CFG_TFTLCD = 1 +#CFG_TFTLCD_DRIVER = ILI9325 +#CFG_TFTLCD_INCLUDESMALLFONTS = 0 +#CFG_TFTLCD_USEAAFONTS = 0 +#CFG_TFTLCD_TS_DEFAULTTHRESHOLD = 50 +#CFG_TFTLCD_TS_KEYPADDELAY = 100 +# ========================================================================= +# +# +# ========================================================================= +# Monochrome/Bitmap Graphic LCDs +# ----------------------------------------------------------------------- +# +# CFG_ST7565 If defined, this will cause drivers for +# 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 (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. +# ----------------------------------------------------------------------- +##CFG_ST7565 = 1 +##CFG_SSD1306 = 1 +##CFG_SHARPMEM = 1 +# ========================================================================= +# +# +# ========================================================================= +# RSA Encryption +# ----------------------------------------------------------------------- +# +# CFG_RSA If defined, support for basic RSA +# encryption will be included. +# CFG_RSA_BITS Indicates the number of bits used for +# RSA encryption keys. To keep code size +# reasonable, RSA encryption is currently +# limited to using 64-bit or 32-bit numbers, +# with 64-bit providing higher security, and +# 32-bit providing smaller encrypted text +# size. +# +# NOTE: Please note that Printf can not be +# used to display 64-bit values (%lld)! +# ----------------------------------------------------------------------- +#CFG_RSA = 1 +#CFG_RSA_BITS = 32 +# ========================================================================= diff --git a/projectconfig.h b/projectconfig.h index d3743ce..91edb91 100644 --- a/projectconfig.h +++ b/projectconfig.h @@ -1,1381 +1,6 @@ -/**************************************************************************/ -/*! - @file projectconfig.h - @author K. Townsend (microBuilder.eu) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2012, microBuilder SARL - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ +// Configuration moved to projectconfig (without .h) #ifndef _PROJECTCONFIG_H_ -#define _PROJECTCONFIG_H_ - #include "lpc134x.h" #include "sysdefs.h" - -/*========================================================================= - BOARD SELECTION - - Because several boards use this code library with sometimes slightly - different pin configuration, you will need to specify which board you - are using by enabling one of the following definitions. The code base - will then try to configure itself accordingly for that board. - - CFG_BRD_LPC1343_REFDESIGN - ========================= - - microBuilder.eu LPC1343 Reference Design base board with - on-board peripherals initialised (EEPROM, USB or UART CLI, etc.) - - This is the recommended starting point for new development - since it makes it easy to send printf output to USB CDC, access - the on-board EEPROM, etc. - - CFG_BRD_LPC1343_REFDESIGN_MINIMAL - ================================= - - microBuilder.eu LPC1343 Reference Design base board with - only the most common peripherals initialised by default. - - Results in smallest code since EEPROM, USB, etc., are not - initialised on startup. By default, only the following - peripherals are initialised by systemInit(): - - - CPU (Configures the PLL, etc.) - - GPIO - - SysTick Timer - - UART (with printf support) * - - * Can be removed to save 0.8kb in debug and 0.3 kb in - release. Comment out 'CFG_PRINTF_UART' to disable it. - - The code size can be further reduced by several KB by removing - any IRQ Handlers that are not used. The I2C IRQHandler, for - example, uses ~1KB of flash in debug and ~400KB in release mode, - but because it is referenced in the startup code it is always - included even if I2C is never used in the project. - - Other IRQ Handlers that you might be able to comment out - to save some space are: - - IRQ Handler Debug Release - ------------------------- ------ ------- - I2C_IRQHandler 1160 b 400 b - SSP_IRQHandler 160 b 76 b - UART_IRQHandler 246 b 116 b - WAKEUP_IRQHandler 160 b 100 b - WDT_IRQHandler 50 b 28 b - - CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB - ==================================== - - microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with USB enabled - for the CLI interface. - - CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - ===================================== - - microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with UART enabled - for the CLI interface. - - CFG_BRD_LPC1343_802154USBSTICK - ============================== - - 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_MINIMAL - // #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 -/*=========================================================================*/ - - -/************************************************************************** - PIN USAGE - ----------------------------------------------------------------------- - This table tries to give an indication of which GPIO pins and - peripherals are used by the available drivers and SW examples. Only - dedicated GPIO pins available on the LPC1343 Reference Board are shown - below. Any unused peripheral blocks like I2C, SSP, ADC, etc., can - also be used as GPIO if they are available. - - PORT 1 PORT 2 PORT 3 - ========= ================= ======= - 8 9 10 11 1 2 3 4 5 6 7 8 9 0 1 2 3 - - SDCARD . . . . . . . . . . . . . X . . . - PWM . X . . . . . . . . . . . . . . . - STEPPER . . . . . . . . . . . . . X X X X - CHIBI X X X . . . . . . . . . . . . . . - ILI9325/8 X X X X X X X X X X X X X . . . X - 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 SPI . . . . X X X . X X . . . . . . . - SSD1351 . . . . X X X X X . . . . . . . . - MCP121 . . . . . . . . . . . . . . X . . - PN532 [3] . . . . . . . . . . . . . . X X . - - TIMERS SSP ADC UART - ====================== === ======= ==== - 16B0 16B1 32B0 32B1 0 0 1 2 3 0 - - SDCARD . . . . X . . . . . - PWM . X . . . . . . . . - PMU [1] . . X . . . . . . . - USB . . . X . . . . . . - STEPPER . . X . . . . . . . - CHIBI x . . . X . . . . . - ILI9325/8 . . . . . X X X X . - ST7565 . . . . . X X X X . - ST7535 . . . . . . . . . . - SHARPMEM . . . . . . . . . . - 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] P3.2 is only used with the I2C bus (for IRQ) - - **************************************************************************/ - - -/************************************************************************** - I2C Addresses - ----------------------------------------------------------------------- - The following addresses are used by the different I2C sensors included - in the code base [1] - - HEX BINARY - ==== ======== - ISL12022M (RTC) 0xDE 1101111x - ISL12022M (SRAM) 0xAE 1010111x - LM75B 0x90 1001000x - MCP24AA 0xA0 1010000x - 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 - - **************************************************************************/ - - -/*========================================================================= - FIRMWARE VERSION SETTINGS - -----------------------------------------------------------------------*/ - #define CFG_FIRMWARE_VERSION_MAJOR (1) - #define CFG_FIRMWARE_VERSION_MINOR (1) - #define CFG_FIRMWARE_VERSION_REVISION (0) -/*=========================================================================*/ - - -/*========================================================================= - CORE CPU SETTINGS - ----------------------------------------------------------------------- - - CFG_CPU_CCLK Value is for reference only. 'core/cpu/cpu.c' must - be modified to change the clock speed, but the value - should be indicated here since CFG_CPU_CCLK is used by - other peripherals to determine timing. - - -----------------------------------------------------------------------*/ - #define CFG_CPU_CCLK (72000000) // 1 tick = 13.88nS -/*=========================================================================*/ - - -/*========================================================================= - SYSTICK TIMER - ----------------------------------------------------------------------- - - CFG_SYSTICK_DELAY_IN_MS The number of milliseconds between each tick - of the systick timer. - - -----------------------------------------------------------------------*/ - #define CFG_SYSTICK_DELAY_IN_MS (1) -/*=========================================================================*/ - - -/*========================================================================= - 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 - - #ifdef CFG_BRD_LPC1343_LPCXPRESSO - // #define GPIO_ENABLE_IRQ0 - #define GPIO_ENABLE_IRQ1 - // #define GPIO_ENABLE_IRQ2 - // #define GPIO_ENABLE_IRQ3 - #endif -/*=========================================================================*/ - - -/*========================================================================= - ALTERNATE RESET PIN - ----------------------------------------------------------------------- - - CFG_ALTRESET If defined, indicates that a GPIO pin should be - configured as an alternate reset pin in addition - to the dedicated reset pin. - CFG_ALTRESET_PORT The GPIO port where the alt reset pin is located - CFG_ALTRESET_PIN The GPIO pin where the alt reset pin is located - - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_ALTRESET - #define CFG_ALTRESET_PORT (1) - #define CFG_ALTRESET_PIN (5) // P1.5 = RTS - #endif -/*=========================================================================*/ - - -/*========================================================================= - UART - ----------------------------------------------------------------------- - - CFG_UART_BAUDRATE The default UART speed. This value is used - when initialising UART, and should be a - standard value like 57600, 9600, etc. - NOTE: This value may be overridden if - another value is stored in EEPROM! - CFG_UART_BUFSIZE The length in bytes of the UART RX FIFO. This - will determine the maximum number of received - characters to store in memory. - - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - #define CFG_UART_BAUDRATE (115200) - #define CFG_UART_BUFSIZE (512) - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - #define CFG_UART_BAUDRATE (115200) - #define CFG_UART_BUFSIZE (512) - #endif - - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB - #define CFG_UART_BAUDRATE (115200) - #define CFG_UART_BUFSIZE (512) - #endif - - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_UART_BAUDRATE (57600) - #define CFG_UART_BUFSIZE (512) - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - #define CFG_UART_BAUDRATE (115200) - #define CFG_UART_BUFSIZE (512) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - #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 -/*=========================================================================*/ - - -/*========================================================================= - SSP - ----------------------------------------------------------------------- - - CFG_SSP0_SCKPIN_2_11 Indicates which pin should be used for SCK0 - CFG_SSP0_SCKPIN_0_6 - - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - #define CFG_SSP0_SCKPIN_2_11 - // #define CFG_SSP0_SCKPIN_0_6 - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - #define CFG_SSP0_SCKPIN_2_11 - // #define CFG_SSP0_SCKPIN_0_6 - #endif - - #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_SSP0_SCKPIN_2_11 - // #define CFG_SSP0_SCKPIN_0_6 - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - // #define CFG_SSP0_SCKPIN_2_11 - #define CFG_SSP0_SCKPIN_0_6 - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - #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 -/*=========================================================================*/ - - -/*========================================================================= - 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 - - #ifdef CFG_BRD_LPC1343_LPCXPRESSO - #define ADC_AVERAGING_ENABLE (0) - #define ADC_AVERAGING_SAMPLES (5) - #endif -/*=========================================================================*/ - - -/*========================================================================= - ON-BOARD LED - ----------------------------------------------------------------------- - - CFG_LED_PORT The port for the on board LED - CFG_LED_PIN The pin for the on board LED - CFG_LED_ON The pin state to turn the LED on (0 = low, 1 = high) - CFG_LED_OFF The pin state to turn the LED off (0 = low, 1 = high) - - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - #define CFG_LED_PORT (2) - #define CFG_LED_PIN (10) - #define CFG_LED_ON (0) - #define CFG_LED_OFF (1) - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - #define CFG_LED_PORT (2) - #define CFG_LED_PIN (10) - #define CFG_LED_ON (0) - #define CFG_LED_OFF (1) - #endif - - #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_LED_PORT (2) - #define CFG_LED_PIN (10) - #define CFG_LED_ON (0) - #define CFG_LED_OFF (1) - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - #define CFG_LED_PORT (3) - #define CFG_LED_PIN (2) - #define CFG_LED_ON (0) - #define CFG_LED_OFF (1) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - #define CFG_LED_PORT (3) - #define CFG_LED_PIN (2) - #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 -/*=========================================================================*/ - - -/*========================================================================= - MICRO-SD CARD - ----------------------------------------------------------------------- - - CFG_SDCARD If this field is defined SD Card and FAT32 - file system support will be included - CFG_SDCARD_READONLY If this is set to 1, all commands to - write to the SD card will be removed - saving some flash space. - CFG_SDCARD_CDPORT The card detect port number - CFG_SDCARD_CDPIN The card detect pin number - - NOTE: All config settings for FAT32 are defined - in ffconf.h - - BENCHMARK: With SPI set to 6.0MHz, FATFS can read - ~300KB/s (w/512 byte read buffer) - - PIN LAYOUT: The pin layout that is used by this driver - can be seen in the following schematic: - /tools/schematics/Breakout_TFTLCD_ILI9325_v1.3 - - DEPENDENCIES: SDCARD requires the use of SSP0. - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - // #define CFG_SDCARD - #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 - #define CFG_SDCARD_CDPORT (3) - #define CFG_SDCARD_CDPIN (0) - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - // #define CFG_SDCARD - #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 - #define CFG_SDCARD_CDPORT (3) - #define CFG_SDCARD_CDPIN (0) - #endif - - #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_SDCARD - #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 - #define CFG_SDCARD_CDPORT (3) - #define CFG_SDCARD_CDPIN (0) - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - // #define CFG_SDCARD - #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 - #define CFG_SDCARD_CDPORT (3) - #define CFG_SDCARD_CDPIN (0) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - // #define CFG_SDCARD - #define CFG_SDCARD_READONLY (1) // Must be 0 or 1 - #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 -/*=========================================================================*/ - - -/*========================================================================= - USB - ----------------------------------------------------------------------- - - CFG_USBHID If this field is defined USB HID support will - be included. Currently uses ROM-based USB HID - CFG_USBCDC If this field is defined USB CDC support will - be included, with the USB Serial Port speed - set to 115200 BPS by default - CFG_USBCDC_BAUDRATE The default TX/RX speed. This value is used - when initialising USBCDC, and should be a - standard value like 57600, 9600, etc. - CFG_USBCDC_INITTIMEOUT The maximum delay in milliseconds to wait for - USB to connect. Must be a multiple of 10! - CFG_USBCDC_BUFFERSIZE Size of the buffer (in bytes) that stores - printf data until it can be sent out in - 64 byte frames. The buffer is required since - only one frame per ms can be sent using USB - CDC (see 'puts' in systeminit.c). - - -----------------------------------------------------------------------*/ - #define CFG_USB_VID (0x239A) - #define CFG_USB_PID (0x1002) - - #ifdef CFG_BRD_LPC1343_REFDESIGN - // #define CFG_USBHID - #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (115200) - #define CFG_USBCDC_INITTIMEOUT (5000) - #define CFG_USBCDC_BUFFERSIZE (256) - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - // #define CFG_USBHID - // #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (115200) - #define CFG_USBCDC_INITTIMEOUT (5000) - #define CFG_USBCDC_BUFFERSIZE (256) - #endif - - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB - // #define CFG_USBHID - #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (115200) - #define CFG_USBCDC_INITTIMEOUT (5000) - #define CFG_USBCDC_BUFFERSIZE (256) - #endif - - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - // #define CFG_USBHID - // #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (57600) - #define CFG_USBCDC_INITTIMEOUT (5000) - #define CFG_USBCDC_BUFFERSIZE (256) - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - // #define CFG_USBHID - #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (115200) - #define CFG_USBCDC_INITTIMEOUT (5000) - #define CFG_USBCDC_BUFFERSIZE (256) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - // #define CFG_USBHID - #define CFG_USBCDC - #define CFG_USBCDC_BAUDRATE (115200) - #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 -/*=========================================================================*/ - - -/*========================================================================= - 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 - redirect to USB Serial - CFG_PRINTF_NEWLINE This is typically "\r\n" for Windows or - "\n" for *nix - - Note: If no printf redirection definitions are present, all printf - 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 -/*=========================================================================*/ - - -/*========================================================================= - COMMAND LINE INTERFACE - ----------------------------------------------------------------------- - - CFG_INTERFACE If this field is defined the UART or USBCDC - based command-line interface will be included - CFG_INTERFACE_MAXMSGSIZE The maximum number of bytes to accept for an - incoming command - CFG_INTERFACE_PROMPT The command prompt to display at the start - of every new data entry line - CFG_INTERFACE_SILENTMODE If this is set to 1 only text generated in - response to commands will be send to the - output buffer. The command prompt will not - be displayed and incoming text will not be - echoed back to the output buffer (allowing - you to see the text you have input). This - is normally only desirable in a situation - where another MCU is communicating with - the LPC1343. - CFG_INTERFACE_DROPCR If this is set to 1 all incoming \r - characters will be dropped - CFG_INTERFACE_ENABLEIRQ If this is set to 1 the IRQ pin will be - set high when a command starts executing - and will go low when the command has - finished executing or the LCD is not busy. - This allows another device to know when a - new command can safely be sent. - CFG_INTERFACE_IRQPORT The gpio port for the IRQ/busy pin - CFG_INTERFACE_IRQPIN The gpio pin number for the IRQ/busy pin - CFG_INTERFACE_SHORTERRORS If this is enabled only short 1 character - error messages will be returned (followed - by CFG_PRINTF_NEWLINE), rather than more - verbose error messages. The specific - characters used are defined below. - CFG_INTERFACE_CONFIRMREADY If this is set to 1 a text confirmation - will be sent when the command prompt is - ready for a new command. This is in - 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 - CFG_PRINTF_UART or CFG_PRINTF_USBCDC are - selected. - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - #define CFG_INTERFACE - #define CFG_INTERFACE_MAXMSGSIZE (256) - #define CFG_INTERFACE_PROMPT "LPC1343 >> " - #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 - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - // #define CFG_INTERFACE - #define CFG_INTERFACE_MAXMSGSIZE (256) - #define CFG_INTERFACE_PROMPT "LPC1343 >> " - #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 - - #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB - #define CFG_INTERFACE - #define CFG_INTERFACE_MAXMSGSIZE (256) - #define CFG_INTERFACE_PROMPT "CMD >> " - #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_SHORTERRORS_UNKNOWNCOMMAND "?" - #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 - #define CFG_INTERFACE - #define CFG_INTERFACE_MAXMSGSIZE (256) - #define CFG_INTERFACE_PROMPT ">>" - #define CFG_INTERFACE_SILENTMODE (1) - #define CFG_INTERFACE_DROPCR (1) - #define CFG_INTERFACE_ENABLEIRQ (1) - #define CFG_INTERFACE_IRQPORT (0) - #define CFG_INTERFACE_IRQPIN (7) - #define CFG_INTERFACE_SHORTERRORS (1) - #define CFG_INTERFACE_CONFIRMREADY (0) - #define CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND "?" - #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 - // #define CFG_INTERFACE - #define CFG_INTERFACE_MAXMSGSIZE (256) - #define CFG_INTERFACE_PROMPT "CMD >> " - #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 - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - #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 - - #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 -/*=========================================================================*/ - - -/*========================================================================= - PWM SETTINGS - ----------------------------------------------------------------------- - - CFG_PWM If this is defined, a basic PWM driver - will be included using 16-bit Timer 1 and - Pin 1.9 (MAT0) for the PWM output. In - order to allow for a fixed number of - pulses to be generated, some PWM-specific - code is required in the 16-Bit Timer 1 - ISR. See "core/timer16/timer16.c" for - more information. - CFG_PWM_DEFAULT_PULSEWIDTH The default pulse width in ticks - CFG_PWM_DEFAULT_DUTYCYCLE The default duty cycle in percent - - DEPENDENCIES: PWM output requires the use of 16-bit - timer 1 and pin 1.9 (CT16B1_MAT0). - -----------------------------------------------------------------------*/ - // #define CFG_PWM - #define CFG_PWM_DEFAULT_PULSEWIDTH (CFG_CPU_CCLK / 1000) - #define CFG_PWM_DEFAULT_DUTYCYCLE (50) -/*=========================================================================*/ - - -/*========================================================================= - STEPPER MOTOR SETTINGS - ----------------------------------------------------------------------- - - CFG_STEPPER If this is defined, a simple bi-polar - stepper motor will be included for common - H-bridge chips like the L293D or SN754410N - - DEPENDENCIES: STEPPER requires the use of pins 3.0-3 and - 32-bit Timer 0. - -----------------------------------------------------------------------*/ - // #define CFG_STEPPER -/*=========================================================================*/ - - -/*========================================================================= - EEPROM - ----------------------------------------------------------------------- - - CFG_I2CEEPROM If defined, drivers for the onboard EEPROM - will be included during build - CFG_I2CEEPROM_SIZE The number of bytes available on the EEPROM - - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - // #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif - - #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - // #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif - - #ifdef CFG_BRD_LPC1343_LPCXPRESSO - // #define CFG_I2CEEPROM - #define CFG_I2CEEPROM_SIZE (3072) - #endif -/*=========================================================================*/ - - -/*========================================================================= - EEPROM MEMORY MAP - ----------------------------------------------------------------------- - EEPROM is used to persist certain user modifiable values to make - sure that these changes remain in effect after a reset or hard - power-down. The addresses in EEPROM for these various system - settings/values are defined below. The first 256 bytes of EEPROM - are reserved for this (0x0000..0x00FF). - - CFG_EEPROM_RESERVED The last byte of reserved EEPROM memory - - EEPROM Address (0x0000..0x00FF) - =============================== - 0 1 2 3 4 5 6 7 8 9 A B C D E F - 000x x x x x x x x x . x x . . . . . Chibi - 001x . . . . . . . . . . . . . . . . - 002x x x x x . . . . . . . . . . . . UART - 003x x x x x x x x x x x x x x x x x Touch Screen Calibration - 004x x x x x x x x x x x x x x x . . Touch Screen Calibration - 005x . . . . . . . . . . . . . . . . - 006x . . . . . . . . . . . . . . . . - 007x . . . . . . . . . . . . . . . . - 008x . . . . . . . . . . . . . . . . - 009x . . . . . . . . . . . . . . . . - 00Ax . . . . . . . . . . . . . . . . - 00Bx . . . . . . . . . . . . . . . . - 00Cx . . . . . . . . . . . . . . . . - 00Dx . . . . . . . . . . . . . . . . - 00Ex . . . . . . . . . . . . . . . . - 00Fx . . . . . . . . . . . . . . . . - - -----------------------------------------------------------------------*/ - #define CFG_EEPROM_RESERVED (0x00FF) // Protect first 256 bytes of memory - #define CFG_EEPROM_CHIBI_IEEEADDR (uint16_t)(0x0000) // 8 - #define CFG_EEPROM_CHIBI_SHORTADDR (uint16_t)(0x0009) // 2 - #define CFG_EEPROM_UART_SPEED (uint16_t)(0x0020) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CALIBRATED (uint16_t)(0x0030) // 1 - #define CFG_EEPROM_TOUCHSCREEN_CAL_AN (uint16_t)(0x0031) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_BN (uint16_t)(0x0035) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_CN (uint16_t)(0x0039) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_DN (uint16_t)(0x003D) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_EN (uint16_t)(0x0041) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_FN (uint16_t)(0x0045) // 4 - #define CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER (uint16_t)(0x0049) // 4 - #define CFG_EEPROM_TOUCHSCREEN_THRESHHOLD (uint16_t)(0x004D) // 1 -/*=========================================================================*/ - - -/*========================================================================= - LM75B TEMPERATURE SENSOR - ----------------------------------------------------------------------- - - CFG_LM75B If defined, drivers for an optional LM75B - temperature sensor will be included during - build (requires external HW) - - -----------------------------------------------------------------------*/ - // #define CFG_LM75B -/*=========================================================================*/ - - -/*========================================================================= - CHIBI WIRELESS STACK - ----------------------------------------------------------------------- - - CFG_CHIBI If defined, the CHIBI wireless stack will be - included during build. Requires external HW. - CFG_CHIBI_MODE The mode to use when receiving and transmitting - wireless data. See chb_drvr.h for possible values - CFG_CHIBI_POWER The power level to use when transmitting. See - chb_drvr.h for possible values - CFG_CHIBI_CHANNEL 802.15.4 Channel (0 = 868MHz, 1-10 = 915MHz) - CFG_CHIBI_PANID 16-bit PAN Identifier (ex.0x1234) - CFG_CHIBI_PROMISCUOUS Set to 1 to enabled promiscuous mode or - 0 to disable it. If promiscuous mode is - enabled be sure to set CFG_CHIBI_BUFFERSIZE - to an appropriately large value (ex. 1024) - CFG_CHIBI_BUFFERSIZE The size of the message buffer in bytes - - DEPENDENCIES: Chibi requires the use of SSP0, 16-bit timer - 0 and pins 3.1, 3.2, 3.3. It also requires - the presence of CFG_I2CEEPROM. - - NOTE: These settings are not relevant to all boards! - 'tools/schematics/AT86RF212LPC1114_v1.6.pdf' - show how 'CHIBI' is meant to be connected - -----------------------------------------------------------------------*/ - #ifdef CFG_BRD_LPC1343_REFDESIGN - // #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 - - #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL - // #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 - - #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART - // #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 - - #ifdef CFG_BRD_LPC1343_802154USBSTICK - #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 (1024) - #endif - - #ifdef CFG_BRD_LPC1343_OLIMEX_P - // #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 - - #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 -/*=========================================================================*/ - - -/*========================================================================= - TFT LCD - ----------------------------------------------------------------------- - - CFG_TFTLCD If defined, this will cause drivers for - a pre-determined LCD screen to be included - during build. Only one LCD driver can be - included during the build process (for ex. - '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 - fonts are required since there is already - 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). - Should be an 8-bit value somewhere between - 8 and 75 in normal circumstances. This is - the default value and may be overriden by - a value stored in EEPROM. - CFG_TFTLCD_TS_KEYPADDELAY The delay in milliseconds between key - presses in dialogue boxes - - PIN LAYOUT: The pin layout that is used by this driver - can be seen in the following schematic: - /tools/schematics/Breakout_TFTLCD_ILI9325_v1.3 - - DEPENDENCIES: TFTLCD requires the use of pins 1.8, 1.9, - 1.10, 1.11, 3.3 and 2.1-9. - -----------------------------------------------------------------------*/ - #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 - - #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 - - #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 - - #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 - - #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 -/*=========================================================================*/ - - -/*========================================================================= - Monochrome/Bitmap Graphic LCDs - ----------------------------------------------------------------------- - - CFG_ST7565 If defined, this will cause drivers for - 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 (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 - // #define CFG_SSD1306 - // #define CFG_SHARPMEM -/*=========================================================================*/ - - -/*========================================================================= - RSA Encryption - ----------------------------------------------------------------------- - - CFG_RSA If defined, support for basic RSA - encryption will be included. - CFG_RSA_BITS Indicates the number of bits used for - RSA encryption keys. To keep code size - reasonable, RSA encryption is currently - limited to using 64-bit or 32-bit numbers, - with 64-bit providing higher security, and - 32-bit providing smaller encrypted text - size. - - NOTE: Please note that Printf can not be - used to display 64-bit values (%lld)! - -----------------------------------------------------------------------*/ - // #define CFG_RSA - #define CFG_RSA_BITS (32) -/*=========================================================================*/ - - - - -/*========================================================================= - CONFIG FILE VALIDATION - ------------------------------------------------------------------------- - Basic error checking to make sure that incompatible defines are not - enabled at the same time, etc. - - =========================================================================*/ - -#if !defined CFG_BRD_LPC1343_REFDESIGN && \ - !defined CFG_BRD_LPC1343_REFDESIGN_MINIMAL && \ - !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB && \ - !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART && \ - !defined 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 - #error "CFG_PRINTF_UART or CFG_PRINTF_USBCDC cannot both be defined at once" -#endif - -#if defined CFG_PRINTF_USBCDC && !defined CFG_USBCDC - #error "CFG_PRINTF_CDC requires CFG_USBCDC to be defined as well" -#endif - -#if defined CFG_USBCDC && defined CFG_USBHID - #error "Only one USB class can be defined at a time (CFG_USBCDC or CFG_USBHID)" -#endif - -#if defined CFG_SSP0_SCKPIN_2_11 && defined CFG_SSP0_SCKPIN_0_6 - #error "Only one SCK pin can be defined at a time for SSP0" -#endif - -#if !defined CFG_SSP0_SCKPIN_2_11 && !defined CFG_SSP0_SCKPIN_0_6 - #error "An SCK pin must be selected for SSP0 (CFG_SSP0_SCKPIN_2_11 or CFG_SSP0_SCKPIN_0_6)" -#endif - -#ifdef CFG_INTERFACE - #if !defined CFG_PRINTF_UART && !defined CFG_PRINTF_USBCDC - #error "CFG_PRINTF_UART or CFG_PRINTF_USBCDC must be defined for for CFG_INTERFACE Input/Output" - #endif - #if defined CFG_PRINTF_USBCDC && CFG_INTERFACE_SILENTMODE == 1 - #error "CFG_INTERFACE_SILENTMODE typically isn't enabled with CFG_PRINTF_USBCDC" - #endif -#endif - -#ifdef CFG_CHIBI - #if !defined CFG_I2CEEPROM - #error "CFG_CHIBI requires CFG_I2CEEPROM to store and retrieve addresses" - #endif - #ifdef CFG_SDCARD - #error "CFG_CHIBI and CFG_SDCARD can not be defined at the same time. Only one SPI block is available on the LPC1343." - #endif - #ifdef CFG_TFTLCD - #error "CFG_CHIBI and CFG_TFTLCD can not be defined at the same time since they both use pins 1.8, 1.9 and 1.10." - #endif - #ifdef CFG_PWM - #error "CFG_CHIBI and CFG_PWM can not be defined at the same time since they both use pin 1.9." - #endif - #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 - #ifdef CFG_ST7565 - #error "CFG_TFTLCD and CFG_ST7565 can not be defined at the same time." - #endif - #ifdef CFG_SSD1306 - #error "CFG_TFTLCD and CFG_SSD1306 can not be defined at the same time." - #endif - #ifdef CFG_SHARPMEM - #error "CFG_TFTLCD and CFG_SHARPMEM can not be defined at the same time." - #endif - #ifdef CFG_PWM - #error "CFG_TFTLCD and CFG_PWM can not be defined at the same time since they both use pin 1.9." - #endif - #if !defined CFG_I2CEEPROM - #error "CFG_TFTLCD requires CFG_I2CEEPROM to store and retrieve configuration settings" - #endif -#endif - -#ifdef CFG_SDCARD - #ifdef CFG_STEPPER - #error "CFG_SDCARD and CFG_STEPPER can not be defined at the same time since they both use pin 3.0." - #endif -#endif - -#ifdef CFG_ST7565 - #ifdef CFG_SSD1306 - #error "CFG_ST7565 and CFG_SSD1306 can not be defined at the same time" - #endif -#endif - -#ifdef CFG_RSA - #if CFG_RSA_BITS != 64 && CFG_RSA_BITS != 32 - #error "CFG_RSA_BITS must be equal to either 32 or 64." - #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