├── .gitignore ├── tools ├── examples │ ├── basics │ │ ├── blinky │ │ │ ├── readme.txt │ │ │ └── main.c │ │ ├── blinky_nonblocking │ │ │ └── readme.txt │ │ └── pwm_piezobuzzer │ │ │ └── readme.txt │ ├── sensors │ │ ├── tsl2561 │ │ │ ├── readme.txt │ │ │ └── main.c │ │ └── pn532 │ │ │ ├── MifareClassic_MemDump │ │ │ └── readme.txt │ │ │ ├── MifareUltralight_MemDump │ │ │ └── readme.txt │ │ │ └── ISO14443A_ID │ │ │ └── readme.txt │ ├── chibi │ │ ├── transmit │ │ │ └── readme.txt │ │ ├── receive │ │ │ └── readme.txt │ │ └── sniffer_wsbridge │ │ │ └── readme.txt │ ├── lcd │ │ └── tft │ │ │ ├── basic_ui │ │ │ └── basic_ui_screenshot.png │ │ │ ├── touchscreen │ │ │ └── readme.txt │ │ │ └── oscilloscope │ │ │ └── readme.txt │ ├── default │ │ ├── readme.txt │ │ └── main.c │ ├── spiflash │ │ └── erase_write_read │ │ │ └── readme.txt │ └── Readme.md ├── colors_h.png ├── lpcrc │ ├── bin │ │ ├── lpcrc-linux │ │ └── lpcrc.exe │ └── Makefile ├── codelite_debug │ ├── CM3.zip │ └── README.txt ├── dotfactory │ ├── TheDotFactory.exe │ ├── DotFactorySettings.png │ ├── DotFactorySettings_FixedWidth.png │ └── readme.txt ├── testfirmware │ └── blinky_usbcli.bin ├── wsbridge │ └── v0.50 │ │ ├── Win │ │ ├── wsbridge.suo │ │ ├── wsbridge │ │ │ ├── wsbridge.csproj.user │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── wsbridge.sln │ │ ├── Exe │ │ ├── Linux │ │ │ └── wsbridge │ │ └── Win │ │ │ └── wsbridge.exe │ │ └── Linux │ │ └── Makefile ├── validation │ ├── adctest │ │ ├── DCTest_100mV.xlsx │ │ ├── DCTest_1643mV.xlsx │ │ ├── DCTest_100mV_5SampleAveraging.xlsx │ │ ├── DCTest_1000mV_5SampleAveraging.xlsx │ │ ├── DCTest_1643mV_5SampleAveraging.xlsx │ │ └── abstract.txt │ ├── pwm │ │ └── pwmtest_100ticks_50percent.png │ ├── at86rf212_matching │ │ ├── lpc1343-dbmag-2pf.png │ │ ├── lpc1343-polar-2pf.png │ │ ├── lpc1343-smith-2pf.png │ │ ├── lpc1343-dbmag-2.4pf.png │ │ ├── lpc1343-dbmag-bare.png │ │ ├── lpc1343-polar-2.4pf.png │ │ ├── lpc1343-polar-bare.png │ │ ├── lpc1343-smith-2.4pf.png │ │ ├── lpc1343-smith-bare.png │ │ ├── lpc1343-dbmag-2.4pf-span1ghz.png │ │ ├── lpc1343-polar-2.4pf-span1ghz.png │ │ ├── lpc1343-smith-2.4pf-span1ghz.png │ │ ├── lpc1343-dbmag-2.4pf-cheapcable.png │ │ ├── lpc1343-polar-2.4pf-cheapcable.png │ │ └── lpc1343-smith-2.4pf-cheapcable.png │ └── startupdelay │ │ ├── StartupTime_GCCMakefile.png │ │ ├── StartupTime_CrossworksForARM.png │ │ ├── readme.txt │ │ └── main.c ├── schematics │ ├── LPC1343_BaseBoard_v1.6.png │ ├── LPC1343_StandAloneLCD_v1.2.png │ ├── LPC1343_StandAloneLCD_v1.3.png │ └── Breakout_TFTLCD_ILI9325_v1.3.png └── Readme.md ├── lpc134x.h ├── lpcrc.exe ├── drivers ├── displays │ ├── smallfonts.c │ ├── segment │ │ └── readme.txt │ ├── tft │ │ ├── fonts │ │ │ ├── dejavusans9.h │ │ │ ├── verdana9.h │ │ │ ├── verdana14.h │ │ │ ├── dejavusansbold9.h │ │ │ ├── dejavusansmono8.h │ │ │ ├── verdanabold14.h │ │ │ ├── dejavusansmonobold8.h │ │ │ ├── dejavusanscondensed9.h │ │ │ ├── veramono9.h │ │ │ ├── veramono11.h │ │ │ ├── veramonobold9.h │ │ │ └── veramonobold11.h │ │ ├── hw │ │ │ └── readme.txt │ │ ├── Readme.md │ │ ├── controls │ │ │ ├── hsbchart.h │ │ │ ├── huechart.h │ │ │ ├── label.h │ │ │ ├── button.h │ │ │ ├── labelcentered.h │ │ │ ├── progressbar.h │ │ │ └── label.c │ │ └── aafonts │ │ │ └── aa2 │ │ │ ├── DejaVuSansMono10_AA2.h │ │ │ ├── DejaVuSansMono13_AA2.h │ │ │ ├── DejaVuSansMono14_AA2.h │ │ │ ├── DejaVuSansCondensedBold14_AA2.h │ │ │ └── DejaVuSansCondensed14_AA2.h │ ├── bitmap │ │ └── readme.txt │ └── smallfonts.h ├── audio │ └── tea5767 │ │ └── tea5767.h ├── motor │ └── stepper │ │ ├── stepper.c │ │ └── stepper.h ├── sensors │ ├── ina219 │ │ └── ina219.c │ ├── tcs3414 │ │ └── tcs3414.c │ ├── analogjoystick │ │ └── analogjoystick.c │ ├── ds18b20 │ │ └── ds18b20.h │ └── lm75b │ │ └── lm75b.h ├── rf │ ├── pn532 │ │ ├── helpers │ │ │ ├── pn532_mifare_ultralight.h │ │ │ ├── pn532_mifare_classic.h │ │ │ └── pn532_mifare.h │ │ └── pn532_bus.h │ └── chibi │ │ ├── chb_buf.h │ │ ├── chb_eeprom.h │ │ ├── types.h │ │ ├── chb_spi.h │ │ └── chb_eeprom.c ├── fatfs │ ├── integer.h │ └── diskio.h ├── rsa │ └── rsa.h ├── Readme.md ├── rtc │ └── rtc.h ├── dac │ ├── mcp4901 │ │ └── mcp4901.h │ └── mcp4725 │ │ └── mcp4725.h └── storage │ └── eeprom │ ├── eeprom.h │ └── mcp24aa │ └── mcp24aa.h ├── core ├── pwm │ ├── pwmtest_100ticks_50percent.png │ └── pwm.h ├── usbcdc │ ├── cdc_buf.h │ ├── config.h │ ├── usbdesc.h │ ├── usbuser.h │ ├── cdcuser.h │ ├── usbhw.h │ └── usbcore.h ├── rom_drivers.h ├── iap │ ├── iap.c │ └── iap.h ├── wdt │ └── wdt.h ├── usbhid-rom │ ├── usbhid.h │ └── usbconfig.h ├── pmu │ └── pmu.h ├── adc │ └── adc.h ├── systick │ └── systick.h ├── cmd │ └── cmd.h ├── timer16 │ └── timer16.h └── uart │ └── uart.h ├── project ├── Readme.md ├── commands.h └── commands │ ├── cmd_reset.c │ ├── drawing │ ├── cmd_backlight.c │ ├── cmd_calibrate.c │ ├── cmd_gettext.c │ └── cmd_clear.c │ ├── cmd_lm75b_gettemp.c │ └── cmd_i2ceeprom_read.c ├── License.txt ├── sysinit.h ├── lpc1xxx ├── LPC1xxx_startup.c └── linkscript.ld ├── .project ├── sysdefs.h └── main.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.bin 3 | *.hex 4 | *.elf 5 | *.ld 6 | lpcrc 7 | -------------------------------------------------------------------------------- /tools/examples/basics/blinky/readme.txt: -------------------------------------------------------------------------------- 1 | Causes the LED to blink once per second -------------------------------------------------------------------------------- /lpc134x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/lpc134x.h -------------------------------------------------------------------------------- /lpcrc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/lpcrc.exe -------------------------------------------------------------------------------- /tools/colors_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/colors_h.png -------------------------------------------------------------------------------- /tools/lpcrc/bin/lpcrc-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/lpcrc/bin/lpcrc-linux -------------------------------------------------------------------------------- /tools/lpcrc/bin/lpcrc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/lpcrc/bin/lpcrc.exe -------------------------------------------------------------------------------- /drivers/displays/smallfonts.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/displays/smallfonts.c -------------------------------------------------------------------------------- /tools/codelite_debug/CM3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/codelite_debug/CM3.zip -------------------------------------------------------------------------------- /drivers/audio/tea5767/tea5767.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/audio/tea5767/tea5767.h -------------------------------------------------------------------------------- /drivers/motor/stepper/stepper.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/motor/stepper/stepper.c -------------------------------------------------------------------------------- /drivers/sensors/ina219/ina219.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/sensors/ina219/ina219.c -------------------------------------------------------------------------------- /drivers/sensors/tcs3414/tcs3414.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/sensors/tcs3414/tcs3414.c -------------------------------------------------------------------------------- /tools/dotfactory/TheDotFactory.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/dotfactory/TheDotFactory.exe -------------------------------------------------------------------------------- /tools/testfirmware/blinky_usbcli.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/testfirmware/blinky_usbcli.bin -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Win/wsbridge.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/wsbridge/v0.50/Win/wsbridge.suo -------------------------------------------------------------------------------- /core/pwm/pwmtest_100ticks_50percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/core/pwm/pwmtest_100ticks_50percent.png -------------------------------------------------------------------------------- /tools/dotfactory/DotFactorySettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/dotfactory/DotFactorySettings.png -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Exe/Linux/wsbridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/wsbridge/v0.50/Exe/Linux/wsbridge -------------------------------------------------------------------------------- /tools/examples/sensors/tsl2561/readme.txt: -------------------------------------------------------------------------------- 1 | Reads the mixed (visible + UV) and UV only luminosity levels 2 | using the TSL2561 digital light sensor. -------------------------------------------------------------------------------- /tools/validation/adctest/DCTest_100mV.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/adctest/DCTest_100mV.xlsx -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Exe/Win/wsbridge.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/wsbridge/v0.50/Exe/Win/wsbridge.exe -------------------------------------------------------------------------------- /tools/schematics/LPC1343_BaseBoard_v1.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/schematics/LPC1343_BaseBoard_v1.6.png -------------------------------------------------------------------------------- /tools/validation/adctest/DCTest_1643mV.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/adctest/DCTest_1643mV.xlsx -------------------------------------------------------------------------------- /drivers/sensors/analogjoystick/analogjoystick.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/drivers/sensors/analogjoystick/analogjoystick.c -------------------------------------------------------------------------------- /tools/examples/chibi/transmit/readme.txt: -------------------------------------------------------------------------------- 1 | Broadcasts a basic messages every 250 milliseconds that will be 2 | received by every node within hearing distance. -------------------------------------------------------------------------------- /tools/schematics/LPC1343_StandAloneLCD_v1.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/schematics/LPC1343_StandAloneLCD_v1.2.png -------------------------------------------------------------------------------- /tools/schematics/LPC1343_StandAloneLCD_v1.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/schematics/LPC1343_StandAloneLCD_v1.3.png -------------------------------------------------------------------------------- /tools/schematics/Breakout_TFTLCD_ILI9325_v1.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/schematics/Breakout_TFTLCD_ILI9325_v1.3.png -------------------------------------------------------------------------------- /tools/dotfactory/DotFactorySettings_FixedWidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/dotfactory/DotFactorySettings_FixedWidth.png -------------------------------------------------------------------------------- /tools/validation/pwm/pwmtest_100ticks_50percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/pwm/pwmtest_100ticks_50percent.png -------------------------------------------------------------------------------- /tools/examples/lcd/tft/basic_ui/basic_ui_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/examples/lcd/tft/basic_ui/basic_ui_screenshot.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-dbmag-2pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-dbmag-2pf.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-polar-2pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-polar-2pf.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-smith-2pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-smith-2pf.png -------------------------------------------------------------------------------- /tools/validation/startupdelay/StartupTime_GCCMakefile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/startupdelay/StartupTime_GCCMakefile.png -------------------------------------------------------------------------------- /tools/validation/adctest/DCTest_100mV_5SampleAveraging.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/adctest/DCTest_100mV_5SampleAveraging.xlsx -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-dbmag-bare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-dbmag-bare.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-polar-2.4pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-polar-2.4pf.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-polar-bare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-polar-bare.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-smith-2.4pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-smith-2.4pf.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-smith-bare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-smith-bare.png -------------------------------------------------------------------------------- /tools/examples/sensors/pn532/MifareClassic_MemDump/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/examples/sensors/pn532/MifareClassic_MemDump/readme.txt -------------------------------------------------------------------------------- /tools/validation/adctest/DCTest_1000mV_5SampleAveraging.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/adctest/DCTest_1000mV_5SampleAveraging.xlsx -------------------------------------------------------------------------------- /tools/validation/adctest/DCTest_1643mV_5SampleAveraging.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/adctest/DCTest_1643mV_5SampleAveraging.xlsx -------------------------------------------------------------------------------- /tools/validation/startupdelay/StartupTime_CrossworksForARM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/startupdelay/StartupTime_CrossworksForARM.png -------------------------------------------------------------------------------- /tools/examples/sensors/pn532/MifareUltralight_MemDump/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/examples/sensors/pn532/MifareUltralight_MemDump/readme.txt -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf-span1ghz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf-span1ghz.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-polar-2.4pf-span1ghz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-polar-2.4pf-span1ghz.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-smith-2.4pf-span1ghz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-smith-2.4pf-span1ghz.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf-cheapcable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-dbmag-2.4pf-cheapcable.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-polar-2.4pf-cheapcable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-polar-2.4pf-cheapcable.png -------------------------------------------------------------------------------- /tools/validation/at86rf212_matching/lpc1343-smith-2.4pf-cheapcable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microbuilder/LPC1343CodeBase/HEAD/tools/validation/at86rf212_matching/lpc1343-smith-2.4pf-cheapcable.png -------------------------------------------------------------------------------- /drivers/displays/segment/readme.txt: -------------------------------------------------------------------------------- 1 | Segment/LED Displays 2 | ==================== 3 | 4 | This folder contains drivers for LED-based segment displays 5 | 6 | AS1115 AS1115 segment-display driver 7 | -------------------------------------------------------------------------------- /tools/lpcrc/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | LD = gcc 3 | LDFLAGS = -Wall -O4 -std=c99 4 | EXES = lpcrc 5 | 6 | all: $(EXES) 7 | 8 | % : %.c 9 | $(LD) $(LDFLAGS) -o $@ $< 10 | 11 | clean: 12 | rm -f $(EXES) 13 | -------------------------------------------------------------------------------- /tools/examples/chibi/receive/readme.txt: -------------------------------------------------------------------------------- 1 | Looks for any incoming messages using the global broadcast address 2 | (0xFFFF) of this node's addresses and displays the message content 3 | using printf (redirect to UART by default). -------------------------------------------------------------------------------- /tools/examples/default/readme.txt: -------------------------------------------------------------------------------- 1 | This is the default main.c file used in the code base and will cause 2 | the test LED to blinks once per second and process any incoming data 3 | for the CLI if CFG_INTERFACE is enabled in projectconfig.h -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Linux/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CC = gcc 3 | CFLAGS = -c 4 | SOURCES = main.c 5 | OBJECTS = $(SOURCES:.c=.o) 6 | EXE = wsbridge 7 | 8 | all: $(SOURCES) $(EXE) 9 | 10 | $(EXE): $(OBJECTS) 11 | $(CC) $(OBJECTS) -o $@ 12 | 13 | %.o:%.c 14 | $(CC) $(CFLAGS) $< -o $@ 15 | 16 | clean: 17 | rm *.o 18 | -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/dejavusans9.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEJA_VU_SANS_9__ 2 | #define __DEJA_VU_SANS_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | extern const uint8_t dejaVuSans9ptCharBitmaps[]; 7 | extern const FONT_CHAR_INFO dejaVuSans9ptCharDescriptors[]; 8 | extern const FONT_INFO dejaVuSans9ptFontInfo; 9 | 10 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/verdana9.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERDANA_9__ 2 | #define __VERDANA_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Verdana 9pt */ 7 | extern const uint8_t verdana9ptBitmaps[]; 8 | extern const FONT_INFO verdana9ptFontInfo; 9 | extern const FONT_CHAR_INFO verdana9ptDescriptors[]; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/verdana14.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERDANA_14__ 2 | #define __VERDANA_14__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Verdana 14pt */ 7 | extern const uint8_t verdana14ptBitmaps[]; 8 | extern const FONT_INFO verdana14ptFontInfo; 9 | extern const FONT_CHAR_INFO verdana14ptDescriptors[]; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/dejavusansbold9.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEJA_VU_SANS_BOLD_9__ 2 | #define __DEJA_VU_SANS_BOLD_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | extern const uint8_t dejaVuSansBold9ptCharBitmaps[]; 7 | extern const FONT_CHAR_INFO dejaVuSansBold9ptCharDescriptors[]; 8 | extern const FONT_INFO dejaVuSansBold9ptFontInfo; 9 | 10 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/dejavusansmono8.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEJA_VU_SANS_MONO_8__ 2 | #define __DEJA_VU_SANS_MONO_8__ 3 | 4 | #include "../fonts.h" 5 | 6 | extern const uint8_t dejaVuSansMono8ptCharBitmaps[]; 7 | extern const FONT_CHAR_INFO dejaVuSansMono8ptCharDescriptors[]; 8 | extern const FONT_INFO dejaVuSansMono8ptFontInfo; 9 | 10 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/verdanabold14.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERDANA_BOLD_14__ 2 | #define __VERDANA_BOLD_14__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Verdana Bold 14pt */ 7 | extern const uint8_t verdanabold14ptBitmaps[]; 8 | extern const FONT_INFO verdanabold14ptFontInfo; 9 | extern const FONT_CHAR_INFO verdanabold14ptDescriptors[]; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/dejavusansmonobold8.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEJA_VU_SANS_MONO_BOLD_8__ 2 | #define __DEJA_VU_SANS_MONO_BOLD_8__ 3 | 4 | #include "../fonts.h" 5 | 6 | extern const uint8_t dejaVuSansMonoBold8ptCharBitmaps[]; 7 | extern const FONT_CHAR_INFO dejaVuSansMonoBold8ptCharDescriptors[]; 8 | extern const FONT_INFO dejaVuSansMonoBold8ptFontInfo; 9 | 10 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/dejavusanscondensed9.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEJA_VU_SANS_CONDENSED_9__ 2 | #define __DEJA_VU_SANS_CONDENSED_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | extern const uint8_t dejaVuSansCondensed9ptCharBitmaps[]; 7 | extern const FONT_CHAR_INFO dejaVuSansCondensed9ptCharDescriptors[]; 8 | extern const FONT_INFO dejaVuSansCondensed9ptFontInfo; 9 | 10 | #endif -------------------------------------------------------------------------------- /tools/examples/basics/blinky_nonblocking/readme.txt: -------------------------------------------------------------------------------- 1 | Causes the LED to blink once per second using a non-blocking delay, as well 2 | as constantly checking the UART or USB CDC buffer for incoming data to be 3 | passed to the CLI. You can connect to the CLI using UART or USB, send and 4 | receive commands, and the LED should continue blinking (as long as a command 5 | is not using the MCU). -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/veramono9.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERA_MONO_9__ 2 | #define __VERA_MONO_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Bitstream Vera Sans Mono 9pt */ 7 | extern const uint8_t bitstreamVeraSansMono9ptCharBitmaps[]; 8 | extern const FONT_CHAR_INFO bitstreamVeraSansMono9ptCharDescriptors[]; 9 | extern const FONT_INFO bitstreamVeraSansMono9ptFontInfo; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/veramono11.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERA_MONO_11__ 2 | #define __VERA_MONO_11__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Bitstream Vera Sans Mono 11pt */ 7 | extern const uint8_t bitstreamVeraSansMono11ptCharBitmaps[]; 8 | extern const FONT_CHAR_INFO bitstreamVeraSansMono11ptCharDescriptors[]; 9 | extern const FONT_INFO bitstreamVeraSansMono11ptFontInfo; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/veramonobold9.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERA_MONO_BOLD_9__ 2 | #define __VERA_MONO_BOLD_9__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Bitstream Vera Sans Mono Bold 9pt */ 7 | extern const uint8_t bitstreamVeraSansMonoBold9ptCharBitmaps[]; 8 | extern const FONT_CHAR_INFO bitstreamVeraSansMonoBold9ptCharDescriptors[]; 9 | extern const FONT_INFO bitstreamVeraSansMonoBold9ptFontInfo; 10 | 11 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/fonts/veramonobold11.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERA_MONO_BOLD_11__ 2 | #define __VERA_MONO_BOLD_11__ 3 | 4 | #include "../fonts.h" 5 | 6 | /* Font data for Bitstream Vera Sans Mono Bold 11pt */ 7 | extern const uint8_t bitstreamVeraSansMonoBold11ptCharBitmaps[]; 8 | extern const FONT_CHAR_INFO bitstreamVeraSansMonoBold11ptCharDescriptors[]; 9 | extern const FONT_INFO bitstreamVeraSansMonoBold11ptFontInfo; 10 | 11 | #endif -------------------------------------------------------------------------------- /tools/dotfactory/readme.txt: -------------------------------------------------------------------------------- 1 | The Dot Factory is a GPL license program that can be used to 2 | convert TTF fonts for .c files. The latest Windows binary 3 | and source files can be found at: 4 | 5 | http://www.pavius.net/downloads/tools/53-the-dot-factory 6 | 7 | The binary files are included here purely for 8 | convenience sake. 9 | 10 | The following fonts are used in the LPC1343 11 | Code Base: 12 | 13 | DejaVu - http://dejavu-fonts.org/wiki/Main_Page 14 | Bitsream Vera - http://www.gnome.org/fonts/ -------------------------------------------------------------------------------- /tools/examples/lcd/tft/touchscreen/readme.txt: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | ============================================================ 3 | This example continually samples the touch screen and 4 | whenever a valid reading occurs draws a pixel at the 5 | corresponding X/Y position. 6 | 7 | This sample demonstrates the following features 8 | ============================================================ 9 | 10 | - Waiting for a valid TS reading (ignoring X/Y mismatches) 11 | - Getting the X/Y position from TS events 12 | -------------------------------------------------------------------------------- /tools/examples/basics/pwm_piezobuzzer/readme.txt: -------------------------------------------------------------------------------- 1 | This example uses a 16-bit timer for PWM, and makes a common 2 | piezo buzzer beep briefly once per second at an alternating 3 | frequency. 4 | 5 | The piezo-buzzer used in this example is the PS1240, available 6 | from Adafruit Industries at: 7 | 8 | http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=160 9 | 10 | The buzzer should have one pin (either is fine) connected to P1.9 11 | on the LPC1343, and the other pin connected to GND. CFG_PWM must also 12 | be enabled in projectconfig.h. -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Win/wsbridge/wsbridge.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | publish\ 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | en-US 13 | false 14 | 15 | -------------------------------------------------------------------------------- /drivers/rf/pn532/helpers/pn532_mifare_ultralight.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pn532_mifare_ultralight.h 4 | */ 5 | /**************************************************************************/ 6 | 7 | #ifndef __PN532_MIFARE_ULTRALIGHT_H__ 8 | #define __PN532_MIFARE_ULTRALIGHT_H__ 9 | 10 | #include "projectconfig.h" 11 | #include "pn532_mifare.h" 12 | 13 | pn532_error_t pn532_mifareultralight_WaitForPassiveTarget (byte_t * pbtCUID, size_t * szCUIDLen); 14 | pn532_error_t pn532_mifareultralight_ReadPage (uint8_t page, byte_t * pbtBuffer); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /drivers/displays/bitmap/readme.txt: -------------------------------------------------------------------------------- 1 | Bitmap LCDs 2 | =========== 3 | 4 | This folder contains drivers for 1-bit graphic LCDs (128x64 pixel ST7565, etc.) 5 | or text-only displays. They are placed in a seperate folder because the 6 | drawing routines are handled quite differently than the generic drawing code 7 | for 16-bit TFT LCDs. 8 | 9 | SHARPMEM Basic driver for Sharp memory displays. 10 | ST7565 Driver for 128x64 pixel I2C-based displays (available from 11 | Adafruit Industries, for example). 12 | SSD1306 Driver for 128x64 pixel OLED displays (also available from 13 | Adafruit Industries). Supports I2C and SPI. 14 | -------------------------------------------------------------------------------- /tools/examples/chibi/sniffer_wsbridge/readme.txt: -------------------------------------------------------------------------------- 1 | Uses 'PROMISCUOUS' mode in Chibi, which listens to ANY message available within 2 | hearing range, and retransmits the raw frame data over UART in libpcap format. 3 | Using the open source 'wsbridge' application (tools/wsbridge), the data can 4 | be piped into wireshark on any Windows or Linux PC. This useful functionality 5 | is perfect for debugging wireless sensor networks since you can capture, log and 6 | analyse all traffic and frame data moving around the wireless sensor network. 7 | 8 | For more information on wsbridge see: 9 | http://freaklabs.org/index.php/Tutorials/Software/Feeding-the-Shark-Turning-the-Freakduino-into-a-Realtime-Wireless-Protocol-Analyzer-with-Wireshark.html -------------------------------------------------------------------------------- /drivers/rf/pn532/helpers/pn532_mifare_classic.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pn532_mifare_classic.h 4 | */ 5 | /**************************************************************************/ 6 | 7 | #ifndef __PN532_MIFARE_CLASSIC_H__ 8 | #define __PN532_MIFARE_CLASSIC_H__ 9 | 10 | #include "projectconfig.h" 11 | #include "pn532_mifare.h" 12 | 13 | pn532_error_t pn532_mifareclassic_WaitForPassiveTarget (byte_t * pbtCUID, size_t * szCUIDLen); 14 | pn532_error_t pn532_mifareclassic_AuthenticateBlock (byte_t * pbtCUID, size_t szCUIDLen, uint32_t uiBlockNumber, uint8_t uiKeyType, byte_t * pbtKeys); 15 | pn532_error_t pn532_mifareclassic_ReadDataBlock (uint8_t uiBlockNumber, byte_t * pbtData); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /tools/examples/spiflash/erase_write_read/readme.txt: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | ============================================================ 3 | This example will erae one 4KB page of SPI Flash, write 4 | 8 bytes worth of data, and then read back 16 bytes of 5 | data to show how all three operations work. 6 | 7 | HOW TO USE THIS EXAMPLE 8 | ============================================================ 9 | 1.) Connect the SPI Flash to SPI on the LPC1343 10 | 11 | 2.) Configure your terminal software to open the USB COM 12 | port at 115K. 13 | 14 | 3.) When the application starts, there is a 5 second delay 15 | (to allow you time to connect via USB CDC), after which 16 | point the device will run through the erase, write, read 17 | sequence once and then wait in an infinite loop. 18 | -------------------------------------------------------------------------------- /tools/codelite_debug/README.txt: -------------------------------------------------------------------------------- 1 | This slightly modified debug DLL can be used to allow full step-through and HW debugging in CodeLite using a Segger J-Link. 2 | 3 | It was created by AC Verbeck, and the original announcement can be found here: 4 | 5 | http://codelite.org/forum/viewtopic.php?f=11&t=1537 6 | 7 | To include debug information in the compiled firmware, open the make file and set the following field to TRUE 8 | 9 | -------------- 10 | 11 | ########################################################################## 12 | # Debug settings 13 | ########################################################################## 14 | 15 | # Set DEBUGBUILD to 'TRUE' for full debugging (larger, slower binaries), 16 | # or to 'FALSE' for release builds (smallest, fastest binaries) 17 | DEBUGBUILD = FALSE 18 | 19 | -------------- -------------------------------------------------------------------------------- /drivers/fatfs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _INTEGER 6 | 7 | #if 0 8 | #include 9 | #else 10 | 11 | /* These types must be 16-bit, 32-bit or larger integer */ 12 | typedef int INT; 13 | typedef unsigned int UINT; 14 | 15 | /* These types must be 8-bit integer */ 16 | typedef signed char CHAR; 17 | typedef unsigned char UCHAR; 18 | typedef unsigned char BYTE; 19 | 20 | /* These types must be 16-bit integer */ 21 | typedef short SHORT; 22 | typedef unsigned short USHORT; 23 | typedef unsigned short WORD; 24 | typedef unsigned short WCHAR; 25 | 26 | /* These types must be 32-bit integer */ 27 | typedef long LONG; 28 | typedef unsigned long ULONG; 29 | typedef unsigned long DWORD; 30 | 31 | #endif 32 | 33 | #define _INTEGER 34 | #endif 35 | -------------------------------------------------------------------------------- /core/usbcdc/cdc_buf.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * Name: cdc_buf.h 3 | * Purpose: usb cdc buffer handling 4 | * Version: V1.00 5 | *---------------------------------------------------------------------------*/ 6 | 7 | #ifndef __CDC_BUF_H__ 8 | #define __CDC_BUF_H__ 9 | 10 | #include "projectconfig.h" 11 | 12 | // Buffer used for circular fifo 13 | typedef struct _cdc_buffer_t 14 | { 15 | volatile uint8_t len; 16 | volatile uint8_t wr_ptr; 17 | volatile uint8_t rd_ptr; 18 | uint8_t buf[CFG_USBCDC_BUFFERSIZE]; 19 | } cdc_buffer_t; 20 | 21 | cdc_buffer_t * cdcGetBuffer(); 22 | void cdcBufferInit(); 23 | uint8_t cdcBufferRead(); 24 | uint32_t cdcBufferReadLen(uint8_t* buf, uint32_t len); 25 | void cdcBufferWrite(uint8_t data); 26 | void cdcBufferClearFIFO(); 27 | uint8_t cdcBufferDataPending(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /tools/validation/startupdelay/readme.txt: -------------------------------------------------------------------------------- 1 | This simple code can be used to test the startup delay, or more precisely 2 | the delay between the moment that reset is deasserted and code execution 3 | begins in main(). 4 | 5 | GPIO pin 2.1 is set to output and high as soon as main is entered, so you 6 | simply need to monitor the reset line and GPIO 2.1 on a two-channel 7 | oscilliloscope, and measure the delay between the two rising edges. 8 | 9 | Two sample tests results are showing for GCC with a Makefile and with 10 | Crossworks for ARM. Both examples are included since the startup code 11 | for both project types is slightly different, with Crossworks using a 12 | custom startup file provided by Rowley Associates, and the LPC1343 13 | Code Base using it's own startup code when compiling with make and GCC. 14 | 15 | Note: This code is only useful for measuring the time coming out of 16 | reset, not from a cold boot (applying power to an unpowered device). -------------------------------------------------------------------------------- /drivers/rf/pn532/helpers/pn532_mifare.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pn532_mifare.h 4 | */ 5 | /**************************************************************************/ 6 | 7 | #ifndef __PN532_MIFARE_H__ 8 | #define __PN532_MIFARE_H__ 9 | 10 | #include "projectconfig.h" 11 | 12 | // These may need to be enlarged for multi card support 13 | #define PN532_RESPONSELEN_INLISTPASSIVETARGET (64) 14 | #define PN532_RESPONSELEN_INDATAEXCHANGE (64) 15 | 16 | typedef enum pn532_mifare_cmd_e 17 | { 18 | PN532_MIFARE_CMD_AUTH_A = 0x60, 19 | PN532_MIFARE_CMD_AUTH_B = 0x61, 20 | PN532_MIFARE_CMD_READ = 0x30, 21 | PN532_MIFARE_CMD_WRITE = 0xA0, 22 | PN532_MIFARE_CMD_TRANSFER = 0xB0, 23 | PN532_MIFARE_CMD_DECREMENT = 0xC0, 24 | PN532_MIFARE_CMD_INCREMENT = 0xC1, 25 | PN532_MIFARE_CMD_STORE = 0xC2 26 | } 27 | pn532_mifare_cmd_t; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /tools/validation/adctest/abstract.txt: -------------------------------------------------------------------------------- 1 | This test program will read 1K samples from the ADC, 2 | and send the results in CSV format out via USB CDC. 3 | 4 | The test results can be pasted into Excel and analyzed 5 | to better understand the ADC performance. 6 | 7 | There appears to be a couple LSB of variation on the ADC 8 | of the LPC1343 Reference Design, including some fairly 9 | large one-off peaks and valleys. 10 | 11 | As a result of these tests, and additional flag was added 12 | to the code base to enable the ADC code to optionally take 13 | a number of readings and return an average result, which 14 | helps reduce the effect of individual peaks or dips in the 15 | ADC. 16 | 17 | Results of the tests with and without averaging can be 18 | seen in the included excel spreadsheets, showing min, max 19 | and stddev for the range of data captured. 20 | 21 | As was expected, the ADC seems to perform better towards the 22 | middle of the range than on the lower end. -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Win/wsbridge.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wsbridge", "wsbridge\wsbridge.csproj", "{9CAFA529-8FF4-42D4-B6A6-54992B3BB40F}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {9CAFA529-8FF4-42D4-B6A6-54992B3BB40F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {9CAFA529-8FF4-42D4-B6A6-54992B3BB40F}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {9CAFA529-8FF4-42D4-B6A6-54992B3BB40F}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {9CAFA529-8FF4-42D4-B6A6-54992B3BB40F}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /drivers/displays/tft/hw/readme.txt: -------------------------------------------------------------------------------- 1 | HW-Specific TFT and RGB OLED Drivers 2 | ==================================== 3 | 4 | hx8340b - 176x220 16-bit display (Bit-banged SPI interface) 5 | hx8347g - 240x320 16-bit display (8-bit interface) 6 | hx8347h - 240x320 16-bit display (Hardware SPI via SSP0) 7 | ILI9325 - 240x320 16-bit display (8-bit interface) 8 | ILI9328 - 240x320 16-bit display (8-bit interface) 9 | st7735 - 128x160 16-bit display (Bit-banged SPI interface) 10 | st7783 - 240x320 16-bit display (8-bit interface) 11 | ssd1331 - 96x64 16-bit OLED display (Bit-banged SPI interface) 12 | ssd1351 - 128x128 16-bit OLED display (Bit-banged SPI interface) 13 | 14 | NOTE: Only ILI9328 driver have been fully tested. The others may 15 | be incomplete, or have only been partially tested. (The 16 | ST7783 driver, for example, has issues when the screen orientation 17 | is set to landscape.) The basic initialisation sequences should 18 | all work, but some further optimisation is likely required on some 19 | of these to get the best possible performance out of them. -------------------------------------------------------------------------------- /tools/examples/Readme.md: -------------------------------------------------------------------------------- 1 | # Examples Folder 2 | 3 | This folder contains a number of examples that should help you get 4 | starting with the LPC1343 and the codebase. For the most part, 5 | you simply need to copy the appropriate main.c file to the root 6 | folder of the code base, and recompile in your IDE or by running 7 | 'make clean' followed by 'make'. 8 | 9 | ## basics 10 | 11 | Basic examples like blinky to get started. 12 | 13 | ## chibi 14 | 15 | Examples for Chibi, a light-weight 802.15.4 wireless stack. These 16 | examples are based on custom HW (using the AT86RF212), and some HW 17 | examples of using this chip are available at http://www.microbuilder.eu 18 | 19 | ## default 20 | 21 | This folder contains the default main.c file delivered in a clean 22 | installation of the LPC1343 CodeBase. 23 | 24 | ## lcd 25 | 26 | Examples related to various display drivers. 27 | 28 | ## sensors 29 | 30 | Examples of using various sensor, like the I2C base LM75B temp sensor, etc. 31 | 32 | ## spiflash 33 | 34 | A simple example of using SPI flash with the LPC1343. 35 | -------------------------------------------------------------------------------- /project/Readme.md: -------------------------------------------------------------------------------- 1 | # Project 2 | 3 | All project-specific files should be stored in the /project folder to try to 4 | keep the generic HW-level code and drivers seperate from the business logic 5 | of your individual project. This makes it easier to reuse your code in other 6 | projects, and also update the drivers and HW-level code if newer version of 7 | these common-files become available. 8 | 9 | ## commands/ 10 | 11 | Code to implements specific commands for the command-line interface. Requires 12 | CFG_INTERFACE to be enabled in projectconfig.h. Generally, each command will 13 | be stored in a seperate file(ex.: "command/cmd_hello.c"), though this isn't a 14 | strict requirement and you may wish to store multiple related commands in one 15 | .c file, such as 'cmds_graphics.c' etc. 16 | 17 | # FILES 18 | 19 | ## cmd_tbl.h 20 | 21 | Contains the master command list for the command-line interface if 22 | CFG_INTERFACE is enabled in projectconfig.h. All commands must be present 23 | in this list to be properly handled by the CLI. 24 | 25 | ## commands.c 26 | 27 | Common helper functions for the command-line interface. 28 | 29 | -------------------------------------------------------------------------------- /drivers/displays/tft/Readme.md: -------------------------------------------------------------------------------- 1 | # TFT/OLED Graphics Sub-System 2 | 3 | The LPC1343 Code Base includes a reasonably complete graphic 4 | sub-system that can be used with a variety of RGB565 TFT or OLED 5 | displays. 6 | 7 | It includes all the basic drawing primitives you'd expect, as well 8 | as color conversion and alpha-blending, support for bitmap and 9 | anti-aliased fonts, loading and saving of bitmap images (from/to an 10 | SD card or elsewhere), and a few basic controls to help you get 11 | started developing your own custom look and feel in your application. 12 | 13 | The core drawing routines (/drivers/displays/tft/drawing.c) are 14 | seperated from the actual HW (/drivers/displays/tft/hw/*) so that 15 | the underlying display can be easily changed without having to 16 | significantly modify your project code. 17 | 18 | A number of drivers are provided for common displays and controllers, 19 | and it's relatively straight-forward to extend the library to support 20 | new ones: you simply need to implement the set of functions defined 21 | in lcd.h, and the graphics sub-system will call these functions 22 | directly when rendering any text, graphics, etc.. 23 | 24 | ## Documentation 25 | 26 | Complete documentation for the graphics sub-system is available 27 | online at microbuilder.eu: 28 | 29 | http://www.microbuilder.eu/Projects/LPC1343ReferenceDesign/TFTLCDAPI_v1_1_0.aspx 30 | -------------------------------------------------------------------------------- /core/usbcdc/config.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * config.h: config file for usbcdc example for NXP LPC13xx Family 3 | * Microprocessors 4 | * 5 | * Copyright(C) 2008, NXP Semiconductor 6 | * All rights reserved. 7 | * 8 | * History 9 | * 2008.07.19 ver 1.00 Preliminary version, first Release 10 | * 11 | ******************************************************************************/ 12 | 13 | /* 14 | Overview: 15 | This example shows how to use the USB driver to implement a CDC class USB peripheral. 16 | To run this example, you must attach a USB cable to the board. See 17 | the "Getting Started Guide" appendix for details. 18 | 19 | How to use: 20 | Click the debug toolbar button. 21 | Click the go button. 22 | Plug the LPCXpresso's target side into a PC using a USB cable retrofit 23 | or a 3rd party base board. 24 | 25 | * You should be able to see a new COM port on your PC. 26 | */ 27 | 28 | #include "projectconfig.h" 29 | 30 | #define USB_VENDOR_ID CFG_USB_VID // Vendor ID 31 | #define USB_PROD_ID CFG_USB_PID // Product ID 32 | #define USB_DEVICE 0x0100 // Device ID 33 | 34 | #define LED_PORT 0 // Port for led 35 | #define LED_BIT 7 // Bit on port for led 36 | 37 | 38 | /********************************************************************************* 39 | ** End Of File 40 | *********************************************************************************/ 41 | -------------------------------------------------------------------------------- /drivers/rsa/rsa.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file rsa.h 4 | @author Kyle Loudon 5 | modified: microBuilder.eu 6 | @date 4 January, 2010 7 | @version 1.0 8 | 9 | Basic RSA-encryption using 64-bit math (32-bit keys). 10 | 11 | Based on the examples from "Mastering Algorithms with C" by 12 | Kyle Loudon (O'Reilly, 1999). 13 | */ 14 | /**************************************************************************/ 15 | 16 | #ifndef _RSA_H_ 17 | #define _RSA_H_ 18 | 19 | #include "projectconfig.h" 20 | 21 | /* In a secure implementation, huge_t should be at least 400 decimal digits, * 22 | * instead of the 20 provided by a 64-bit value. This means that key values * 23 | * can be no longer than 10 digits in length in the current implementation. */ 24 | #if CFG_RSA_BITS == 64 25 | typedef uint64_t huge_t; 26 | #endif 27 | #if CFG_RSA_BITS == 32 28 | typedef uint32_t huge_t; 29 | #endif 30 | 31 | /* Structure for RSA public keys. */ 32 | typedef struct rsaPubKey_s 33 | { 34 | huge_t e; 35 | huge_t n; 36 | } 37 | rsaPubKey_t; 38 | 39 | /* Define a structure for RSA private keys. */ 40 | typedef struct rsaPriKey_s 41 | { 42 | huge_t d; 43 | huge_t n; 44 | } 45 | rsaPriKey_t; 46 | 47 | void rsaTest(); 48 | void rsaEncrypt(huge_t plaintext, huge_t *ciphertext, rsaPubKey_t pubkey); 49 | void rsaDecrypt(huge_t ciphertext, huge_t *plaintext, rsaPriKey_t prikey); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /tools/wsbridge/v0.50/Win/wsbridge/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("pcap")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("pcap")] 13 | [assembly: AssemblyCopyright("Copyright © 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("75eb0967-9c50-430e-a562-d0f7bee8f2cc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /drivers/Readme.md: -------------------------------------------------------------------------------- 1 | # Drivers 2 | 3 | This folder contains basic drivers for a number of HW peripherals, 4 | and a few SW stacks (FAT32, a light-weight 802.15.4 wireless stack 5 | named Chibi, etc.). It also contains a basic but relatively robust 6 | graphic library with support for display custom fonts, loading and 7 | saving Bitmap images, touch screen calibration, etc. 8 | 9 | ## dac 10 | 11 | Digital to Analog Converters 12 | 13 | ## displays 14 | 15 | Drivers and functions to work with a wide variety of display types. 16 | 17 | This folder is sub-divided into the following categories: 18 | 19 | /bitmap Monochrome displays such as basic OLEDs, and 128x64 pixel 20 | graphic displays 21 | 22 | /character Text-only displays (VFD, etc.) 23 | 24 | /segment Segment displays (8x8 LED arrays, 7-segment displays, etc.) 25 | 26 | /tft Color graphical displays, such as TFT LCDs, RGB OLEDs, etc. 27 | This folder also contains a small graphics library, code to 28 | load and save bitmap images, and functions to work with 29 | several font types. 30 | 31 | ## fatfs 32 | 33 | Chan's FATFS, enabling you to read and write to inexpensive SD cards 34 | 35 | ## motor 36 | 37 | Motor-control related drivers 38 | 39 | ## rf 40 | 41 | Anything related to RF, including NFC and 802.15.4 wireless 42 | 43 | ## rsa 44 | 45 | A very minimal example of RSA encryption and decryption 46 | 47 | ## sensors 48 | 49 | Drivers for a variety of sensors (light, temperature, etc.) 50 | 51 | ## storage 52 | 53 | Drivers for different types of storage, such as SPI NOR flash, EEPROM, etc. 54 | -------------------------------------------------------------------------------- /core/rom_drivers.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file rom_drivers.h 4 | @author NXP Semiconductor 5 | */ 6 | /**************************************************************************/ 7 | 8 | #ifndef ROM_DRIVERS_H_ 9 | #define ROM_DRIVERS_H_ 10 | 11 | #include "sysdefs.h" 12 | 13 | typedef struct _USB_DEVICE_INFO 14 | { 15 | uint16_t DevType; 16 | uint32_t DevDetailPtr; 17 | } USB_DEV_INFO; 18 | 19 | typedef struct _USBD 20 | { 21 | void (*init_clk_pins)(void); 22 | void (*isr)(void); 23 | void (*init)( USB_DEV_INFO * DevInfoPtr ); 24 | void (*connect)(uint32_t con); 25 | } USBD; 26 | 27 | typedef struct _ROM 28 | { 29 | const USBD * pUSBD; 30 | } ROM; 31 | 32 | typedef struct _MSC_DEVICE_INFO { 33 | uint16_t idVendor; 34 | uint16_t idProduct; 35 | uint16_t bcdDevice; 36 | uint32_t StrDescPtr; 37 | uint32_t MSCInquiryStr; 38 | uint32_t BlockCount; 39 | uint32_t BlockSize; 40 | uint32_t MemorySize; 41 | void (*MSC_Write)( uint32_t offset, uint8_t src[], uint32_t length); 42 | void (*MSC_Read)( uint32_t offset, uint8_t dst[], uint32_t length); 43 | } MSC_DEVICE_INFO; 44 | 45 | typedef struct _HID_DEVICE_INFO 46 | { 47 | uint16_t idVendor; 48 | uint16_t idProduct; 49 | uint16_t bcdDevice; 50 | uint32_t StrDescPtr; 51 | uint8_t InReportCount; 52 | uint8_t OutReportCount; 53 | uint8_t SampleInterval; 54 | void (*InReport)(uint8_t src[], uint32_t length); 55 | void (*OutReport)(uint8_t dst[], uint32_t length); 56 | } HID_DEVICE_INFO; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /drivers/rf/pn532/pn532_bus.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pn532_bus.h 4 | */ 5 | /**************************************************************************/ 6 | 7 | #ifndef __PN532_BUS_H__ 8 | #define __PN532_BUS_H__ 9 | 10 | #include "projectconfig.h" 11 | #include "pn532.h" 12 | 13 | // #define PN532_BUS_UART 14 | #define PN532_BUS_I2C 15 | 16 | #define PN532_RSTPD_PORT (3) 17 | #define PN532_RSTPD_PIN (1) 18 | #define PN532_I2C_IRQPORT (3) 19 | #define PN532_I2C_IRQPIN (2) 20 | 21 | #define PN532_NORMAL_FRAME__DATA_MAX_LEN (254) 22 | #define PN532_NORMAL_FRAME__OVERHEAD (8) 23 | #define PN532_EXTENDED_FRAME__DATA_MAX_LEN (264) 24 | #define PN532_EXTENDED_FRAME__OVERHEAD (11) 25 | #define PN532_BUFFER_LEN (PN532_EXTENDED_FRAME__DATA_MAX_LEN + PN532_EXTENDED_FRAME__OVERHEAD) 26 | 27 | #define PN532_UART_BAUDRATE (115200) 28 | 29 | #define PN532_I2C_ADDRESS (0x48) 30 | #define PN532_I2C_READBIT (0x01) 31 | #define PN532_I2C_READYTIMEOUT (20) // Max number of attempts to read Ready bit (see UM 5-Nov-2007 Section 6.2.4) 32 | 33 | // Generic interface for the different serial buses available on the PN532 34 | void pn532_bus_HWInit(void); 35 | pn532_error_t pn532_bus_SendCommand(const byte_t * pbtData, const size_t szData); 36 | pn532_error_t pn532_bus_ReadResponse(byte_t * pbtResponse, size_t * pszRxLen); 37 | pn532_error_t pn532_bus_Wakeup(void); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Unless otherwise noted, Copyright (c) 2010, microBuilder SARL. 4 | Portions Copyright (c) 2010 Roel Verdult. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the copyright holders nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /core/usbcdc/usbdesc.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * U S B - K e r n e l 3 | *---------------------------------------------------------------------------- 4 | * Name: usbdesc.h 5 | * Purpose: USB Descriptors Definitions 6 | * Version: V1.20 7 | *---------------------------------------------------------------------------- 8 | * This software is supplied "AS IS" without any warranties, express, 9 | * implied or statutory, including but not limited to the implied 10 | * warranties of fitness for purpose, satisfactory quality and 11 | * noninfringement. Keil extends you a royalty-free right to reproduce 12 | * and distribute executable files created using this software for use 13 | * on NXP Semiconductors LPC microcontroller devices only. Nothing else 14 | * gives you the right to use this software. 15 | * 16 | * Copyright (c) 2009 Keil - An ARM Company. All rights reserved. 17 | *---------------------------------------------------------------------------*/ 18 | 19 | #ifndef __USBDESC_H__ 20 | #define __USBDESC_H__ 21 | 22 | 23 | #define WBVAL(x) ((x) & 0xFF),(((x) >> 8) & 0xFF) 24 | 25 | #define USB_DEVICE_DESC_SIZE (sizeof(USB_DEVICE_DESCRIPTOR)) 26 | #define USB_CONFIGUARTION_DESC_SIZE (sizeof(USB_CONFIGURATION_DESCRIPTOR)) 27 | #define USB_INTERFACE_DESC_SIZE (sizeof(USB_INTERFACE_DESCRIPTOR)) 28 | #define USB_ENDPOINT_DESC_SIZE (sizeof(USB_ENDPOINT_DESCRIPTOR)) 29 | 30 | extern const uint8_t USB_DeviceDescriptor[]; 31 | extern const uint8_t USB_ConfigDescriptor[]; 32 | extern const uint8_t USB_StringDescriptor[]; 33 | 34 | 35 | #endif /* __USBDESC_H__ */ 36 | -------------------------------------------------------------------------------- /tools/examples/lcd/tft/oscilloscope/readme.txt: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | ============================================================ 3 | This examples simulates a very crude oscilloscope, and 4 | reads the values on an analog input pin (P1.4/Wakeup, which 5 | can be configured as AD5) as well as a digital pin (P2.0). 6 | The digital pin will simply be displayed as 'High' (3.3V) 7 | or 'Low' (0V/GND). 8 | 9 | The last 10 readings are rendered in a data grid on the LCD, 10 | with new readings added approximately every 100ms. 11 | 12 | This sample demonstrates the following features 13 | ============================================================ 14 | 15 | - Rotating the LCD orientation 16 | - Rendering text with different colors and fonts 17 | - Using the touch screen to enable or disable a feature 18 | 19 | WARNING 20 | ============================================================ 21 | Please note that the ADC pins on the LPC1343 are NOT 5.0V 22 | tolerant. Supply more than 3.3V to an ADC pin will 23 | permanently damage the MCU. Digital I/O pins are 5.0V 24 | tolerant and can safely test 5.0V logic. 25 | 26 | Pin Usage 27 | ============================================================ 28 | This examples is based on the LPC1343 TFT LCD Stand-Alone 29 | board, which has a very limited number of pins broken out. 30 | P1.4 can be configure as GPIO, but also as WAKEUP and AD5. 31 | 32 | This pin is also available on the LPC1343 Reference Design 33 | Base Base and is marked as WAKEUP on the PCB, but it has 34 | a 10K pullup on it to allow the pin to function as a WAKEUP 35 | source. 36 | 37 | For details on the differences between these boards, see 38 | the schematics available in the ~/tools/schematics folder. -------------------------------------------------------------------------------- /core/iap/iap.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file iap.c 4 | Source: http://knowledgebase.nxp.com/showthread.php?t=1594 5 | */ 6 | /**************************************************************************/ 7 | #include "iap.h" 8 | 9 | IAP_return_t iap_return; 10 | 11 | #define IAP_ADDRESS 0x1FFF1FF1 12 | uint32_t param_table[5]; 13 | 14 | /**************************************************************************/ 15 | /*! 16 | Sends the IAP command and stores the result 17 | */ 18 | /**************************************************************************/ 19 | void iap_entry(uint32_t param_tab[], uint32_t result_tab[]) 20 | { 21 | void (*iap)(uint32_t[], uint32_t[]); 22 | iap = (void (*)(uint32_t[], uint32_t[]))IAP_ADDRESS; 23 | iap(param_tab,result_tab); 24 | } 25 | 26 | /**************************************************************************/ 27 | /*! 28 | Returns the CPU's unique 128-bit serial number (4 words long) 29 | 30 | @section Example 31 | 32 | @code 33 | #include "core/iap/iap.h" 34 | 35 | IAP_return_t iap_return; 36 | iap_return = iapReadSerialNumber(); 37 | 38 | if (iap_return.ReturnCode == 0) 39 | { 40 | printf("Serial Number: %08X %08X %08X %08X %s", 41 | iap_return.Result[0], 42 | iap_return.Result[1], 43 | iap_return.Result[2], 44 | iap_return.Result[3], 45 | CFG_PRINTF_NEWLINE); 46 | } 47 | @endcode 48 | */ 49 | /**************************************************************************/ 50 | IAP_return_t iapReadSerialNumber(void) 51 | { 52 | // ToDo: Why does IAP sometime cause the application to halt when read??? 53 | param_table[0] = IAP_CMD_READUID; 54 | iap_entry(param_table,(uint32_t*)(&iap_return)); 55 | return iap_return; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /project/commands.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file commands.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __COMMANDS_H__ 37 | #define __COMMANDS_H__ 38 | 39 | #include "projectconfig.h" 40 | 41 | // Method Prototypes 42 | int getNumber (char *s, int32_t *result); 43 | 44 | #endif -------------------------------------------------------------------------------- /core/wdt/wdt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file wdt.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _WDT_H_ 40 | #define _WDT_H_ 41 | 42 | #include "projectconfig.h" 43 | 44 | void wdtInit (bool reset); 45 | void wdtFeed (void); 46 | 47 | #endif -------------------------------------------------------------------------------- /drivers/rf/chibi/chb_buf.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | Copyright (C) 2009 FreakLabs 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | 30 | Originally written by Christopher Wang aka Akiba. 31 | Please post support questions to the FreakLabs forum. 32 | 33 | *******************************************************************/ 34 | #ifndef CHB_BUF_H 35 | #define CHB_BUF_H 36 | 37 | #include "types.h" 38 | 39 | void chb_buf_init(); 40 | void chb_buf_write(U8 data); 41 | U8 chb_buf_read(); 42 | U32 chb_buf_get_len(); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/rtc/rtc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file rtc.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _RTC_H_ 38 | #define _RTC_H_ 39 | 40 | #include 41 | #include "projectconfig.h" 42 | 43 | long rtcToEpochTime(int year, int month, int mday, int hour, int min, int sec, int isdst); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /core/usbhid-rom/usbhid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file usbhid.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _USBHID_H_ 38 | #define _USBHID_H_ 39 | 40 | #include "projectconfig.h" 41 | 42 | void usbHIDGetInReport (uint8_t src[], uint32_t length); 43 | void usbHIDSetOutReport (uint8_t dst[], uint32_t length); 44 | void usbHIDInit (void); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/hsbchart.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file hsbchart.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __HSBCHART_H__ 37 | #define __HSBCHART_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void hsbchartRender(uint16_t x, uint16_t y, uint16_t size, uint16_t baseColor, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/huechart.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file huechart.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __HUECHART_H__ 37 | #define __HUECHART_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void huechartRender(uint16_t x, uint16_t y, uint16_t width, uint16_t height, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/label.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file label.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __LABEL_H__ 37 | #define __LABEL_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void labelRender(uint16_t x, uint16_t y, uint16_t bgColor, uint16_t fontColor, char *text, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/aafonts/aa2/DejaVuSansMono10_AA2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file DejaVuSansMono10_AA2.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __DejaVuSansMono10_AA2_H__ 37 | #define __DejaVuSansMono10_AA2_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/aafonts.h" 41 | 42 | extern aafontsFont_t DejaVuSansMono10_AA2; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/aafonts/aa2/DejaVuSansMono13_AA2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file DejaVuSansMono13_AA2.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __DejaVuSansMono13_AA2_H__ 37 | #define __DejaVuSansMono13_AA2_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/aafonts.h" 41 | 42 | extern aafontsFont_t DejaVuSansMono13_AA2; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/aafonts/aa2/DejaVuSansMono14_AA2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file DejaVuSansMono14_AA2.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __DejaVuSansMono14_AA2_H__ 37 | #define __DejaVuSansMono14_AA2_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/aafonts.h" 41 | 42 | extern aafontsFont_t DejaVuSansMono14_AA2; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /sysinit.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file sysinit.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef __SYSINIT_H__ 40 | #define __SYSINIT_H__ 41 | 42 | #include "projectconfig.h" 43 | 44 | #include "core/gpio/gpio.h" 45 | #include "core/systick/systick.h" 46 | 47 | // Function prototypes 48 | void systemInit(); 49 | 50 | #endif -------------------------------------------------------------------------------- /drivers/displays/tft/aafonts/aa2/DejaVuSansCondensedBold14_AA2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file DejaVuSansCondensedBold14_AA2.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __DEJAVUSANSCONDENSEDBOLD14_AA2_H__ 37 | #define __DEJAVUSANSCONDENSEDBOLD14_AA2_H__ 38 | 39 | #include "drivers/displays/tft/aafonts.h" 40 | 41 | extern aafontsFont_t DejaVuSansCondensedBold14_AA2; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/button.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file button.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __BUTTON_H__ 37 | #define __BUTTON_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void buttonRender(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t fontColor, char *text, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/aafonts/aa2/DejaVuSansCondensed14_AA2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file DejaVuSansCondensed14_AA2.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __DEJAVUSANSCONDENSED14_AA2_H__ 37 | #define __DEJAVUSANSCONDENSED14_AA2_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/aafonts.h" 41 | 42 | extern aafontsFont_t DejaVuSansCondensed14_AA2; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/labelcentered.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file labelcentered.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __LABELCENTERED_H__ 37 | #define __LABELCENTERED_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void labelcenteredRender(uint16_t x, uint16_t y, uint16_t bgColor, uint16_t fontColor, char *text, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/progressbar.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file progressbar.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, K. Townsend 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __PROGRESSBAR_H__ 37 | #define __PROGRESSBAR_H__ 38 | 39 | #include "projectconfig.h" 40 | #include "drivers/displays/tft/drawing.h" 41 | 42 | void progressbarRender(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t progress, uint16_t color, theme_t theme); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /drivers/dac/mcp4901/mcp4901.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file mcp4901.h 4 | @author Tauon 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2012, Tauon 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _MCP4901_H_ 38 | #define _MCP4901_H_ 39 | 40 | #include "projectconfig.h" 41 | #include "core/gpio/gpio.h" 42 | 43 | void mcp4901Init(void); 44 | void mcp4901SetVoltage( uint8_t output); 45 | void mcp4901LDAC(void); 46 | void mcp4901ChangeSettings(bool BUFFER, bool GAIN, bool SHUTDOWN); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /core/pmu/pmu.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pmu.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef __PMU_H__ 40 | #define __PMU_H__ 41 | 42 | #include "projectconfig.h" 43 | 44 | void WAKEUP_IRQHandler( void ); 45 | void pmuInit( void ); 46 | void pmuSleep( void ); 47 | void pmuDeepSleep(uint32_t sleepCtrl, uint32_t wakeupSeconds); 48 | void pmuPowerDown( void ); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tools/Readme.md: -------------------------------------------------------------------------------- 1 | # Tools 2 | 3 | This folder contains a number of tools that may be useful when developing with 4 | the LPC1343 Reference Board: 5 | 6 | ## codelite_debug 7 | 8 | A beta version of a plugin that allows you to program the LPC1343 from 9 | CodeLite using GDB Server and a Segger J-Link for ARM (still a work in 10 | progress). Created by AC Verbeck. 11 | 12 | ## dotfactory 13 | 14 | An open-source (GPL) Windows-based program to convert TTF fonts to .c 15 | source files. This application is included here for convenience sake and 16 | can be used to convert TTF fonts for use with the TFT LCD display with 17 | minor modifications to the generated source files. See the existing fonts 18 | in 'drivers/displays/tft/fonts' for an example. 19 | 20 | 21 | ## examples 22 | 23 | Example software showing how to use the LPC1343 to accomplish certain tasks 24 | or how to use it with external devices, such as communicating with the PC 25 | using USB HID, etc. 26 | 27 | ## lpcrc 28 | 29 | This utility fixes the CRC of any .bin files generated with GCC from the 30 | command line. You must use this utility to patch any compiled firmware that 31 | will be deployed via the USB bootloader. 32 | 33 | The GCC src is included in the root folder and should build on any platform 34 | where a native GCC toolchain is available. A pre=compiled windows binary is 35 | included in /bin for convenience sake, as well as in the root folder of the 36 | LPC1343 Code Base. 37 | 38 | If you are using the provided CodeLite project files, lpcrc will 39 | automatically be executed after every build. You only need to run lpcrc if 40 | you are building directly from the command=line. 41 | 42 | ## schematics 43 | 44 | Schematics showing the pin connections that are assumed to be used by the 45 | LPC1343 Code Base. 46 | 47 | ## testfirmware 48 | 49 | Various pre-compiled binaires files that can be used to test the 50 | functionality of the LPC1343. This firmware assumes that the board follows 51 | the layout show in 'tools/schematics' 52 | 53 | ## wsbridge 54 | 55 | A utility to allow you to pipe 802.15.4 traffic (via Chibi) out to Wireshark 56 | on the PC, so that you can use Chibi as an inexpensive wireless sniffer to 57 | capture and analyse any local 802.15.4 wireless traffic. 58 | -------------------------------------------------------------------------------- /core/adc/adc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file adc.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _ADC_H_ 40 | #define _ADC_H_ 41 | 42 | #include "projectconfig.h" 43 | 44 | uint32_t adcRead (uint8_t channelNum); 45 | uint32_t adcReadOversampled (uint8_t channelNum, uint8_t extraBits); 46 | uint32_t adcReadSingle(uint8_t channelNum); 47 | void adcInit (void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /core/pwm/pwm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file pwm.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _PWM_H_ 38 | #define _PWM_H_ 39 | 40 | #include "projectconfig.h" 41 | 42 | void pwmInit( void ); 43 | void pwmStart( void ); 44 | void pwmStop( void ); 45 | void pwmStartFixed( uint32_t pulses ); 46 | int pwmSetDutyCycle( uint32_t percentage ); 47 | int pwmSetFrequencyInTicks( uint16_t ticks ); 48 | int pwmSetFrequencyInMicroseconds(uint16_t us ); 49 | 50 | #endif -------------------------------------------------------------------------------- /drivers/sensors/ds18b20/ds18b20.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file ds18b20.h 4 | @author Albertas Mickenas (mic@wemakethings.net) 5 | @date 8 August 2012 6 | @version 1.0 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _DS18B20_H_ 40 | #define _DS18B20_H_ 41 | 42 | #include "core/gpio/gpio.h" 43 | #include "core/timer16/timer16.h" 44 | 45 | 46 | void ds18b20Init(uint32_t portNum, uint32_t bitPos, volatile uint32_t *ioconReg); 47 | uint32_t ds18b20GetTemparature(); 48 | #endif 49 | 50 | 51 | -------------------------------------------------------------------------------- /core/systick/systick.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file systick.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _SYSTICK_H_ 40 | #define _SYSTICK_H_ 41 | 42 | #include "projectconfig.h" 43 | 44 | void systickInit (uint32_t delayMs); 45 | void systickDelay (uint32_t delayTicks); 46 | uint32_t systickGetTicks(void); 47 | uint32_t systickGetRollovers(void); 48 | uint32_t systickGetSecondsActive(void); 49 | 50 | #endif -------------------------------------------------------------------------------- /drivers/fatfs/diskio.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | / Low level disk interface modlue include file R0.05 (C)ChaN, 2007 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO 6 | 7 | #define _READONLY 0 /* 1: Read-only mode */ 8 | #define _USE_IOCTL 1 9 | 10 | #include "integer.h" 11 | 12 | 13 | /* Status of Disk Functions */ 14 | typedef BYTE DSTATUS; 15 | 16 | /* Results of Disk Functions */ 17 | typedef enum { 18 | RES_OK = 0, /* 0: Successful */ 19 | RES_ERROR, /* 1: R/W Error */ 20 | RES_WRPRT, /* 2: Write Protected */ 21 | RES_NOTRDY, /* 3: Not Ready */ 22 | RES_PARERR /* 4: Invalid Parameter */ 23 | } DRESULT; 24 | 25 | 26 | /*---------------------------------------*/ 27 | /* Prototypes for disk control functions */ 28 | 29 | DSTATUS disk_initialize (BYTE); 30 | DSTATUS disk_status (BYTE); 31 | DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE); 32 | #if _READONLY == 0 33 | DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE); 34 | #endif 35 | DRESULT disk_ioctl (BYTE, BYTE, void*); 36 | void disk_timerproc (void); 37 | 38 | 39 | 40 | 41 | /* Disk Status Bits (DSTATUS) */ 42 | 43 | #define STA_NOINIT 0x01 /* Drive not initialized */ 44 | #define STA_NODISK 0x02 /* No medium in the drive */ 45 | #define STA_PROTECT 0x04 /* Write protected */ 46 | 47 | 48 | 49 | /* Command code for disk_ioctrl() */ 50 | 51 | /* Generic command */ 52 | #define CTRL_SYNC 0 /* Mandatory for write functions */ 53 | #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ 54 | #define GET_SECTOR_SIZE 2 55 | #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ 56 | #define CTRL_POWER 4 57 | #define CTRL_LOCK 5 58 | #define CTRL_EJECT 6 59 | /* MMC/SDC command */ 60 | #define MMC_GET_TYPE 10 61 | #define MMC_GET_CSD 11 62 | #define MMC_GET_CID 12 63 | #define MMC_GET_OCR 13 64 | #define MMC_GET_SDSTAT 14 65 | /* ATA/CF command */ 66 | #define ATA_GET_REV 20 67 | #define ATA_GET_MODEL 21 68 | #define ATA_GET_SN 22 69 | 70 | 71 | 72 | /* Card type flags (CardType) */ 73 | #define CT_MMC 0x01 /* MMC ver 3 */ 74 | #define CT_SD1 0x02 /* SD ver 1 */ 75 | #define CT_SD2 0x04 /* SD ver 2 */ 76 | #define CT_SDC (CT_SD1|CT_SD2) /* SD */ 77 | #define CT_BLOCK 0x08 /* Block addressing */ 78 | 79 | 80 | #define _DISKIO 81 | #endif 82 | -------------------------------------------------------------------------------- /drivers/rf/chibi/chb_eeprom.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | Copyright (C) 2009 FreakLabs 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | 30 | Originally written by Christopher Wang aka Akiba. 31 | Please post support questions to the FreakLabs forum. 32 | 33 | *******************************************************************/ 34 | /*! 35 | \file 36 | \ingroup 37 | 38 | 39 | */ 40 | /**************************************************************************/ 41 | #ifndef CHB_EEPROM_H 42 | #define CHB_EEPROM_H 43 | 44 | #include "projectconfig.h" 45 | #include "types.h" 46 | 47 | void chb_eeprom_write(U16 addr, U8 *buf, U16 size); 48 | void chb_eeprom_read(U16 addr, U8 *buf, U16 size); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /core/cmd/cmd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef __CMD_H__ 40 | #define __CMD_H__ 41 | 42 | #include "projectconfig.h" 43 | 44 | typedef struct 45 | { 46 | char *command; 47 | uint8_t minArgs; 48 | uint8_t maxArgs; 49 | uint8_t hidden; 50 | void (*func)(uint8_t argc, char **argv); 51 | const char *description; 52 | const char *parameters; 53 | } cmd_t; 54 | 55 | void cmdPoll(); 56 | void cmdRx(uint8_t c); 57 | void cmdParse(char *cmd); 58 | void cmdInit(); 59 | 60 | #endif -------------------------------------------------------------------------------- /project/commands/cmd_reset.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_reset.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_reset in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "core/cpu/cpu.h" 44 | #include "project/commands.h" // Generic helper functions 45 | 46 | /**************************************************************************/ 47 | /*! 48 | Resets the board using the AIRCR register 49 | */ 50 | /**************************************************************************/ 51 | void cmd_reset(uint8_t argc, char **argv) 52 | { 53 | cpuReset(); 54 | } 55 | -------------------------------------------------------------------------------- /core/usbcdc/usbuser.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * U S B - K e r n e l 3 | *---------------------------------------------------------------------------- 4 | * Name: USBUSER.H 5 | * Purpose: USB Custom User Definitions 6 | * Version: V1.10 7 | *---------------------------------------------------------------------------- 8 | * This software is supplied "AS IS" without any warranties, express, 9 | * implied or statutory, including but not limited to the implied 10 | * warranties of fitness for purpose, satisfactory quality and 11 | * noninfringement. Keil extends you a royalty-free right to reproduce 12 | * and distribute executable files created using this software for use 13 | * on NXP Semiconductors LPC microcontroller devices only. Nothing else 14 | * gives you the right to use this software. 15 | * 16 | * Copyright (c) 2005-2009 Keil Software. 17 | *---------------------------------------------------------------------------*/ 18 | 19 | #ifndef __USBUSER_H__ 20 | #define __USBUSER_H__ 21 | 22 | 23 | /* USB Device Events Callback Functions */ 24 | extern void USB_Power_Event (uint32_t power); 25 | extern void USB_Reset_Event (void); 26 | extern void USB_Suspend_Event (void); 27 | extern void USB_Resume_Event (void); 28 | extern void USB_WakeUp_Event (void); 29 | extern void USB_SOF_Event (void); 30 | extern void USB_Error_Event (uint32_t error); 31 | 32 | /* USB Endpoint Callback Events */ 33 | #define USB_EVT_SETUP 1 /* Setup Packet */ 34 | #define USB_EVT_OUT 2 /* OUT Packet */ 35 | #define USB_EVT_IN 3 /* IN Packet */ 36 | #define USB_EVT_OUT_NAK 4 /* OUT Packet - Not Acknowledged */ 37 | #define USB_EVT_IN_NAK 5 /* IN Packet - Not Acknowledged */ 38 | #define USB_EVT_OUT_STALL 6 /* OUT Packet - Stalled */ 39 | #define USB_EVT_IN_STALL 7 /* IN Packet - Stalled */ 40 | 41 | /* USB Endpoint Events Callback Pointers */ 42 | extern void (* const USB_P_EP[USB_LOGIC_EP_NUM])(uint32_t event); 43 | 44 | /* USB Endpoint Events Callback Functions */ 45 | extern void USB_EndPoint0 (uint32_t event); 46 | extern void USB_EndPoint1 (uint32_t event); 47 | extern void USB_EndPoint2 (uint32_t event); 48 | extern void USB_EndPoint3 (uint32_t event); 49 | extern void USB_EndPoint4 (uint32_t event); 50 | 51 | /* USB Core Events Callback Functions */ 52 | extern void USB_Configure_Event (void); 53 | extern void USB_Interface_Event (void); 54 | extern void USB_Feature_Event (void); 55 | 56 | 57 | #endif /* __USBUSER_H__ */ 58 | -------------------------------------------------------------------------------- /core/iap/iap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file iap.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _IAP_H_ 38 | #define _IAP_H_ 39 | 40 | #include "projectconfig.h" 41 | 42 | #define IAP_CMD_PREPARESECTORFORWRITE (50) 43 | #define IAP_CMD_COPYRAMTOFLASH (51) 44 | #define CAP_CMD_ERASESECTORS (52) 45 | #define IAP_CMD_BLANKCHECKSECTOR (53) 46 | #define IAP_CMD_READPARTID (54) 47 | #define IAP_CMD_READBOOTCODEVERSION (55) 48 | #define IAP_CMD_COMPARE (56) 49 | #define IAP_CMD_REINVOKEISP (57) 50 | #define IAP_CMD_READUID (58) 51 | 52 | typedef struct 53 | { 54 | unsigned int ReturnCode; 55 | unsigned int Result[4]; 56 | } IAP_return_t; 57 | 58 | IAP_return_t iapReadSerialNumber(void); 59 | 60 | #endif -------------------------------------------------------------------------------- /lpc1xxx/LPC1xxx_startup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright (c) 2010, Roel Verdult 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holders nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | */ 30 | 31 | // These are defined and created by the linker, locating them in memory 32 | extern unsigned char _etext; 33 | extern unsigned char _data; 34 | extern unsigned char _edata; 35 | extern unsigned char _bss; 36 | extern unsigned char _ebss; 37 | 38 | // Prototype the required startup functions 39 | extern void main(void); 40 | 41 | // The entry point of the application, prepare segments, 42 | // initialize the cpu and execute main() 43 | void boot_entry(void) 44 | { 45 | register unsigned char *src, *dst; 46 | 47 | // Get physical data address and copy it to sram 48 | src = &_etext; 49 | dst = &_data; 50 | while(dst < &_edata) { 51 | *dst++ = *src++; 52 | } 53 | 54 | // Clear the bss segment 55 | dst = &_bss; 56 | while(dst < &_ebss) { 57 | *dst++ = 0; 58 | } 59 | 60 | // Execute the code at the program entry point 61 | main(); 62 | 63 | // Do nothing when returned from main, just keep looping 64 | while(1); 65 | } 66 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | LPC1343_CodeBase 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | ?name? 14 | 15 | 16 | 17 | org.eclipse.cdt.make.core.append_environment 18 | true 19 | 20 | 21 | org.eclipse.cdt.make.core.autoBuildTarget 22 | all 23 | 24 | 25 | org.eclipse.cdt.make.core.buildArguments 26 | 27 | 28 | 29 | org.eclipse.cdt.make.core.buildCommand 30 | make 31 | 32 | 33 | org.eclipse.cdt.make.core.cleanBuildTarget 34 | clean 35 | 36 | 37 | org.eclipse.cdt.make.core.contents 38 | org.eclipse.cdt.make.core.activeConfigSettings 39 | 40 | 41 | org.eclipse.cdt.make.core.enableAutoBuild 42 | false 43 | 44 | 45 | org.eclipse.cdt.make.core.enableCleanBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.enableFullBuild 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.fullBuildTarget 54 | all 55 | 56 | 57 | org.eclipse.cdt.make.core.stopOnError 58 | true 59 | 60 | 61 | org.eclipse.cdt.make.core.useDefaultBuildCmd 62 | true 63 | 64 | 65 | 66 | 67 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 68 | full,incremental, 69 | 70 | 71 | 72 | 73 | 74 | org.eclipse.cdt.core.cnature 75 | org.eclipse.cdt.core.ccnature 76 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 77 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 78 | 79 | 80 | -------------------------------------------------------------------------------- /drivers/motor/stepper/stepper.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file stepper.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _STEPPER_H_ 38 | #define _STEPPER_H_ 39 | 40 | #include "projectconfig.h" 41 | 42 | #define STEPPER_IN1_PORT (3) 43 | #define STEPPER_IN1_PIN (0) 44 | #define STEPPER_IN2_PORT (3) 45 | #define STEPPER_IN2_PIN (1) 46 | #define STEPPER_IN3_PORT (3) 47 | #define STEPPER_IN3_PIN (2) 48 | #define STEPPER_IN4_PORT (3) 49 | #define STEPPER_IN4_PIN (3) 50 | 51 | void stepperInit( uint32_t steps ); 52 | void stepperSetSpeed( uint32_t rpm ); 53 | int64_t stepperGetPosition(); 54 | uint32_t stepperGetRotation(); 55 | void stepperMoveHome(); 56 | void stepperSetHome(); 57 | void stepperMoveZero(); 58 | void stepperSetZero(); 59 | void stepperStep( int32_t steps ); 60 | 61 | #endif -------------------------------------------------------------------------------- /drivers/rf/chibi/types.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | Copyright (C) 2009 FreakLabs 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | 30 | Originally written by Christopher Wang aka Akiba. 31 | Please post support questions to the FreakLabs forum. 32 | *******************************************************************/ 33 | /*! 34 | \file types.h 35 | \ingroup usb 36 | */ 37 | /*******************************************************************/ 38 | #ifndef TYPES_H 39 | #define TYPES_H 40 | 41 | #include 42 | #include 43 | 44 | // Standard data types 45 | typedef uint8_t U8; /// Generic 8 bit unsigned data type 46 | typedef uint16_t U16; /// Generic 16 bit unsigned data type 47 | typedef uint32_t U32; /// Generic 32 bit unsigned data type 48 | typedef uint64_t U64; /// Generic 64 bit unsigned data type 49 | 50 | typedef int8_t S8; /// Generic 8 bit signed data type 51 | typedef int16_t S16; /// Generic 16 bit signed data type 52 | typedef int32_t S32; /// Generic 32 bit signed data type 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /drivers/dac/mcp4725/mcp4725.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file mcp4725.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | 37 | #ifndef _MCP4725_H_ 38 | #define _MCP4725_H_ 39 | 40 | #include "projectconfig.h" 41 | 42 | //#define MCP4725_ADDRESS (0xC0) // 1100000x - Assumes A0 is GND and A2,A1 are 00 (MCP4725A0T-E/CH) 43 | #define MCP4725_ADDRESS (0xC4) // 1100010x - Assumes A0 is GND and A2,A1 are 01 (MCP4725A1T-E/CH) 44 | #define MCP4725_READ (0x01) 45 | #define MCP4726_CMD_WRITEDAC (0x40) // Writes data to the DAC 46 | #define MCP4726_CMD_WRITEDACEEPROM (0x60) // Writes data to the DAC and the EEPROM (persisting the assigned value after reset) 47 | 48 | int mcp4725Init(); 49 | void mcp4725SetVoltage( uint16_t output, bool writeEEPROM ); 50 | void mcp4725ReadConfig( uint8_t *status, uint16_t *value ); 51 | 52 | #endif -------------------------------------------------------------------------------- /core/timer16/timer16.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file timer16.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef __TIMER16_H__ 40 | #define __TIMER16_H__ 41 | 42 | #include "projectconfig.h" 43 | 44 | #define TIMER16_DEFAULTINTERVAL (0xFFFF) // ~0.91mS @ 72MHz, ~1.37mS @ 48MHz 45 | 46 | #define TIMER16_CCLK_100US ((CFG_CPU_CCLK/SCB_SYSAHBCLKDIV) / 10000) 47 | #define TIMER16_CCLK_1MS ((CFG_CPU_CCLK/SCB_SYSAHBCLKDIV) / 1000) 48 | 49 | void TIMER16_0_IRQHandler(void); 50 | void TIMER16_1_IRQHandler(void); 51 | 52 | void timer16DelayTicks(uint8_t timerNum, uint16_t delayInTicks); 53 | void timer16DelayUS(uint8_t timerNum, uint16_t delayInUS); 54 | void timer16Enable(uint8_t timerNum); 55 | void timer16Disable(uint8_t timerNum); 56 | void timer16Reset(uint8_t timerNum); 57 | void timer16Init(uint8_t timerNum, uint16_t timerInterval); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /lpc1xxx/linkscript.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright (c) 2010, Roel Verdult 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holders nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | */ 30 | 31 | sram_top = ORIGIN(sram) + LENGTH(sram); 32 | ENTRY(boot_entry) 33 | 34 | SECTIONS 35 | { 36 | .text : 37 | { 38 | KEEP(*(.irq_vectors)) 39 | *(.text*) 40 | *(.rodata*) 41 | } > flash 42 | 43 | /* 44 | * More information about Special Section Indexes is available in the 45 | * free "ELF for the ARM Architecture" document from ARM Limited 46 | * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf 47 | * 48 | */ 49 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash 50 | __exidx_start = .; 51 | .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > flash 52 | __exidx_end = .; 53 | 54 | _etext = .; 55 | 56 | .data : AT (__exidx_end) 57 | { 58 | _data = .; 59 | *(vtable) 60 | *(.data*) 61 | _edata = .; 62 | } > sram 63 | 64 | /* zero initialized data */ 65 | .bss : 66 | { 67 | _bss = .; 68 | *(.bss*) 69 | *(COMMON) 70 | _ebss = .; 71 | } > sram 72 | 73 | end = .; 74 | 75 | /* For GDB compatibility we decrease the top with 16 bytes */ 76 | stack_entry = sram_top - 16; 77 | } 78 | -------------------------------------------------------------------------------- /core/usbcdc/cdcuser.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * U S B - K e r n e l 3 | *---------------------------------------------------------------------------- 4 | * Name: cdcuser.h 5 | * Purpose: USB Communication Device Class User module Definitions 6 | * Version: V1.10 7 | *---------------------------------------------------------------------------- 8 | * This software is supplied "AS IS" without any warranties, express, 9 | * implied or statutory, including but not limited to the implied 10 | * warranties of fitness for purpose, satisfactory quality and 11 | * noninfringement. Keil extends you a royalty-free right to reproduce 12 | * and distribute executable files created using this software for use 13 | * on NXP Semiconductors LPC microcontroller devices only. Nothing else 14 | * gives you the right to use this software. 15 | * 16 | * Copyright (c) 2009 Keil - An ARM Company. All rights reserved. 17 | *---------------------------------------------------------------------------*/ 18 | 19 | #ifndef __CDCUSER_H__ 20 | #define __CDCUSER_H__ 21 | 22 | /* CDC buffer handling */ 23 | extern int CDC_RdOutBuf (char *buffer, const int *length); 24 | extern int CDC_WrOutBuf (const char *buffer, int *length); 25 | extern int CDC_OutBufAvailChar (int *availChar); 26 | 27 | 28 | /* CDC Data In/Out Endpoint Address */ 29 | #define CDC_DEP_IN 0x83 30 | #define CDC_DEP_OUT 0x03 31 | 32 | /* CDC Communication In Endpoint Address */ 33 | #define CDC_CEP_IN 0x81 34 | 35 | /* CDC Requests Callback Functions */ 36 | extern uint32_t CDC_SendEncapsulatedCommand (void); 37 | extern uint32_t CDC_GetEncapsulatedResponse (void); 38 | extern uint32_t CDC_SetCommFeature (unsigned short wFeatureSelector); 39 | extern uint32_t CDC_GetCommFeature (unsigned short wFeatureSelector); 40 | extern uint32_t CDC_ClearCommFeature (unsigned short wFeatureSelector); 41 | extern uint32_t CDC_GetLineCoding (void); 42 | extern uint32_t CDC_SetLineCoding (void); 43 | extern uint32_t CDC_SetControlLineState (unsigned short wControlSignalBitmap); 44 | extern uint32_t CDC_SendBreak (unsigned short wDurationOfBreak); 45 | 46 | /* CDC Bulk Callback Functions */ 47 | extern void CDC_BulkIn (void); 48 | extern void CDC_BulkOut (void); 49 | 50 | /* CDC Notification Callback Function */ 51 | extern void CDC_NotificationIn (void); 52 | 53 | /* CDC Initializtion Function */ 54 | extern void CDC_Init (void); 55 | 56 | /* CDC prepare the SERAIAL_STATE */ 57 | extern unsigned short CDC_GetSerialState (void); 58 | 59 | /* flow control */ 60 | extern unsigned short CDC_DepInEmpty; // DataEndPoint IN empty 61 | 62 | #endif /* __CDCUSER_H__ */ 63 | 64 | -------------------------------------------------------------------------------- /project/commands/drawing/cmd_backlight.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_backlight.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_backlight in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #ifdef CFG_TFTLCD 46 | #include "drivers/displays/tft/lcd.h" 47 | #include "drivers/displays/tft/drawing.h" 48 | 49 | /**************************************************************************/ 50 | /*! 51 | Sets the LCD backlight state 52 | */ 53 | /**************************************************************************/ 54 | void cmd_backlight(uint8_t argc, char **argv) 55 | { 56 | int32_t input; 57 | bool state; 58 | getNumber (argv[0], &input); 59 | 60 | // Set backlight 61 | state = input < 1 ? false : true; 62 | lcdBacklight(state); 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /tools/examples/sensors/pn532/ISO14443A_ID/readme.txt: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | ============================================================ 3 | This example will wait for an ISO14443A card to enter 4 | the RF field, and then try to determine the specific card 5 | model (SENS_RES and SEL_RES) as well as the card's NFCID. 6 | 7 | All information will be sent to USBCDC by default, with the 8 | PN532 breakout board connected via either UART or I2C (the 9 | bus can be selected in PN532_bus.h). 10 | 11 | HOW TO USE THIS EXAMPLE 12 | ============================================================ 13 | 1.) Connect the PN532 NFC Breakout Board to UART on the 14 | LPC1343 as follows: 15 | 16 | PN532 LPC1343 17 | ----- ------- 18 | GND GND 19 | TXD RXD 20 | RXD TXD 21 | 3.3V 3.3V 22 | 23 | Set SEL0 to Off and SEL1 to Off (= UART) 24 | 25 | or via I2C as follows: 26 | 27 | PN532 LPC1343 28 | ----- ------- 29 | GND GND 30 | SDA SDA 31 | SCL SCL 32 | IRQ 3.2 33 | 3.3V 3.3V 34 | 35 | Set SEL0 to On and SEL1 to Off (= I2C) 36 | 37 | 2.) Configure your terminal software to open the USB COM 38 | port at 115K. 39 | 40 | 3.) When the application starts, there is a 5 second delay 41 | (to allow you time to connect via USB CDC), after which 42 | point the device will wait for a single ISO14443A card 43 | (Mifare Classic, etc.) and try to read it's ID. Once a 44 | card is found, the reader will start looking again for a 45 | card after a 1 second delay. 46 | 47 | SAMPLE OUTPUT 48 | ============================================================ 49 | 50 | When a card is placed in the field you should see results 51 | similar to the following (results shown for several 52 | different card types): 53 | 54 | Waiting for an ISO14443A card (Mifare Classic, etc.) 55 | 56 | Received : 00 00 ff 0c f4 d5 4b 01 01 00 04 08 04 9e b3 6e 66 a9 00 57 | Tags Found : 1 58 | SENS_RES : 00 04 59 | SEL_RES : 08 60 | NFCID : 9e b3 6e 66 61 | Seems to be a Mifare Classic 1K Card 62 | 63 | Waiting for an ISO14443A card (Mifare Classic, etc.) 64 | 65 | Received : 00 00 ff 0c f4 d5 4b 01 01 00 02 18 04 8a 4c b5 12 23 00 66 | Tags Found : 1 67 | SENS_RES : 00 02 68 | SEL_RES : 18 69 | NFCID : 8a 4c b5 12 70 | 71 | Waiting for an ISO14443A card (Mifare Classic, etc.) 72 | 73 | Received : 00 00 ff 0f f1 d5 4b 01 01 00 44 00 07 04 7b cb 51 96 22 80 c0 00 74 | Tags Found : 1 75 | SENS_RES : 00 44 76 | SEL_RES : 00 77 | NFCID : 04 7b cb 51 96 22 80 78 | 79 | Waiting for an ISO14443A card (Mifare Classic, etc.) 80 | 81 | Received : 00 00 ff 0c f4 d5 4b 01 01 00 04 08 04 6e 8a e2 b0 44 00 82 | Tags Found : 1 83 | SENS_RES : 00 04 84 | SEL_RES : 08 85 | NFCID : 6e 8a e2 b0 86 | Seems to be a Mifare Classic 1K Card 87 | 88 | Waiting for an ISO14443A card (Mifare Classic, etc.) 89 | 90 | -------------------------------------------------------------------------------- /drivers/rf/chibi/chb_spi.h: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | Copyright (C) 2009 FreakLabs 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | 30 | Originally written by Christopher Wang aka Akiba. 31 | Please post support questions to the FreakLabs forum. 32 | 33 | *******************************************************************/ 34 | /*! 35 | \file 36 | \ingroup 37 | 38 | 39 | */ 40 | /**************************************************************************/ 41 | 42 | #ifndef CHB_SPI_H 43 | #define CHB_SPI_H 44 | 45 | #include "projectconfig.h" 46 | #include "core/gpio/gpio.h" 47 | 48 | #define CHB_SSPORT (0) // P0.2 = SSEL 49 | #define CHB_SSPIN (2) 50 | 51 | #define CHB_SPI_ENABLE() do {gpioSetValue(CHB_SSPORT, CHB_SSPIN, 0);} while (0) // Drive SSEL low 52 | #define CHB_SPI_DISABLE() do {gpioSetValue(CHB_SSPORT, CHB_SSPIN, 1);} while (0) // Drive SSEL high 53 | 54 | #define CHB_SPIPORT 0 55 | #define CHB_SCK 1 // PB.1 - Output: SPI Serial Clock (SCLK) 56 | #define CHB_MOSI 2 // PB.2 - Output: SPI Master out - slave in (MOSI) 57 | #define CHB_MISO 3 // PB.3 - Input: SPI Master in - slave out (MISO) 58 | 59 | void chb_spi_init(); 60 | U8 chb_xfer_byte(U8 data); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /tools/examples/basics/blinky/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file main.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #include 37 | #include 38 | #include 39 | 40 | #include "projectconfig.h" 41 | #include "sysinit.h" 42 | 43 | #include "core/gpio/gpio.h" 44 | #include "core/systick/systick.h" 45 | 46 | /**************************************************************************/ 47 | /*! 48 | Cause the LED to blink once per second using a blocking delay 49 | */ 50 | /**************************************************************************/ 51 | int main(void) 52 | { 53 | // Configure cpu and mandatory peripherals 54 | systemInit(); 55 | 56 | while (1) 57 | { 58 | // Wait one second 59 | systickDelay(1000); 60 | // Toggle the LED 61 | if (gpioGetValue(CFG_LED_PORT, CFG_LED_PIN) == CFG_LED_OFF) 62 | { 63 | gpioSetValue (CFG_LED_PORT, CFG_LED_PIN, CFG_LED_ON); 64 | } 65 | else 66 | { 67 | gpioSetValue (CFG_LED_PORT, CFG_LED_PIN, CFG_LED_OFF); 68 | } 69 | } 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /core/usbcdc/usbhw.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * U S B - K e r n e l 3 | *---------------------------------------------------------------------------- 4 | * Name: usbhw.h 5 | * Purpose: USB Hardware Layer Definitions 6 | * Version: V1.20 7 | *---------------------------------------------------------------------------- 8 | * This software is supplied "AS IS" without any warranties, express, 9 | * implied or statutory, including but not limited to the implied 10 | * warranties of fitness for purpose, satisfactory quality and 11 | * noninfringement. Keil extends you a royalty-free right to reproduce 12 | * and distribute executable files created using this software for use 13 | * on NXP Semiconductors LPC microcontroller devices only. Nothing else 14 | * gives you the right to use this software. 15 | * 16 | * Copyright (c) 2009 Keil - An ARM Company. All rights reserved. 17 | *---------------------------------------------------------------------------- 18 | * History: 19 | * V1.20 Added USB_ClearEPBuf 20 | * V1.00 Initial Version 21 | *----------------------------------------------------------------------------*/ 22 | 23 | #ifndef __USBHW_H__ 24 | #define __USBHW_H__ 25 | 26 | 27 | /* USB Error Codes */ 28 | #define USB_ERR_PID 0x0001 /* PID Error */ 29 | #define USB_ERR_UEPKT 0x0002 /* Unexpected Packet */ 30 | #define USB_ERR_DCRC 0x0004 /* Data CRC Error */ 31 | #define USB_ERR_TIMOUT 0x0008 /* Bus Time-out Error */ 32 | #define USB_ERR_EOP 0x0010 /* End of Packet Error */ 33 | #define USB_ERR_B_OVRN 0x0020 /* Buffer Overrun */ 34 | #define USB_ERR_BTSTF 0x0040 /* Bit Stuff Error */ 35 | #define USB_ERR_TGL 0x0080 /* Toggle Bit Error */ 36 | 37 | /* USB Hardware Functions */ 38 | extern void USBIOClkConfig (void); 39 | extern void USB_Init (void); 40 | extern void USB_Connect (uint32_t con); 41 | extern void USB_Reset (void); 42 | extern void USB_Suspend (void); 43 | extern void USB_Resume (void); 44 | extern void USB_WakeUp (void); 45 | extern void USB_WakeUpCfg (uint32_t cfg); 46 | extern void USB_SetAddress (uint32_t adr); 47 | extern void USB_Configure (uint32_t cfg); 48 | extern void USB_ConfigEP (USB_ENDPOINT_DESCRIPTOR *pEPD); 49 | extern void USB_DirCtrlEP (uint32_t dir); 50 | extern void USB_EnableEP (uint32_t EPNum); 51 | extern void USB_DisableEP (uint32_t EPNum); 52 | extern void USB_ResetEP (uint32_t EPNum); 53 | extern void USB_SetStallEP (uint32_t EPNum); 54 | extern void USB_ClrStallEP (uint32_t EPNum); 55 | extern void USB_ClearEPBuf (uint32_t EPNum); 56 | extern uint32_t USB_ReadEP (uint32_t EPNum, uint8_t *pData); 57 | extern uint32_t USB_WriteEP (uint32_t EPNum, uint8_t *pData, uint32_t cnt); 58 | extern uint32_t USB_GetFrame(void); 59 | extern void USB_IRQHandler (void); 60 | 61 | 62 | #endif /* __USBHW_H__ */ 63 | -------------------------------------------------------------------------------- /drivers/rf/chibi/chb_eeprom.c: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | Copyright (C) 2009 FreakLabs 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of the the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | 30 | Originally written by Christopher Wang aka Akiba. 31 | Please post support questions to the FreakLabs forum. 32 | 33 | *******************************************************************/ 34 | /*! 35 | \file 36 | \ingroup 37 | 38 | 39 | */ 40 | /**************************************************************************/ 41 | #include "chb_eeprom.h" 42 | #include "drivers/storage/eeprom/eeprom.h" 43 | 44 | /**************************************************************************/ 45 | /*! 46 | 47 | */ 48 | /**************************************************************************/ 49 | void chb_eeprom_write(uint16_t addr, uint8_t *buf, uint16_t size) 50 | { 51 | // Write the address one byte at a time 52 | uint16_t a = 0; 53 | while (a < size) 54 | { 55 | eepromWriteU8(addr + a, buf[a]); 56 | a++; 57 | } 58 | } 59 | 60 | /**************************************************************************/ 61 | /*! 62 | 63 | */ 64 | /**************************************************************************/ 65 | void chb_eeprom_read(uint16_t addr, uint8_t *buf, uint16_t size) 66 | { 67 | // Read the contents at address 68 | eepromReadBuffer(addr, buf, size); 69 | } 70 | 71 | -------------------------------------------------------------------------------- /drivers/sensors/lm75b/lm75b.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file lm75b.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _LM75B_H_ 40 | #define _LM75B_H_ 41 | 42 | #include "projectconfig.h" 43 | #include "core/i2c/i2c.h" 44 | 45 | #define LM75B_ADDRESS (0x90) // 100 1000 shifted left 1 bit = 0x90 46 | #define LM75B_READBIT (0x01) 47 | 48 | #define LM75B_REGISTER_TEMPERATURE (0x00) 49 | #define LM75B_REGISTER_CONFIGURATION (0x01) 50 | 51 | #define LM75B_CONFIG_SHUTDOWN_MASK (0x01) 52 | #define LM75B_CONFIG_SHUTDOWN_POWERON (0x00) 53 | #define LM75B_CONFIG_SHUTDOWN_SHUTDOWN (0x01) 54 | 55 | typedef enum 56 | { 57 | LM75B_ERROR_OK = 0, // Everything executed normally 58 | LM75B_ERROR_I2CINIT, // Unable to initialise I2C 59 | LM75B_ERROR_I2CBUSY, // I2C already in use 60 | LM75B_ERROR_LAST 61 | } 62 | lm75bError_e; 63 | 64 | lm75bError_e lm75bInit(void); 65 | lm75bError_e lm75bGetTemperature (int32_t *temp); 66 | lm75bError_e lm75bConfigWrite (uint8_t configValue); 67 | 68 | #endif 69 | 70 | 71 | -------------------------------------------------------------------------------- /tools/examples/sensors/tsl2561/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file main.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2011, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #include 37 | 38 | #include "projectconfig.h" 39 | #include "sysinit.h" 40 | 41 | #include "core/systick/systick.h" 42 | #include "drivers/sensors/tsl2561/tsl2561.h" 43 | 44 | /**************************************************************************/ 45 | /*! 46 | Main program entry point. After reset, normal code execution will 47 | begin here. 48 | */ 49 | /**************************************************************************/ 50 | int main(void) 51 | { 52 | // Configure cpu and mandatory peripherals 53 | systemInit(); 54 | 55 | uint16_t lumMixed, lumInfrared; 56 | 57 | while (1) 58 | { 59 | // Read mixed and infrared luminosity from tsl2561 60 | tsl2561GetLuminosity(&lumMixed, &lumInfrared); 61 | 62 | // Display the readings 63 | printf("Luminosity: \r\n Broadband (Visible + IR) - %d \r\n Infrared - %d \r\n", lumMixed, lumInfrared); 64 | 65 | // Wait 1 second between reading 66 | systickDelay(1000); 67 | } 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /project/commands/drawing/cmd_calibrate.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_calibrate.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_calibrate in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #if defined CFG_TFTLCD 46 | #include "drivers/displays/tft/lcd.h" 47 | #include "drivers/displays/tft/touchscreen.h" 48 | 49 | /**************************************************************************/ 50 | /*! 51 | Starts the touch-screen calibration process. 52 | */ 53 | /**************************************************************************/ 54 | void cmd_calibrate(uint8_t argc, char **argv) 55 | { 56 | printf("Starting touch-screen calibration%s", CFG_PRINTF_NEWLINE); 57 | 58 | // Run through the calibration process 59 | tsCalibrate(); 60 | 61 | // Clear the screen to avoid confusion 62 | lcdFillRGB(0x0000); 63 | 64 | printf("Calibration complete%s", CFG_PRINTF_NEWLINE); 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /project/commands/drawing/cmd_gettext.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_gettext.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_gettext in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #if defined CFG_TFTLCD 46 | #include "drivers/displays/tft/lcd.h" 47 | #include "drivers/displays/tft/drawing.h" 48 | #include "drivers/displays/tft/touchscreen.h" 49 | #include "drivers/displays/tft/dialogues/alphanumeric.h" 50 | 51 | /**************************************************************************/ 52 | /*! 53 | Displays an alpha-numeric input dialogue on the TFT LCD screen. 54 | */ 55 | /**************************************************************************/ 56 | void cmd_gettext(uint8_t argc, char **argv) 57 | { 58 | // Print results from an alpha-numeric dialogue 59 | char* results = alphaShowDialogue(); 60 | drawFill(COLOR_BLACK); 61 | printf("%s%s", results, CFG_PRINTF_NEWLINE); 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /project/commands/cmd_lm75b_gettemp.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_lm75b_gettemp.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_lm75b_gettemp in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #ifdef CFG_LM75B 46 | #include "drivers/sensors/lm75b/lm75b.h" 47 | 48 | /**************************************************************************/ 49 | /*! 50 | Gets the current temperature in degrees celsius from the LM75B 51 | */ 52 | /**************************************************************************/ 53 | void cmd_lm75b_gettemp(uint8_t argc, char **argv) 54 | { 55 | int32_t temp = 0; 56 | 57 | // Get the current temperature (in 0.125°C units) 58 | lm75bGetTemperature(&temp); 59 | 60 | // Multiply value by 125 for fixed-point math (0.125°C per unit) 61 | temp *= 125; 62 | 63 | // Use modulus operator to display decimal value 64 | printf("%d.%d C%s", temp / 1000, temp % 1000, CFG_PRINTF_NEWLINE); 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /core/usbcdc/usbcore.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * U S B - K e r n e l 3 | *---------------------------------------------------------------------------- 4 | * Name: usbcore.h 5 | * Purpose: USB Core Definitions 6 | * Version: V1.20 7 | *---------------------------------------------------------------------------- 8 | * This software is supplied "AS IS" without any warranties, express, 9 | * implied or statutory, including but not limited to the implied 10 | * warranties of fitness for purpose, satisfactory quality and 11 | * noninfringement. Keil extends you a royalty-free right to reproduce 12 | * and distribute executable files created using this software for use 13 | * on NXP Semiconductors LPC microcontroller devices only. Nothing else 14 | * gives you the right to use this software. 15 | * 16 | * Copyright (c) 2009 Keil - An ARM Company. All rights reserved. 17 | *---------------------------------------------------------------------------*/ 18 | 19 | #ifndef __USBCORE_H__ 20 | #define __USBCORE_H__ 21 | 22 | #include "usbcfg.h" 23 | 24 | /* USB Endpoint Data Structure */ 25 | typedef struct _USB_EP_DATA { 26 | uint8_t *pData; 27 | uint16_t Count; 28 | } USB_EP_DATA; 29 | 30 | /* USB Core Global Variables */ 31 | extern uint16_t USB_DeviceStatus; 32 | extern uint8_t USB_DeviceAddress; 33 | volatile extern uint8_t USB_Configuration; 34 | extern uint32_t USB_EndPointMask; 35 | extern uint32_t USB_EndPointHalt; 36 | extern uint32_t USB_EndPointStall; 37 | extern uint8_t USB_AltSetting[USB_IF_NUM]; 38 | 39 | /* USB Endpoint 0 Buffer */ 40 | extern uint8_t EP0Buf[USB_MAX_PACKET0]; 41 | 42 | /* USB Endpoint 0 Data Info */ 43 | extern USB_EP_DATA EP0Data; 44 | 45 | /* USB Setup Packet */ 46 | extern USB_SETUP_PACKET SetupPacket; 47 | 48 | /* USB Core Functions */ 49 | extern void USB_ResetCore (void); 50 | 51 | /* Newer C compilers make it really difficult to add 52 | * an integer to a pointer */ 53 | static inline void UsbAddPtr(void **vpptr, uint32_t n); 54 | 55 | /* 56 | * Add a number of bytes to a pointer's address 57 | * Harder than you might think. Some compilers say: 58 | * Expected an lvalue -- Assignment expects its first operand to be 59 | * an lvalue. Please note that a cast removes the lvaluedness of an 60 | * expression. 61 | * 62 | * vpptr = void pointer to pointer 63 | * n = number of bytes to add to pointer 64 | * Call looks like: AddPtr((void **)&myPointer, 8); 65 | */ 66 | static inline void UsbAddPtr(void **vpptr, uint32_t n) 67 | { 68 | /* Declare a pointer to a pointer to a byte. Only a byte pointer 69 | * can be incremented by a number of bytes. Other pointers will 70 | * increment by a multiple of what they point to. 71 | */ 72 | uint8_t **bpptr; 73 | 74 | /* Convert our void pointer to a pointer to a byte pointer to a pointer */ 75 | bpptr = (uint8_t **)vpptr; 76 | 77 | /* Add 'n' bytes to our pointer value */ 78 | (*bpptr) += n; 79 | } 80 | 81 | 82 | #endif /* __USBCORE_H__ */ 83 | -------------------------------------------------------------------------------- /core/uart/uart.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file uart.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef __UART_H__ 40 | #define __UART_H__ 41 | 42 | #include "projectconfig.h" 43 | 44 | // Buffer used for circular fifo 45 | typedef struct _uart_buffer_t 46 | { 47 | uint8_t ep_dir; 48 | volatile uint8_t len; 49 | volatile uint8_t wr_ptr; 50 | volatile uint8_t rd_ptr; 51 | uint8_t buf[CFG_UART_BUFSIZE]; 52 | } uart_buffer_t; 53 | 54 | // UART Protocol control block 55 | typedef struct _uart_pcb_t 56 | { 57 | BOOL initialised; 58 | uint32_t baudrate; 59 | uint32_t status; 60 | uint32_t pending_tx_data; 61 | uart_buffer_t rxfifo; 62 | } uart_pcb_t; 63 | 64 | void UART_IRQHandler(void); 65 | uart_pcb_t *uartGetPCB(); 66 | void uartInit(uint32_t Baudrate); 67 | void uartSend(uint8_t *BufferPtr, uint32_t Length); 68 | void uartSendByte (uint8_t byte); 69 | 70 | // Rx Buffer access control 71 | void uartRxBufferInit(); 72 | uint8_t uartRxBufferRead(); 73 | void uartRxBufferWrite(uint8_t data); 74 | void uartRxBufferClearFIFO(); 75 | uint8_t uartRxBufferDataPending(); 76 | bool uartRxBufferReadArray(byte_t* rx, size_t* len); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /core/usbhid-rom/usbconfig.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file usbconfig.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _USBCONFIG_H_ 40 | #define _USBCONFIG_H_ 41 | 42 | #include "projectconfig.h" 43 | 44 | #define USB_VENDOR_ID CFG_USB_VID // Vendor ID 45 | #define USB_PROD_ID CFG_USB_PID // Product ID 46 | #define USB_DEVICE 0x0100 // Device ID 47 | 48 | #define WBVAL(x) ((x) & 0xFF),(((x) >> 8) & 0xFF) 49 | 50 | #define USB_DEVICE_DESC_SIZE (sizeof(USB_DEVICE_DESCRIPTOR)) 51 | #define USB_CONFIGUARTION_DESC_SIZE (sizeof(USB_CONFIGURATION_DESCRIPTOR)) 52 | #define USB_INTERFACE_DESC_SIZE (sizeof(USB_INTERFACE_DESCRIPTOR)) 53 | #define USB_ENDPOINT_DESC_SIZE (sizeof(USB_ENDPOINT_DESCRIPTOR)) 54 | 55 | #define HID_DESC_OFFSET 0x0012 56 | #define HID_DESC_SIZE (sizeof(HID_DESCRIPTOR)) 57 | #define HID_REPORT_DESC_SIZE (sizeof(HID_ReportDescriptor)) 58 | 59 | extern const uint8_t USB_DeviceDescriptor[]; 60 | extern const uint8_t USB_ConfigDescriptor[]; 61 | extern const uint8_t USB_HIDStringDescriptor[]; 62 | 63 | extern const uint8_t HID_ReportDescriptor[]; 64 | extern const uint16_t HID_ReportDescSize; 65 | 66 | #endif -------------------------------------------------------------------------------- /drivers/storage/eeprom/eeprom.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file eeprom.h 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2010, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #ifndef __EEPROM_H__ 37 | #define __EEPROM_H__ 38 | 39 | #include "projectconfig.h" 40 | 41 | // Method Prototypes 42 | bool eepromCheckAddress ( uint16_t addr ); 43 | uint8_t eepromReadU8 ( uint16_t addr ); 44 | int8_t eepromReadS8 ( uint16_t addr ); 45 | uint16_t eepromReadU16 ( uint16_t addr ); 46 | int16_t eepromReadS16 ( uint16_t addr ); 47 | uint32_t eepromReadU32 ( uint16_t addr ); 48 | int32_t eepromReadS32 ( uint16_t addr ); 49 | uint64_t eepromReadU64 ( uint16_t addr ); 50 | int64_t eepromReadS64 ( uint16_t addr ); 51 | void eepromReadBuffer ( uint16_t addr, uint8_t *buffer, uint32_t bufferLength); 52 | void eepromWriteU8 ( uint16_t addr, uint8_t value ); 53 | void eepromWriteS8 ( uint16_t addr, int8_t value ); 54 | void eepromWriteU16 ( uint16_t addr, uint16_t value ); 55 | void eepromWriteS16 ( uint16_t addr, int16_t value ); 56 | void eepromWriteU32 ( uint16_t addr, uint32_t value ); 57 | void eepromWriteS32 ( uint16_t addr, int32_t value ); 58 | void eepromWriteU64 ( uint16_t addr, uint64_t value ); 59 | void eepromWriteS64 ( uint16_t addr, int64_t value ); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /sysdefs.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file sysdefs.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _SYSDEFS_H_ 40 | #define _SYSDEFS_H_ 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | #ifndef ASM 47 | # define ASM __asm volatile 48 | #endif 49 | 50 | #ifndef INLINE 51 | # if __GNUC__ && !__GNUC_STDC_INLINE__ 52 | # define INLINE extern inline 53 | # else 54 | # define INLINE inline 55 | # endif 56 | #endif 57 | 58 | // GCC does not inline any functions when not optimizing unless you specify 59 | // the 'always_inline' attribute for the function 60 | #ifndef INLINE_POST 61 | # define INLINE_POST __attribute__((always_inline)) 62 | #endif 63 | 64 | // Stay compatible with ugly "windows" style 65 | #define BOOL bool 66 | 67 | #ifndef TRUE 68 | #define TRUE true 69 | #endif 70 | #ifndef FALSE 71 | #define FALSE false 72 | #endif 73 | 74 | typedef volatile uint8_t REG8; 75 | typedef volatile uint16_t REG16; 76 | typedef volatile uint32_t REG32; 77 | typedef unsigned char byte_t; 78 | 79 | #define pREG8 (REG8 *) 80 | #define pREG16 (REG16 *) 81 | #define pREG32 (REG32 *) 82 | 83 | #ifndef NULL 84 | #define NULL ((void *) 0) 85 | #endif 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /project/commands/drawing/cmd_clear.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_clear.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_clear in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #ifdef CFG_TFTLCD 46 | #include "drivers/displays/tft/lcd.h" 47 | #include "drivers/displays/tft/drawing.h" 48 | 49 | /**************************************************************************/ 50 | /*! 51 | Fills the LCD with the supplied RGB565 color 52 | */ 53 | /**************************************************************************/ 54 | void cmd_clear(uint8_t argc, char **argv) 55 | { 56 | int32_t col = 0; 57 | if (argc > 0) 58 | { 59 | // Try to convert supplied value to an integer 60 | getNumber (argv[0], &col); 61 | 62 | // Check for invalid values (getNumber may complain about this as well) 63 | if (col < 0 || col > 0xFFFF) 64 | { 65 | printf("Invalid Color%s", CFG_PRINTF_NEWLINE); 66 | return; 67 | } 68 | } 69 | 70 | // Fill the screen 71 | drawFill((uint16_t)col); 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /drivers/storage/eeprom/mcp24aa/mcp24aa.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file mcp24aa.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | 39 | #ifndef _MCP24AA_H_ 40 | #define _MCP24AA_H_ 41 | 42 | #include "projectconfig.h" 43 | 44 | #define MCP24AA_ADDR 0xA0 // 10100000 45 | #define MCP24AA_RW 0x01 46 | #define MCP24AA_READBIT 0x01 47 | #define MCP24AA_MAXADDR 0xFFF // 4K = 4096 48 | 49 | typedef enum 50 | { 51 | MCP24AA_ERROR_OK = 0, // Everything executed normally 52 | MCP24AA_ERROR_I2CINIT, // Unable to initialise I2C 53 | MCP24AA_ERROR_I2CBUSY, // I2C already in use 54 | MCP24AA_ERROR_ADDRERR, // Address out of range 55 | MCP24AA_ERROR_BUFFEROVERFLOW, // Max 8 bytes can be read/written in one operation 56 | MCP24AA_ERROR_LAST 57 | } 58 | mcp24aaError_e; 59 | 60 | mcp24aaError_e mcp24aaInit (void); 61 | mcp24aaError_e mcp24aaReadBuffer (uint16_t address, uint8_t *buffer, uint32_t bufferLength); 62 | mcp24aaError_e mcp24aaWriteBuffer (uint16_t address, uint8_t *buffer, uint32_t bufferLength); 63 | mcp24aaError_e mcp24aaReadByte (uint16_t address, uint8_t *buffer); 64 | mcp24aaError_e mcp24aaWriteByte (uint16_t address, uint8_t value); 65 | 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file main.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2011, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #include 37 | #include 38 | #include 39 | 40 | #include "projectconfig.h" 41 | #include "sysinit.h" 42 | 43 | #include "core/gpio/gpio.h" 44 | #include "core/systick/systick.h" 45 | 46 | #ifdef CFG_INTERFACE 47 | #include "core/cmd/cmd.h" 48 | #endif 49 | 50 | /**************************************************************************/ 51 | /*! 52 | Main program entry point. After reset, normal code execution will 53 | begin here. 54 | */ 55 | /**************************************************************************/ 56 | int main(void) 57 | { 58 | // Configure cpu and mandatory peripherals 59 | systemInit(); 60 | 61 | uint32_t currentSecond, lastSecond; 62 | currentSecond = lastSecond = 0; 63 | 64 | while (1) 65 | { 66 | // Toggle LED once per second 67 | currentSecond = systickGetSecondsActive(); 68 | if (currentSecond != lastSecond) 69 | { 70 | lastSecond = currentSecond; 71 | gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, lastSecond % 2); 72 | } 73 | 74 | // Poll for CLI input if CFG_INTERFACE is enabled in projectconfig.h 75 | #ifdef CFG_INTERFACE 76 | cmdPoll(); 77 | #endif 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /drivers/displays/smallfonts.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file smallfonts.h 4 | @author K. Townsend (microBuilder.eu) 5 | @date 22 March 2010 6 | @version 0.10 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2010, microBuilder SARL 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | #ifndef __SMALLFONTS_H_ 39 | #define __SMALLFONTS_H_ 40 | 41 | /* Partially based on original code for the KS0108 by Stephane Rey */ 42 | /* Current version by Kevin Townsend */ 43 | /* Last Updated: 12 May 2009 */ 44 | 45 | #include "projectconfig.h" 46 | 47 | struct FONT_DEF 48 | { 49 | uint8_t u8Width; /* Character width for storage */ 50 | uint8_t u8Height; /* Character height for storage */ 51 | uint8_t u8FirstChar; /* The first character available */ 52 | uint8_t u8LastChar; /* The last character available */ 53 | const uint8_t *au8FontTable; /* Font table start address in memory */ 54 | }; 55 | 56 | extern const struct FONT_DEF Font_System3x6; 57 | extern const struct FONT_DEF Font_System5x8; 58 | extern const struct FONT_DEF Font_System7x8; 59 | extern const struct FONT_DEF Font_8x8; 60 | extern const struct FONT_DEF Font_8x8Thin; 61 | 62 | extern const uint8_t au8FontSystem3x6[]; 63 | extern const uint8_t au8FontSystem5x8[]; 64 | extern const uint8_t au8FontSystem7x8[]; 65 | extern const uint8_t au8Font8x8[]; 66 | extern const uint8_t au8Font8x8Thin[]; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /tools/examples/default/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file main.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2011, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #include 37 | #include 38 | #include 39 | 40 | #include "projectconfig.h" 41 | #include "sysinit.h" 42 | 43 | #include "core/gpio/gpio.h" 44 | #include "core/systick/systick.h" 45 | 46 | #ifdef CFG_INTERFACE 47 | #include "core/cmd/cmd.h" 48 | #endif 49 | 50 | /**************************************************************************/ 51 | /*! 52 | Main program entry point. After reset, normal code execution will 53 | begin here. 54 | */ 55 | /**************************************************************************/ 56 | int main(void) 57 | { 58 | // Configure cpu and mandatory peripherals 59 | systemInit(); 60 | 61 | uint32_t currentSecond, lastSecond; 62 | currentSecond = lastSecond = 0; 63 | 64 | while (1) 65 | { 66 | // Toggle LED once per second 67 | currentSecond = systickGetSecondsActive(); 68 | if (currentSecond != lastSecond) 69 | { 70 | lastSecond = currentSecond; 71 | gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, lastSecond % 2); 72 | } 73 | 74 | // Poll for CLI input if CFG_INTERFACE is enabled in projectconfig.h 75 | #ifdef CFG_INTERFACE 76 | cmdPoll(); 77 | #endif 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /drivers/displays/tft/controls/label.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file label.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Renders a label 7 | 8 | @section LICENSE 9 | 10 | Software License Agreement (BSD License) 11 | 12 | Copyright (c) 2012, K. Townsend 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 27 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | /**************************************************************************/ 38 | #include 39 | 40 | #include "label.h" 41 | 42 | /**************************************************************************/ 43 | /*! 44 | @brief Draws a simple label 45 | 46 | @param[in] x 47 | Starting x co-ordinate 48 | @param[in] y 49 | Starting y co-ordinate 50 | @param[in] bgColor 51 | Color used for the background (required for AA fonts) 52 | @param[in] fontColor 53 | Color used when rendering the text 54 | @param[in] text 55 | Text to center inside the label 56 | */ 57 | /**************************************************************************/ 58 | void labelRender(uint16_t x, uint16_t y, uint16_t bgColor, uint16_t fontColor, char *text, theme_t theme) 59 | { 60 | #if CFG_TFTLCD_USEAAFONTS 61 | uint16_t ctable[4]; 62 | if (text != NULL) 63 | { 64 | aafontsCalculateColorTable(bgColor, fontColor, &ctable[0], 4); 65 | aafontsDrawString(x, y, ctable, &THEME_FONT, text); 66 | } 67 | #else 68 | // Render text 69 | if (text != NULL) 70 | { 71 | fontsDrawString(x, y, fontColor, &THEME_FONT, text); 72 | } 73 | #endif 74 | } 75 | -------------------------------------------------------------------------------- /project/commands/cmd_i2ceeprom_read.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file cmd_i2ceeprom_read.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @brief Code to execute for cmd_i2ceeprom_read in the 'core/cmd' 7 | command-line interpretter. 8 | 9 | @section LICENSE 10 | 11 | Software License Agreement (BSD License) 12 | 13 | Copyright (c) 2010, microBuilder SARL 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 1. Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 2. Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | /**************************************************************************/ 39 | #include 40 | 41 | #include "projectconfig.h" 42 | #include "core/cmd/cmd.h" 43 | #include "project/commands.h" // Generic helper functions 44 | 45 | #ifdef CFG_I2CEEPROM 46 | #include "drivers/storage/eeprom/eeprom.h" 47 | 48 | /**************************************************************************/ 49 | /*! 50 | Reads a single byte at the supplied EEPROM address 51 | */ 52 | /**************************************************************************/ 53 | void cmd_i2ceeprom_read(uint8_t argc, char **argv) 54 | { 55 | uint16_t addr; 56 | uint8_t value; 57 | 58 | // Try to convert supplied address to an integer 59 | int32_t addr32; 60 | getNumber (argv[0], &addr32); 61 | 62 | // Check for invalid values (getNumber may complain about this as well) 63 | if (addr32 < 0 || eepromCheckAddress(addr32)) 64 | { 65 | printf("Address out of range %s", CFG_PRINTF_NEWLINE); 66 | return; 67 | } 68 | 69 | // Address seems to be OK 70 | addr = (uint16_t)addr32; 71 | value = eepromReadU8(addr); 72 | 73 | printf("0x%02X%s", value, CFG_PRINTF_NEWLINE); 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /tools/validation/startupdelay/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file main.c 4 | @author K. Townsend (microBuilder.eu) 5 | 6 | @section LICENSE 7 | 8 | Software License Agreement (BSD License) 9 | 10 | Copyright (c) 2011, microBuilder SARL 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /**************************************************************************/ 36 | #include "projectconfig.h" 37 | 38 | #include "core/gpio/gpio.h" 39 | 40 | /**************************************************************************/ 41 | /*! 42 | As soon as the chip comes out of reset and the startup code has 43 | finished executing, sets up GPIO pin 2.1 as an ouput and high. 44 | 45 | This can be used to determine the startup delay, by measuring the 46 | time between reset be deasserted and the GPIO pin going high, minus 47 | the GPIO overhead of a few clock cycles. 48 | 49 | HW Setup: Set channel one of the oscilliscope to the reset pin, and 50 | channel two of the oscilliscope to GPIO pin 2.1. 51 | 52 | Set a trigger on the rising edge of the reset pin, and 53 | measure the delay between the rising edge of reset and the 54 | rising edge of GPIO 2.1. 55 | */ 56 | /**************************************************************************/ 57 | int main(void) 58 | { 59 | /* Enable AHB clock to the GPIO domain. */ 60 | SCB_SYSAHBCLKCTRL |= (SCB_SYSAHBCLKCTRL_GPIO); 61 | 62 | /* Set 2.1 to output and high */ 63 | GPIO_GPIO2DIR |= (1 << 1); // pin 1 = Output 64 | GPIO_GPIO2DATA |= (1 << 1); // pin 1 = High 65 | 66 | while(1) 67 | { 68 | } 69 | 70 | return 0; 71 | } 72 | --------------------------------------------------------------------------------