├── Provision ├── assets │ ├── edge.png │ ├── eff.png │ ├── lock.png │ ├── ski.png │ ├── AND!XOR.bmp │ ├── bender.png │ ├── defcon.png │ ├── floppy.png │ ├── hackers.gif │ ├── nayan.gif │ ├── party.gif │ ├── pipetop.png │ ├── ship0.png │ ├── ship135.png │ ├── ship180.png │ ├── ship225.png │ ├── ship270.png │ ├── ship315.png │ ├── ship45.png │ ├── ship90.png │ ├── skiflag.png │ ├── skileft.png │ ├── skirock.png │ ├── skitree.png │ ├── virus.png │ ├── Flames-bw.gif │ ├── hackaday.png │ ├── ninja-dt.png │ ├── ninja-up.png │ ├── party-fry.gif │ ├── purisa-0.png │ ├── purisa-1.png │ ├── purisa-2.png │ ├── purisa-3.png │ ├── purisa-4.png │ ├── purisa-5.png │ ├── purisa-6.png │ ├── purisa-7.png │ ├── purisa-8.png │ ├── purisa-9.png │ ├── purisa-a.png │ ├── purisa-b.png │ ├── purisa-c.png │ ├── purisa-d.png │ ├── purisa-e.png │ ├── purisa-f.png │ ├── purisa-g.png │ ├── purisa-gt.png │ ├── purisa-h.png │ ├── purisa-i.png │ ├── purisa-j.png │ ├── purisa-k.png │ ├── purisa-l.png │ ├── purisa-lt.png │ ├── purisa-m.png │ ├── purisa-n.png │ ├── purisa-o.png │ ├── purisa-p.png │ ├── purisa-q.png │ ├── purisa-r.png │ ├── purisa-s.png │ ├── purisa-t.png │ ├── purisa-u.png │ ├── purisa-v.png │ ├── purisa-w.png │ ├── purisa-x.png │ ├── purisa-y.png │ ├── purisa-z.png │ ├── skiright.png │ ├── wargames.gif │ ├── knightrider.gif │ ├── lycologo-bw.gif │ ├── major-lazer.bmp │ ├── ninja-down.png │ ├── ninja-kick.png │ ├── ninja-punch.png │ ├── ninja-right.png │ ├── ninja-shield.png │ ├── party-bender.gif │ ├── party-toad.gif │ ├── pipebottom.png │ ├── pirateflag.gif │ ├── purisa-colon.png │ ├── purisa-comma.png │ ├── purisa-pipe.png │ ├── purisa-semi.png │ ├── purisa-space.png │ ├── rememberme.gif │ ├── ANDnXOR-Unlock.gif │ ├── ninja-p1-dead.png │ ├── ninja-p1-idle1.png │ ├── ninja-p1-idle2.png │ ├── ninja-p1-kick1.png │ ├── ninja-p1-kick2.png │ ├── ninja-p2-dead.png │ ├── ninja-p2-idle1.png │ ├── ninja-p2-idle2.png │ ├── ninja-p2-kick1.png │ ├── ninja-p2-kick2.png │ ├── party-zoidburg.gif │ ├── purisa-forward.png │ ├── purisa-lbrace.png │ ├── purisa-lparen.png │ ├── purisa-period.png │ ├── purisa-rbrace.png │ ├── purisa-rparen.png │ ├── AND!XOR-ripples.gif │ ├── defcon_down-small.png │ ├── defcon_up-small.png │ ├── netscape-dithered.gif │ ├── ninja-p1-punch1.png │ ├── ninja-p1-punch2.png │ ├── ninja-p1-shield.png │ ├── ninja-p1-shield2.png │ ├── ninja-p2-punch1.png │ ├── ninja-p2-punch2.png │ ├── ninja-p2-shield.png │ ├── ninja-p2-shield2.png │ ├── purisa-backward.png │ ├── purisa-lbracket.png │ ├── purisa-question.png │ ├── purisa-rbracket.png │ ├── purisa-exclamation.png │ ├── rick-long-dithered-short.gif │ ├── matrix-c.xbm │ ├── matrix-d.xbm │ ├── matrix-e.xbm │ ├── matrix-f.xbm │ ├── matrix-n.xbm │ ├── matrix-o.xbm │ ├── NoService.xbm │ ├── AirplaneMode.xbm │ ├── Toast.xbm │ └── toaster.xbm ├── ANDnXOR_Badge-Flash.bin ├── ANDnXOR_Badge-Human.bin ├── ANDnXOR_Badge-Human.elf ├── ANDnXOR_Badge-LED.bin ├── ANDnXOR_Badge-Master.bin ├── ANDnXOR_Badge-Bootloader.bin ├── serial.sh ├── Program_flash.bat ├── flashdata.sh ├── README └── ANXFlash.py ├── ANDnXOR DEF CON 24 Badge Schematic.pdf ├── Inspiration ├── Maple Mini │ └── maplemini.pdf └── Espruino Pico │ └── schematic_1v3.pdf ├── Software ├── Bootloader │ ├── util │ │ ├── dfu-util.exe │ │ └── usb_descriptor_strings_util.html │ ├── build │ │ ├── usb_callbacks.o │ │ └── usb_callbacks.lst │ ├── README_ANDnXOR │ ├── CREDITS │ ├── usb_callbacks.c │ ├── README │ ├── usb_descriptor.h │ ├── usb_lib │ │ ├── usb_int.h │ │ ├── usb_mem.h │ │ ├── usb_lib.h │ │ ├── usb_init.h │ │ ├── usb_type.h │ │ ├── usb_def.h │ │ ├── usb_init.c │ │ └── usb_mem.c │ ├── flash │ │ ├── openocd.cfg │ │ ├── stm32.cfg │ │ ├── debug.cfg │ │ └── flash.cfg │ ├── common.h │ └── stm32_lib │ │ ├── cortexm3_macro.h │ │ ├── stm32f10x_type.h │ │ └── cortexm3_macro.s ├── lib │ ├── NT-Shell-ANDnXOR │ │ ├── sample │ │ │ └── target │ │ │ │ ├── nxp-lpc824 │ │ │ │ ├── lpc_chip_8xx │ │ │ │ │ ├── version.txt │ │ │ │ │ ├── .project │ │ │ │ │ ├── inc │ │ │ │ │ │ ├── sys_config.h │ │ │ │ │ │ ├── rom_pwr_8xx.h │ │ │ │ │ │ └── romapi_8xx.h │ │ │ │ │ └── src │ │ │ │ │ │ ├── gpio_8xx.c │ │ │ │ │ │ ├── chip_8xx.c │ │ │ │ │ │ ├── swm_8xx.c │ │ │ │ │ │ ├── wwdt_8xx.c │ │ │ │ │ │ ├── sct_8xx.c │ │ │ │ │ │ └── wkt_8xx.c │ │ │ │ └── lpc_monitor │ │ │ │ │ ├── src │ │ │ │ │ ├── uart.h │ │ │ │ │ ├── usrcmd.h │ │ │ │ │ ├── uart.c │ │ │ │ │ ├── crp.c │ │ │ │ │ ├── main.c │ │ │ │ │ ├── sysinit.c │ │ │ │ │ └── mtb.c │ │ │ │ │ └── .project │ │ │ │ └── acb-bf592 │ │ │ │ ├── chip.h │ │ │ │ ├── uart.h │ │ │ │ ├── chip.c │ │ │ │ ├── uart.c │ │ │ │ └── main.c │ │ ├── library.properties │ │ ├── ntconf.h │ │ ├── ntint.h │ │ ├── ntlibc.h │ │ ├── ntopt.h │ │ ├── text_history.h │ │ ├── text_editor.h │ │ ├── ntstdio.h │ │ ├── ntshell.h │ │ └── vtsend.h │ ├── LowPowerLab-RFM69-STM32-ANDnXOR │ │ ├── Examples │ │ │ ├── MotionMote │ │ │ │ └── OLD │ │ │ │ │ ├── MotionMote.jpg │ │ │ │ │ └── MotionMote.ino │ │ │ └── RandomNumbers │ │ │ │ └── RandomNumbers.ino │ │ ├── library.json │ │ └── keywords.txt │ ├── Adafruit_SSD1306-ANDnXOR │ │ ├── STM32 README.txt │ │ ├── README.txt │ │ └── license.txt │ ├── Adafruit-GFX-Library-master │ │ ├── library.properties │ │ ├── license.txt │ │ └── README.txt │ └── Adafruit_NeoPixel-ANDnXOR │ │ ├── README.md │ │ ├── examples │ │ └── strandtest │ │ │ └── strandtest.pde │ │ └── Adafruit_NeoPixel-ANDnXOR.h └── ANDnXOR_Badge │ ├── chat.h │ ├── life.h │ ├── serial.h │ ├── input.h │ ├── pong.h │ ├── anim.h │ ├── buttons.h │ ├── term.h │ ├── menu.h │ ├── flash.h │ ├── ninja.h │ ├── settings.h │ ├── strings.h │ └── games.h ├── README.md └── Gerbers ├── ANDnXOR Badge-NPTH.drl └── ANDnXOR Badge-B.Paste.gbp /Provision/assets/edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/edge.png -------------------------------------------------------------------------------- /Provision/assets/eff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/eff.png -------------------------------------------------------------------------------- /Provision/assets/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/lock.png -------------------------------------------------------------------------------- /Provision/assets/ski.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ski.png -------------------------------------------------------------------------------- /Provision/assets/AND!XOR.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/AND!XOR.bmp -------------------------------------------------------------------------------- /Provision/assets/bender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/bender.png -------------------------------------------------------------------------------- /Provision/assets/defcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/defcon.png -------------------------------------------------------------------------------- /Provision/assets/floppy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/floppy.png -------------------------------------------------------------------------------- /Provision/assets/hackers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/hackers.gif -------------------------------------------------------------------------------- /Provision/assets/nayan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/nayan.gif -------------------------------------------------------------------------------- /Provision/assets/party.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/party.gif -------------------------------------------------------------------------------- /Provision/assets/pipetop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/pipetop.png -------------------------------------------------------------------------------- /Provision/assets/ship0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship0.png -------------------------------------------------------------------------------- /Provision/assets/ship135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship135.png -------------------------------------------------------------------------------- /Provision/assets/ship180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship180.png -------------------------------------------------------------------------------- /Provision/assets/ship225.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship225.png -------------------------------------------------------------------------------- /Provision/assets/ship270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship270.png -------------------------------------------------------------------------------- /Provision/assets/ship315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship315.png -------------------------------------------------------------------------------- /Provision/assets/ship45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship45.png -------------------------------------------------------------------------------- /Provision/assets/ship90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ship90.png -------------------------------------------------------------------------------- /Provision/assets/skiflag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/skiflag.png -------------------------------------------------------------------------------- /Provision/assets/skileft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/skileft.png -------------------------------------------------------------------------------- /Provision/assets/skirock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/skirock.png -------------------------------------------------------------------------------- /Provision/assets/skitree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/skitree.png -------------------------------------------------------------------------------- /Provision/assets/virus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/virus.png -------------------------------------------------------------------------------- /Provision/assets/Flames-bw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/Flames-bw.gif -------------------------------------------------------------------------------- /Provision/assets/hackaday.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/hackaday.png -------------------------------------------------------------------------------- /Provision/assets/ninja-dt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-dt.png -------------------------------------------------------------------------------- /Provision/assets/ninja-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-up.png -------------------------------------------------------------------------------- /Provision/assets/party-fry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/party-fry.gif -------------------------------------------------------------------------------- /Provision/assets/purisa-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-0.png -------------------------------------------------------------------------------- /Provision/assets/purisa-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-1.png -------------------------------------------------------------------------------- /Provision/assets/purisa-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-2.png -------------------------------------------------------------------------------- /Provision/assets/purisa-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-3.png -------------------------------------------------------------------------------- /Provision/assets/purisa-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-4.png -------------------------------------------------------------------------------- /Provision/assets/purisa-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-5.png -------------------------------------------------------------------------------- /Provision/assets/purisa-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-6.png -------------------------------------------------------------------------------- /Provision/assets/purisa-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-7.png -------------------------------------------------------------------------------- /Provision/assets/purisa-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-8.png -------------------------------------------------------------------------------- /Provision/assets/purisa-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-9.png -------------------------------------------------------------------------------- /Provision/assets/purisa-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-a.png -------------------------------------------------------------------------------- /Provision/assets/purisa-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-b.png -------------------------------------------------------------------------------- /Provision/assets/purisa-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-c.png -------------------------------------------------------------------------------- /Provision/assets/purisa-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-d.png -------------------------------------------------------------------------------- /Provision/assets/purisa-e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-e.png -------------------------------------------------------------------------------- /Provision/assets/purisa-f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-f.png -------------------------------------------------------------------------------- /Provision/assets/purisa-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-g.png -------------------------------------------------------------------------------- /Provision/assets/purisa-gt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-gt.png -------------------------------------------------------------------------------- /Provision/assets/purisa-h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-h.png -------------------------------------------------------------------------------- /Provision/assets/purisa-i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-i.png -------------------------------------------------------------------------------- /Provision/assets/purisa-j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-j.png -------------------------------------------------------------------------------- /Provision/assets/purisa-k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-k.png -------------------------------------------------------------------------------- /Provision/assets/purisa-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-l.png -------------------------------------------------------------------------------- /Provision/assets/purisa-lt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-lt.png -------------------------------------------------------------------------------- /Provision/assets/purisa-m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-m.png -------------------------------------------------------------------------------- /Provision/assets/purisa-n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-n.png -------------------------------------------------------------------------------- /Provision/assets/purisa-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-o.png -------------------------------------------------------------------------------- /Provision/assets/purisa-p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-p.png -------------------------------------------------------------------------------- /Provision/assets/purisa-q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-q.png -------------------------------------------------------------------------------- /Provision/assets/purisa-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-r.png -------------------------------------------------------------------------------- /Provision/assets/purisa-s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-s.png -------------------------------------------------------------------------------- /Provision/assets/purisa-t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-t.png -------------------------------------------------------------------------------- /Provision/assets/purisa-u.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-u.png -------------------------------------------------------------------------------- /Provision/assets/purisa-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-v.png -------------------------------------------------------------------------------- /Provision/assets/purisa-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-w.png -------------------------------------------------------------------------------- /Provision/assets/purisa-x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-x.png -------------------------------------------------------------------------------- /Provision/assets/purisa-y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-y.png -------------------------------------------------------------------------------- /Provision/assets/purisa-z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-z.png -------------------------------------------------------------------------------- /Provision/assets/skiright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/skiright.png -------------------------------------------------------------------------------- /Provision/assets/wargames.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/wargames.gif -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-Flash.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-Flash.bin -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-Human.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-Human.bin -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-Human.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-Human.elf -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-LED.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-LED.bin -------------------------------------------------------------------------------- /Provision/assets/knightrider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/knightrider.gif -------------------------------------------------------------------------------- /Provision/assets/lycologo-bw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/lycologo-bw.gif -------------------------------------------------------------------------------- /Provision/assets/major-lazer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/major-lazer.bmp -------------------------------------------------------------------------------- /Provision/assets/ninja-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-down.png -------------------------------------------------------------------------------- /Provision/assets/ninja-kick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-kick.png -------------------------------------------------------------------------------- /Provision/assets/ninja-punch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-punch.png -------------------------------------------------------------------------------- /Provision/assets/ninja-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-right.png -------------------------------------------------------------------------------- /Provision/assets/ninja-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-shield.png -------------------------------------------------------------------------------- /Provision/assets/party-bender.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/party-bender.gif -------------------------------------------------------------------------------- /Provision/assets/party-toad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/party-toad.gif -------------------------------------------------------------------------------- /Provision/assets/pipebottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/pipebottom.png -------------------------------------------------------------------------------- /Provision/assets/pirateflag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/pirateflag.gif -------------------------------------------------------------------------------- /Provision/assets/purisa-colon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-colon.png -------------------------------------------------------------------------------- /Provision/assets/purisa-comma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-comma.png -------------------------------------------------------------------------------- /Provision/assets/purisa-pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-pipe.png -------------------------------------------------------------------------------- /Provision/assets/purisa-semi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-semi.png -------------------------------------------------------------------------------- /Provision/assets/purisa-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-space.png -------------------------------------------------------------------------------- /Provision/assets/rememberme.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/rememberme.gif -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-Master.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-Master.bin -------------------------------------------------------------------------------- /Provision/assets/ANDnXOR-Unlock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ANDnXOR-Unlock.gif -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-dead.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-idle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-idle1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-idle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-idle2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-kick1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-kick1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-kick2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-kick2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-dead.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-idle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-idle1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-idle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-idle2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-kick1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-kick1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-kick2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-kick2.png -------------------------------------------------------------------------------- /Provision/assets/party-zoidburg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/party-zoidburg.gif -------------------------------------------------------------------------------- /Provision/assets/purisa-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-forward.png -------------------------------------------------------------------------------- /Provision/assets/purisa-lbrace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-lbrace.png -------------------------------------------------------------------------------- /Provision/assets/purisa-lparen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-lparen.png -------------------------------------------------------------------------------- /Provision/assets/purisa-period.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-period.png -------------------------------------------------------------------------------- /Provision/assets/purisa-rbrace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-rbrace.png -------------------------------------------------------------------------------- /Provision/assets/purisa-rparen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-rparen.png -------------------------------------------------------------------------------- /ANDnXOR DEF CON 24 Badge Schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/ANDnXOR DEF CON 24 Badge Schematic.pdf -------------------------------------------------------------------------------- /Inspiration/Maple Mini/maplemini.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Inspiration/Maple Mini/maplemini.pdf -------------------------------------------------------------------------------- /Provision/ANDnXOR_Badge-Bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/ANDnXOR_Badge-Bootloader.bin -------------------------------------------------------------------------------- /Provision/assets/AND!XOR-ripples.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/AND!XOR-ripples.gif -------------------------------------------------------------------------------- /Provision/assets/defcon_down-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/defcon_down-small.png -------------------------------------------------------------------------------- /Provision/assets/defcon_up-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/defcon_up-small.png -------------------------------------------------------------------------------- /Provision/assets/netscape-dithered.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/netscape-dithered.gif -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-punch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-punch1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-punch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-punch2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-shield.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p1-shield2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p1-shield2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-punch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-punch1.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-punch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-punch2.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-shield.png -------------------------------------------------------------------------------- /Provision/assets/ninja-p2-shield2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/ninja-p2-shield2.png -------------------------------------------------------------------------------- /Provision/assets/purisa-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-backward.png -------------------------------------------------------------------------------- /Provision/assets/purisa-lbracket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-lbracket.png -------------------------------------------------------------------------------- /Provision/assets/purisa-question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-question.png -------------------------------------------------------------------------------- /Provision/assets/purisa-rbracket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-rbracket.png -------------------------------------------------------------------------------- /Software/Bootloader/util/dfu-util.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Software/Bootloader/util/dfu-util.exe -------------------------------------------------------------------------------- /Provision/assets/purisa-exclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/purisa-exclamation.png -------------------------------------------------------------------------------- /Inspiration/Espruino Pico/schematic_1v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Inspiration/Espruino Pico/schematic_1v3.pdf -------------------------------------------------------------------------------- /Software/Bootloader/build/usb_callbacks.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Software/Bootloader/build/usb_callbacks.o -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/version.txt: -------------------------------------------------------------------------------- 1 | LPCOPEN VERSION: 2_15 2 | RELEASE DATE: 3 | Thu 01/08/2015 4 | -------------------------------------------------------------------------------- /Provision/assets/rick-long-dithered-short.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Provision/assets/rick-long-dithered-short.gif -------------------------------------------------------------------------------- /Provision/serial.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UDEVICE=$1 4 | 5 | #Flash a unique node id to the device 6 | python flasher.py -s -d $UDEVICE -a 0x95000 7 | -------------------------------------------------------------------------------- /Software/Bootloader/README_ANDnXOR: -------------------------------------------------------------------------------- 1 | 2 | Build with: 3 | 4 | make andnxor-dc24-bender 5 | 6 | 7 | Bootloader is: 8 | binaries/dfu_boot20_andnxor_dc24_bender.bin 9 | -------------------------------------------------------------------------------- /Provision/assets/matrix-c.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_c_width 6 2 | #define matrix_c_height 6 3 | static unsigned char matrix_c_bits[] = { 4 | 0x1c, 0x0d, 0x0d, 0x19, 0x01, 0x23 }; 5 | -------------------------------------------------------------------------------- /Provision/assets/matrix-d.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_d_width 6 2 | #define matrix_d_height 6 3 | static unsigned char matrix_d_bits[] = { 4 | 0x3c, 0x04, 0x04, 0x12, 0x10, 0x00 }; 5 | -------------------------------------------------------------------------------- /Provision/assets/matrix-e.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_e_width 6 2 | #define matrix_e_height 6 3 | static unsigned char matrix_e_bits[] = { 4 | 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x3f }; 5 | -------------------------------------------------------------------------------- /Provision/assets/matrix-f.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_f_width 6 2 | #define matrix_f_height 6 3 | static unsigned char matrix_f_bits[] = { 4 | 0x3c, 0x00, 0x18, 0x00, 0x00, 0x04 }; 5 | -------------------------------------------------------------------------------- /Provision/assets/matrix-n.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_n_width 6 2 | #define matrix_n_height 6 3 | static unsigned char matrix_n_bits[] = { 4 | 0x00, 0x38, 0x2a, 0x36, 0x22, 0x22 }; 5 | -------------------------------------------------------------------------------- /Provision/assets/matrix-o.xbm: -------------------------------------------------------------------------------- 1 | #define matrix_o_width 6 2 | #define matrix_o_height 6 3 | static unsigned char matrix_o_bits[] = { 4 | 0x00, 0x18, 0x10, 0x10, 0x1a, 0x02 }; 5 | -------------------------------------------------------------------------------- /Provision/assets/NoService.xbm: -------------------------------------------------------------------------------- 1 | #define white_no_symbol_hi_width 8 2 | #define white_no_symbol_hi_height 8 3 | static unsigned char white_no_symbol_hi_bits[] = { 4 | 0x3c, 0x62, 0xa1, 0x91, 0x89, 0x85, 0x42, 0x3c }; 5 | -------------------------------------------------------------------------------- /Software/lib/LowPowerLab-RFM69-STM32-ANDnXOR/Examples/MotionMote/OLD/MotionMote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANDnXOR/ANDnXOR_DC24_Badge/HEAD/Software/lib/LowPowerLab-RFM69-STM32-ANDnXOR/Examples/MotionMote/OLD/MotionMote.jpg -------------------------------------------------------------------------------- /Provision/Program_flash.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | 4 | echo Programming Flash... 5 | C:\Users\anriley\Documents\Python34\python ANXFlash.py -f ANDnXOR_Badge-0.8.7-Flash.bin -d COM3 -a 0x1000 -o 0x1000 6 | echo Flash Complete! 7 | echo. 8 | 9 | pause 10 | -------------------------------------------------------------------------------- /Provision/assets/AirplaneMode.xbm: -------------------------------------------------------------------------------- 1 | #define AirplaneMode_width 9 2 | #define AirplaneMode_height 8 3 | static unsigned char AirplaneMode_bits[] = { 4 | 0x0c, 0x00, 0x18, 0x00, 0x39, 0x00, 0xff, 0x01, 0xff, 0x01, 0x39, 0x00, 5 | 0x18, 0x00, 0x0c, 0x00 }; 6 | -------------------------------------------------------------------------------- /Provision/flashdata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UDEVICE=$1 4 | FILE=$2 5 | 6 | #Flash the data starting after settings 7 | python3 ANXFlash.py -f $FILE -d $UDEVICE -a 0x1000 -o 0x1000 8 | 9 | #Flash a unique node id to the device 10 | python flasher.py -s -d $UDEVICE -a 0x95000 11 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/chat.h: -------------------------------------------------------------------------------- 1 | #ifndef ANX_CHAT_H 2 | #define ANX_CHAT_H 3 | 4 | void doChat(); 5 | void doQuickChat1(); 6 | void doQuickChat2(); 7 | void doQuickChat3(); 8 | void doQuickChat4(); 9 | void doQuickChat5(); 10 | void doQuickChat6(); 11 | void _drawMessages(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/library.properties: -------------------------------------------------------------------------------- 1 | name=NT-Shell 2 | version=0.30.1 3 | author=Shinichiro Nakamura 4 | maintainer= Shinichiro Nakamura 5 | sentence=NT-Shell 6 | paragraph=NT-Shell 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_SSD1306-ANDnXOR/STM32 README.txt: -------------------------------------------------------------------------------- 1 | STM32 adaption by Matthias Diro, 25.03.2015 2 | Things to know: 3 | This adaption uses hardware I2C (hardwire.h), Port: I2c2. SDA=0, SCL=1 on maple mini 4 | To change it to Port I2C1: 5 | //HardWire HWIRE(1,I2C_FAST_MODE); // I2c1 6 | HardWire HWIRE(2,I2C_FAST_MODE); // I2c2 -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/life.h: -------------------------------------------------------------------------------- 1 | #ifndef ANX_LIFE_H 2 | #define ANX_LIFE_H 3 | 4 | #define ANX_LIFE_WIDTH 128 5 | #define ANX_LIFE_HEIGHT 64 6 | #define ANX_LIFE_START_PROB 16 7 | #define ANX_LIFE_ANNIHILATION_W 64 8 | #define ANX_LIFE_ANNIHILATION_H 64 9 | 10 | extern void gameOfLife(); 11 | 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ANDnXOR_DC24_Badge 2 | 3 | To flash the Bender Badge, put it into DFU mode by holding the "Down" button while plugging into USB or pressing the reset button. A red LED near the AND!XOR DEFCON 24 silkscreen will flash rapidly. 4 | 5 | Use the following command to reflash: dfu-util -D Provision/ANDnXOR_Badge-Human.bin -a 2 6 | 7 | 8 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/serial.h: -------------------------------------------------------------------------------- 1 | #ifndef SERIAL_H 2 | #define SERIAL_H 3 | 4 | extern void doSerial(); 5 | extern void flushIncoming(); 6 | extern void readDataFromSerial(uint8_t *buffer, int size); 7 | extern void readLineFromSerial(char *buffer); 8 | extern void _eraseCommand(); 9 | extern void _readSerialCommand(); 10 | extern void _writeCommand(); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Gerbers/ANDnXOR Badge-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad 4.0.2+e4-6225~38~ubuntu16.04.1-stable} date Wed 15 Jun 2016 08:19:07 PM PDT 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | T1C0.051 7 | T2C0.157 8 | % 9 | G90 10 | G05 11 | M72 12 | T1 13 | X3.6496Y-5.6594 14 | X3.8307Y-5.6594 15 | T2 16 | X3.0669Y-2.4213 17 | X4.3898Y-2.4213 18 | T0 19 | M30 20 | -------------------------------------------------------------------------------- /Software/lib/LowPowerLab-RFM69-STM32-ANDnXOR/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RFM69", 3 | "keywords": "rf, radio, wireless, spi", 4 | "description": "RFM69 library for RFM69W, RFM69HW, RFM69CW, RFM69HCW (semtech SX1231, SX1231H)", 5 | "repository": 6 | { 7 | "type": "git", 8 | "url": "https://github.com/LowPowerLab/RFM69.git" 9 | }, 10 | "frameworks": "arduino", 11 | "platforms": "atmelavr" 12 | } 13 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/uart.h: -------------------------------------------------------------------------------- 1 | /** 2 | */ 3 | 4 | #ifndef UART_H 5 | #define UART_H 6 | 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void uart_init(void); 14 | uint8_t uart_getc(void); 15 | void uart_putc(uint8_t c); 16 | void uart_puts(char *str); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /Software/Bootloader/CREDITS: -------------------------------------------------------------------------------- 1 | This is at least a partial credits-file of people that have 2 | contributed to the Maple bootloader. It is formatted the same way the 3 | Linux kernel CREDITS file is structured: sorted by name and formatted 4 | for easy processing. 5 | 6 | The fields are: name (N), email (E), web-address (W), description (D). 7 | 8 | ---------- 9 | 10 | N: Tormod Volden 11 | E: debian.tormod@gmail.com 12 | D: Fixes for DFU compliance 13 | -------------------------------------------------------------------------------- /Software/lib/Adafruit-GFX-Library-master/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit GFX Library 2 | version=1.0.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from. 6 | paragraph=Install this library in addition to the display library for your hardware. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/input.h: -------------------------------------------------------------------------------- 1 | #ifndef ANXINPUT_H 2 | #define ANXINPUT_H 3 | 4 | void ANXInputClearChar(uint8_t row, uint8_t col, uint8_t startX, uint8_t startY); 5 | void ANXInputDrawCursor(uint8_t row, uint8_t col, uint8_t startX, uint8_t startY); 6 | void ANXInputMoveCursor(uint8_t row, uint8_t col, uint8_t startX, uint8_t startY); 7 | void ANXInput(char *message, uint8_t startX, uint8_t startY, uint8_t maxChars = ANX_INPUT_MAX, uint8_t maxCharsPerRow = 0); 8 | void ANXInputWindow(char *message, char * title, uint8_t maxChars); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/pong.h: -------------------------------------------------------------------------------- 1 | #ifndef PONG_H 2 | #define PONG_H 3 | #include 4 | 5 | #define BALL_RADIUS 3 6 | 7 | #define PADDLE_HEIGHT 15 8 | #define PADDLE_WIDTH 3 9 | #define PADDLE_RADIUS 2 10 | #define PADDLE_SPEED 2.8 11 | #define BALL_VELOCITY 4.8 12 | #define BALL_VY_BIAS 4.0 13 | #define AI_MIN_DELAY 80 14 | #define PONG_STEP 80 15 | #define PONG_DEFLECT_XP 7 16 | #define PONG_WIN_XP 10 17 | 18 | struct pongState { 19 | int16_t player1Y, player2Y; 20 | int16_t ballX, ballY; 21 | float ballVX, ballVY; 22 | int32_t lastAIMove; 23 | uint32_t xp; 24 | }; 25 | 26 | extern Adafruit_SSD1306 display; 27 | extern void doPong(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Provision/assets/Toast.xbm: -------------------------------------------------------------------------------- 1 | #define Toast_width 32 2 | #define Toast_height 24 3 | static unsigned char Toast_bits[] = { 4 | 0x00, 0x80, 0x03, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xfc, 0x3d, 0x00, 5 | 0x00, 0xff, 0x7f, 0x00, 0xc0, 0x57, 0xfb, 0x01, 0xf0, 0xaf, 0xee, 0x03, 6 | 0x7e, 0x57, 0xf5, 0x0f, 0xde, 0x11, 0xac, 0x3f, 0xff, 0x23, 0xf4, 0x3b, 7 | 0x77, 0x0d, 0x72, 0x7f, 0xfe, 0x29, 0xf5, 0xff, 0xfd, 0x17, 0xac, 0xfe, 8 | 0xfa, 0xed, 0xfa, 0xbf, 0xe2, 0xdf, 0xbd, 0x5f, 0xaa, 0xff, 0xff, 0xaa, 9 | 0x2c, 0xff, 0xf7, 0x53, 0xd0, 0xae, 0xbe, 0x54, 0xa0, 0xfc, 0x87, 0x0d, 10 | 0x40, 0xf5, 0xb7, 0x02, 0x80, 0xca, 0x53, 0x01, 0x00, 0x2a, 0x2c, 0x00, 11 | 0x00, 0xd4, 0x0a, 0x00, 0x00, 0xa8, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00 }; 12 | -------------------------------------------------------------------------------- /Provision/assets/toaster.xbm: -------------------------------------------------------------------------------- 1 | #define Toaster_width 32 2 | #define Toaster_height 27 3 | static unsigned char Toaster_bits[] = { 4 | 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x3c, 0x70, 0x00, 0x80, 0x83, 0x7e, 0x00, 5 | 0xc0, 0x71, 0x81, 0x03, 0x30, 0x0c, 0xe8, 0x07, 0x1c, 0x07, 0xff, 0x07, 6 | 0xc6, 0xe0, 0x3f, 0x08, 0xce, 0xf8, 0xff, 0x0f, 0x3e, 0xfe, 0xff, 0x0e, 7 | 0x7e, 0xde, 0xbf, 0x1d, 0xfc, 0xf7, 0xff, 0x06, 0xf1, 0xfd, 0x7f, 0x15, 8 | 0xc4, 0xfe, 0xff, 0x07, 0x09, 0xff, 0xff, 0x13, 0x10, 0xff, 0xff, 0x13, 9 | 0x11, 0x7f, 0xfe, 0x11, 0x10, 0xfe, 0xef, 0xb5, 0x05, 0xdf, 0xdb, 0xbb, 10 | 0x00, 0x7c, 0x7f, 0xdf, 0x05, 0xfa, 0xfe, 0x6b, 0x00, 0x0c, 0xfa, 0x7f, 11 | 0x05, 0x50, 0xe0, 0x0f, 0x00, 0x00, 0x80, 0x03, 0x02, 0x00, 0x18, 0x00, 12 | 0x08, 0x80, 0x01, 0x00, 0x10, 0x30, 0x00, 0x00, 0xe0, 0x06, 0x00, 0x00 }; 13 | -------------------------------------------------------------------------------- /Software/Bootloader/util/usb_descriptor_strings_util.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/anim.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIM_H 2 | #define ANIM_H 3 | 4 | #define TOASTER_COUNT 5 5 | 6 | extern void cyberPathogen(); 7 | extern void defcon(); 8 | extern void eff(); 9 | extern void flames(); 10 | extern void flyingToasters(); 11 | extern void glow(); 12 | extern void hackaday(); 13 | extern void hackers(); 14 | extern void knightRider(); 15 | extern void lycos(); 16 | extern void majorLazer(); 17 | extern void matrix(); 18 | extern void nayan(); 19 | extern void netscape(); 20 | extern void party(uint8_t d); 21 | extern void pirate(); 22 | extern void rainbow(); 23 | extern void rememberme(); 24 | extern void rick(); 25 | extern int8_t scroll(char *text, uint32_t specialBmp, bool allowEdit, bool loop); 26 | extern void scrollingText(); 27 | extern void snake(); 28 | extern void unlockStatus(); 29 | extern void warGames(); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_NeoPixel-ANDnXOR/README.md: -------------------------------------------------------------------------------- 1 | Adafruit NeoPixel library 2 | ========================= 3 | 4 | Arduino library for controlling single-wire-based LED pixels and strip such as the [Adafruit 60 LED/meter Digital LED strip][strip], the [Adafruit FLORA RGB Smart Pixel][flora], the [Adafruit Breadboard-friendly RGB Smart Pixel][pixel], the [Adafruit NeoPixel Stick][stick], and the [Adafruit NeoPixel Shield][shield]. 5 | 6 | After downloading, rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder. Restart Arduino IDE, then open File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch. 7 | 8 | [flora]: http://adafruit.com/products/1060 9 | [strip]: http://adafruit.com/products/1138 10 | [pixel]: http://adafruit.com/products/1312 11 | [stick]: http://adafruit.com/products/1426 12 | [shield]: http://adafruit.com/products/1430 13 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/buttons.h: -------------------------------------------------------------------------------- 1 | #ifndef ANX_BUTTONS_H 2 | #define ANX_BUTTONS_H 3 | 4 | #include 5 | 6 | #define BUTTON_UP B00000001 7 | #define BUTTON_DOWN B00000010 8 | #define BUTTON_LEFT B00000100 9 | #define BUTTON_RIGHT B00001000 10 | #define BUTTON_ENTER B00010000 11 | 12 | #define DEBOUNCE_DELAY 5 13 | 14 | extern uint8_t _upButton; 15 | extern uint8_t _downButton; 16 | extern uint8_t _leftButton; 17 | extern volatile uint8_t _buttonState; 18 | 19 | void buttonHandler(uint8_t button, uint8_t mask); 20 | void onDown(); 21 | void onEnter(); 22 | void onLeft(); 23 | void onRight(); 24 | void onUp(); 25 | void clearButtonState(); 26 | uint8_t getButtonState(); 27 | void resetDownTimes(); 28 | void safeClearButtonState(); 29 | void safeWaitForButton(); 30 | void setupButtons(); 31 | void tiltHandler(uint8_t button); 32 | uint8_t waitForButton(); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lpc_chip_8xx 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | 26 | 27 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lpc_monitor 4 | 5 | 6 | lpc_chip_8xx 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/term.h: -------------------------------------------------------------------------------- 1 | #ifndef TERM_H 2 | #define TERM_H 3 | 4 | #define INITCODE (0x4367) 5 | 6 | /** 7 | * @brief Write the prompt to the serial port. 8 | * 9 | * @param HANDLE A pointer of the handle. 10 | */ 11 | #define PROMPT_WRITE(HANDLE) SERIAL_WRITE((HANDLE), (HANDLE)->prompt, ntlibc_strlen((HANDLE)->prompt)) 12 | 13 | /** 14 | * @brief Read from the serial port. 15 | * 16 | * @param HANDLE A pointer of the handle. 17 | * @param BUF A pointer to the buffer. 18 | * @param CNT Read length. 19 | * 20 | * @return The number of bytes read. 21 | */ 22 | #define SERIAL_READ(HANDLE, BUF, CNT) ((HANDLE)->func_read(BUF, CNT, (HANDLE)->extobj)) 23 | 24 | /** 25 | * @brief Write to the serial port. 26 | * 27 | * @param HANDLE A pointer of the handle. 28 | * @param BUF A pointer to the buffer. 29 | * @param CNT Write length. 30 | * 31 | * @return The number of bytes written. 32 | */ 33 | #define SERIAL_WRITE(HANDLE, BUF, CNT) ((HANDLE)->func_write(BUF, CNT, (HANDLE)->extobj)) 34 | 35 | extern void terminalMode(); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Gerbers/ANDnXOR Badge-B.Paste.gbp: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Paste,Bot* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.2+e4-6225~38~ubuntu16.04.1-stable) date Wed 15 Jun 2016 08:19:12 PM PDT* 5 | %MOMM*% 6 | G01* 7 | G04 APERTURE LIST* 8 | %ADD10C,0.100000*% 9 | %ADD11R,1.200000X3.000000*% 10 | %ADD12R,1.000000X1.250000*% 11 | %ADD13R,1.250000X1.000000*% 12 | G04 APERTURE END LIST* 13 | D10* 14 | D11* 15 | X102000000Y-78250000D03* 16 | X100000000Y-78250000D03* 17 | X98000000Y-78250000D03* 18 | X96000000Y-78250000D03* 19 | X94000000Y-78250000D03* 20 | X92000000Y-78250000D03* 21 | X90000000Y-78250000D03* 22 | X88000000Y-78250000D03* 23 | X102000000Y-60650000D03* 24 | X100000000Y-60650000D03* 25 | X98000000Y-60650000D03* 26 | X96000000Y-60650000D03* 27 | X94000000Y-60650000D03* 28 | X92000000Y-60650000D03* 29 | X90000000Y-60650000D03* 30 | X88000000Y-60650000D03* 31 | D12* 32 | X90000000Y-57750000D03* 33 | X88000000Y-57750000D03* 34 | X90000000Y-51750000D03* 35 | X88000000Y-51750000D03* 36 | D13* 37 | X90000000Y-55750000D03* 38 | X90000000Y-53750000D03* 39 | M02* 40 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/menu.h: -------------------------------------------------------------------------------- 1 | #ifndef ANDnXORMenu_h 2 | #define ANDnXORMenu_h 3 | 4 | #include "Arduino.h" 5 | #include 6 | #include 7 | #include "buttons.h" 8 | #include "rf.h" 9 | 10 | #define ANDnXORMenu_SCROLL_WIDTH 3 11 | 12 | extern Adafruit_SSD1306 display; 13 | 14 | struct menuItem { 15 | char *text; 16 | void (*callback)(void); 17 | }; 18 | 19 | class ANDnXORMenu { 20 | public: 21 | ANDnXORMenu(); 22 | void setMenu(menuItem *items, uint8_t count); 23 | void setTitle(char *title); 24 | void clearMenu(); 25 | int8_t doMenu(); 26 | void scrollDown(); 27 | void scrollUp(); 28 | void goToTop(); 29 | private: 30 | uint8_t _count; 31 | uint8_t _top; 32 | int8_t _selected; //needs to be signed to prevent underrun of menu 33 | uint8_t _maxRows; 34 | menuItem *_items; 35 | char* _title; 36 | void _drawMenu(); 37 | }; 38 | 39 | extern void animationMenu(); 40 | extern void chatMenu(); 41 | extern void gameMenu(); 42 | int16_t getPeerFromUser(); 43 | extern void mainMenu(); 44 | extern void peersMenu(); 45 | extern void systemMenu(); 46 | extern void troll(); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_SSD1306-ANDnXOR/README.txt: -------------------------------------------------------------------------------- 1 | This is a library for our Monochrome OLEDs based on SSD1306 drivers 2 | 3 | Pick one up today in the adafruit shop! 4 | ------> http://www.adafruit.com/category/63_98 5 | 6 | These displays use SPI to communicate, 4 or 5 pins are required to 7 | interface 8 | 9 | Adafruit invests time and resources providing this open source code, 10 | please support Adafruit and open-source hardware by purchasing 11 | products from Adafruit! 12 | 13 | Written by Limor Fried/Ladyada for Adafruit Industries. 14 | Scrolling code contributed by Michael Gregg 15 | BSD license, check license.txt for more information 16 | All text above must be included in any redistribution 17 | 18 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_SSD1306. Check that the Adafruit_SSD1306 folder contains Adafruit_SSD1306.cpp and Adafruit_SSD1306.h 19 | 20 | Place the Adafruit_SSD1306 library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE. 21 | 22 | You will also have to download the Adafruit GFX Graphics core which does all the circles, text, rectangles, etc. You can get it from 23 | https://github.com/adafruit/Adafruit-GFX-Library 24 | and download/install that library as well -------------------------------------------------------------------------------- /Software/lib/Adafruit-GFX-Library-master/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. 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 are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_callbacks.c: -------------------------------------------------------------------------------- 1 | /* ***************************************************************************** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2010 LeafLabs LLC. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * ****************************************************************************/ 24 | 25 | /** 26 | * @file usb_callbacks.c 27 | * 28 | * @brief aka endpoints: handling data transfer when "Configured". calls out to 29 | * application specific callbacks (eg DFU) 30 | * 31 | */ 32 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_SSD1306-ANDnXOR/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012, Adafruit Industries 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 3. Neither the name of the copyright holders nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 18 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Software/lib/Adafruit-GFX-Library-master/README.txt: -------------------------------------------------------------------------------- 1 | This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions). 2 | 3 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 4 | 5 | Written by Limor Fried/Ladyada for Adafruit Industries. 6 | BSD license, check license.txt for more information. 7 | All text above must be included in any redistribution. 8 | 9 | To download, click the DOWNLOAD ZIP button, uncompress and rename the uncompressed folder Adafruit_GFX. Confirm that the Adafruit_GFX folder contains Adafruit_GFX.cpp and Adafruit_GFX.h 10 | 11 | Place the Adafruit_GFX library folder your /Libraries/ folder. You may need to create the Libraries subfolder if its your first library. Restart the IDE. 12 | 13 | Useful Resources 14 | ================ 15 | 16 | - Image2Code 17 | This is a handy Java GUI utility to convert a BMP file into the array code necessary to display the image with the drawBitmap function. Check out the code at ehubin's GitHub repository: 18 | https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code 19 | 20 | - drawXBitmap function 21 | You can use the GIMP photo editor to save a .xbm file and use the array saved in the file to draw a bitmap with the drawXBitmap function. See the pull request here for more details: 22 | https://github.com/adafruit/Adafruit-GFX-Library/pull/31 23 | -------------------------------------------------------------------------------- /Software/Bootloader/README: -------------------------------------------------------------------------------- 1 | 2 | FILES ------------------------------------------------------------------------- 3 | 4 | stm32_lib/* 5 | - all the (possibly consolidated) stm32 lib and usb example code 6 | 7 | usb.c 8 | - USB-specific hardware setup. Interrupts, clocks, etc. handling USB when 9 | not "Attached". some low-level callbacks (low power mode, init, reset, 10 | resume, etc). 11 | 12 | usb_descriptor.c 13 | - aka application descriptor; big static struct and callbacks for sending 14 | the descriptor. TODO: stop using unicode strings directly, generate 15 | with a function. will save a small amount of flash and everyone seems 16 | to give a big shit about that these days. 17 | 18 | main.c 19 | - main loop and calling any hardware init stuff. timing hacks for EEPROM 20 | writes not to block usb interrupts. logic to handle 2 second timeout then 21 | jump to user code. 22 | 23 | hardware.c 24 | - init routines to setup clocks, interrupts, also destructor functions. 25 | does not include USB stuff. Flash read/write functions. 26 | 27 | dfu.c 28 | - mostly the giant FSM case switch, also some USB endpoint callbacks. 29 | also doesn't reset state correctly at the end so you've got one shot 30 | and you're done. probably not a bad idea but at least do it right... 31 | 32 | everything 33 | - mostly shit 34 | 35 | TODO -------------------------------------------------------------------------- 36 | 37 | * pack the structs 38 | * use sizeof() for usb application descriptor once structs are packed 39 | * configure POR detect to allow different BOOTLOADER_WAIT times? 40 | * actually know wtf are you doing when writing a bootloader -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/usrcmd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file usrcmd.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef USRCMD_H 34 | #define USRCMD_H 35 | 36 | int usrcmd_execute(const char *text); 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/acb-bf592/chip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file chip.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.0 8 | * =============================================================== 9 | * Copyright (c) 2010-2015 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef CHIP_H 34 | #define CHIP_H 35 | 36 | #define CHIP_SYSCLK_HZ (100000000) 37 | 38 | void chip_init(void); 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Software/lib/LowPowerLab-RFM69-STM32-ANDnXOR/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for RFM69 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Instances (KEYWORD2) 11 | ####################################### 12 | RFM69 KEYWORD2 13 | RFM69_ATC KEYWORD2 14 | 15 | ####################################### 16 | # Methods and Functions (KEYWORD2) 17 | ####################################### 18 | initialize KEYWORD2 19 | setAddress KEYWORD2 20 | canSend KEYWORD2 21 | send KEYWORD2 22 | sendWithRetry KEYWORD2 23 | receiveDone KEYWORD2 24 | ACKReceived KEYWORD2 25 | sendACK KEYWORD2 26 | setFrequency KEYWORD2 27 | getFrequency KEYWORD2 28 | encrypt KEYWORD2 29 | setCS KEYWORD2 30 | readRSSI KEYWORD2 31 | promiscuous KEYWORD2 32 | setHighPower KEYWORD2 33 | sleep KEYWORD2 34 | readReg KEYWORD2 35 | writeReg KEYWORD2 36 | setNetwork KEYWORD2 37 | ACKRequested KEYWORD2 38 | setPowerLevel KEYWORD2 39 | readTemperature KEYWORD2 40 | rcCalibration KEYWORD2 41 | readAllRegs KEYWORD2 42 | enableAutoPower KEYWORD2 43 | 44 | ####################################### 45 | # Constants (LITERAL1) 46 | ####################################### 47 | RF69_315MHZ LITERAL1 48 | RF69_433MHZ LITERAL1 49 | RF69_868MHZ LITERAL1 50 | RF69_915MHZ LITERAL1 51 | ####################################### 52 | # Variables/Volatiles (LITERAL2) 53 | ####################################### 54 | DATA LITERAL2 55 | DATALEN LITERAL2 56 | SENDERID LITERAL2 57 | TARGETID LITERAL2 58 | PAYLOADLEN LITERAL2 59 | ACK_REQUESTED LITERAL2 60 | ACK_RECEIVED LITERAL2 61 | RSSI LITERAL2 62 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/acb-bf592/uart.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file uart.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.0 8 | * =============================================================== 9 | * Copyright (c) 2010-2015 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef UART_H 34 | #define UART_H 35 | 36 | void uart_init(void); 37 | int uart_putc(char c); 38 | int uart_getc(void); 39 | int uart_puts(const char *s); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/flash.h: -------------------------------------------------------------------------------- 1 | #ifndef FLASH_H 2 | #define FLASH_H 3 | 4 | #include 5 | #include 6 | #include "ANX.h" 7 | 8 | //COMMANDS 9 | #define FLASH_BLOCKERASE_4K 0x20 10 | #define FLASH_BLOCKERASE_64K 0xD8 11 | #define FLASH_WRITE_ENABLE 0x06 //write enable 12 | #define FLASH_CHIP_ERASE 0xc7 //chip erase 13 | #define FLASH_STATUS_REG_1 0x05 14 | #define FLASH_STATUS_REG_2 0x35 15 | #define FLASH_PAGE_PGM 0x02 //Write Page 16 | #define FLASH_ARRAYREAD 0x0B 17 | #define FLASH_RELEASE 0xAB //Wakeup 18 | #define FLASH_SLEEP 0xB9 //Sleep 19 | #define FLASH_STATUSWRITE 0x01 20 | #define FLASH_READ 0x0B 21 | #define FLASH_DEVICE_ID 0x9F 22 | 23 | class ANXFlash { 24 | public: 25 | 26 | ANXFlash(uint8_t cs, SPIClass *spi); 27 | 28 | bool begin(); 29 | void chipErase(); 30 | void erase4k(uint32_t address); 31 | void erase64k(uint32_t address); 32 | bool flashBusy(); 33 | byte getManufacturerId(); 34 | byte readByte(uint32_t address); 35 | void readBytes(uint32_t address, void* buffer, uint16_t length); 36 | void sleep(); 37 | void wakeup(); 38 | void writeBytes(uint32_t address, const void* buffer, uint16_t length) ; 39 | 40 | private: 41 | uint8_t _cs; 42 | SPIClass *_spi; 43 | void _command(uint8_t cmd, bool writeEnable); 44 | byte _getStatus(); 45 | void _setWriteEnable(bool enable); 46 | inline void _select() { 47 | noInterrupts(); 48 | digitalWrite(_cs, LOW); 49 | } 50 | inline void _deselect() { 51 | digitalWrite(_cs, HIGH); 52 | interrupts(); 53 | } 54 | inline uint8_t _transfer(uint8_t x) { 55 | uint8_t y = _spi->transfer(x); 56 | return y; 57 | } 58 | }; 59 | #endif 60 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/inc/sys_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @note 3 | * Copyright(C) NXP Semiconductors, 2012 4 | * All rights reserved. 5 | * 6 | * @par 7 | * Software that is described herein is for illustrative purposes only 8 | * which provides customers with programming information regarding the 9 | * LPC products. This software is supplied "AS IS" without any warranties of 10 | * any kind, and NXP Semiconductors and its licensor disclaim any and 11 | * all warranties, express or implied, including all implied warranties of 12 | * merchantability, fitness for a particular purpose and non-infringement of 13 | * intellectual property rights. NXP Semiconductors assumes no responsibility 14 | * or liability for the use of the software, conveys no license or rights under any 15 | * patent, copyright, mask work right, or any other intellectual property rights in 16 | * or to any products. NXP Semiconductors reserves the right to make changes 17 | * in the software without notification. NXP Semiconductors also makes no 18 | * representation or warranty that such application will be suitable for the 19 | * specified use without further testing or modification. 20 | * 21 | * @par 22 | * Permission to use, copy, modify, and distribute this software and its 23 | * documentation is hereby granted, under NXP Semiconductors' and its 24 | * licensor's relevant copyrights in the software, without fee, provided that it 25 | * is used in conjunction with NXP Semiconductors microcontrollers. This 26 | * copyright, permission, and disclaimer notice must appear in all copies of 27 | * this code. 28 | */ 29 | 30 | #ifndef __SYS_CONFIG_H_ 31 | #define __SYS_CONFIG_H_ 32 | 33 | /* Build for LPC8XX chip family */ 34 | #define CHIP_LPC8XX 35 | 36 | #endif /* __SYS_CONFIG_H_ */ 37 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_descriptor.h: -------------------------------------------------------------------------------- 1 | /* ***************************************************************************** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2010 LeafLabs LLC. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * ****************************************************************************/ 24 | 25 | #ifndef __MAPLE_USB_DESC_H 26 | #define __MAPLE_USB_DESC_H 27 | 28 | #include "common.h" 29 | #include "usb_lib.h" 30 | #include "usb.h" 31 | 32 | #define NUM_ALT_SETTINGS 3 33 | #define STR_DESC_LEN 7 34 | 35 | extern ONE_DESCRIPTOR usbDeviceDescriptorDFU; 36 | extern ONE_DESCRIPTOR usbConfigDescriptorDFU; 37 | extern ONE_DESCRIPTOR usbStringDescriptor[STR_DESC_LEN]; 38 | extern ONE_DESCRIPTOR usbFunctionalDescriptor; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_int.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_int.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Endpoint CTR (Low and High) interrupt's service routines 7 | * prototypes 8 | ******************************************************************************** 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | *******************************************************************************/ 16 | 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __USB_INT_H 19 | #define __USB_INT_H 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | /* Exported types ------------------------------------------------------------*/ 23 | /* Exported constants --------------------------------------------------------*/ 24 | /* Exported macro ------------------------------------------------------------*/ 25 | /* Exported functions ------------------------------------------------------- */ 26 | void CTR_LP(void); 27 | void CTR_HP(void); 28 | 29 | /* External variables --------------------------------------------------------*/ 30 | 31 | #endif /* __USB_INT_H */ 32 | 33 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 34 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/ninja.h: -------------------------------------------------------------------------------- 1 | #ifndef NINJA_H 2 | #define NINJA_H 3 | 4 | #include 5 | #include 6 | 7 | #include "ANX.h" 8 | #include "buttons.h" 9 | #include "graphics.h" 10 | #include "menu.h" 11 | #include "rf.h" 12 | #include "serial.h" 13 | 14 | #define PLAYER_1_X 10 15 | #define PLAYER_1_Y 2 16 | #define PLAYER_2_X 91 17 | #define PLAYER_2_Y 2 18 | #define STATE_SELECT_MOVE 1 19 | #define STATE_FIGHT 2 20 | #define STATE_ABORT 99 21 | #define MOVE_PUNCH 0 22 | #define MOVE_KICK 1 23 | #define MOVE_SHIELD 2 24 | #define MOVE_NONE 3 25 | #define MOVE_TROLL 4 26 | #define RESULT_WIN 1 27 | #define RESULT_LOSE 2 28 | #define RESULT_TIE 3 29 | #define TYPE_INIT 0 30 | #define TYPE_ACK 1 31 | #define TYPE_NACK 2 32 | #define TYPE_MOVE 3 33 | 34 | 35 | extern Adafruit_SSD1306 display; 36 | extern Adafruit_NeoPixel leds; 37 | 38 | struct NinjaState { 39 | bitmap p1Idle1, p2Idle1; 40 | bitmap p1Idle2, p2Idle2; 41 | bitmap p1Punch1, p2Punch1; 42 | bitmap p1Punch2, p2Punch2; 43 | bitmap p1Kick1, p2Kick1; 44 | bitmap p1Kick2, p2Kick2; 45 | bitmap p1Shield1, p2Shield1; 46 | bitmap p1Shield2, p2Shield2; 47 | bitmap p1Dead, p2Dead; 48 | bitmap troll; 49 | bitmap punch, kick, shield; 50 | bitmap up, down, right; 51 | uint8_t state; 52 | int8_t p1Move, p2Move; 53 | int8_t lastACK; //Should be set to -1 (no ACK) or the type of packet acknowledgeds 54 | int8_t lastNACK; //Similar to ACK 55 | uint8_t round; 56 | uint8_t p1Score, p2Score; 57 | uint8_t p2nodeid; 58 | uint8_t p2Level; 59 | char *p2Name; 60 | bool tiebreaker[3]; 61 | }; 62 | 63 | extern void ninja(); 64 | extern void ninjaChallenged(NinjaPacket packet); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Software/Bootloader/flash/openocd.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32 2 | 3 | interface ft2232 4 | ft2232_device_desc "Olimex OpenOCD JTAG" 5 | ft2232_layout olimex-jtag 6 | ft2232_vid_pid 0x15ba 0x0003 7 | 8 | if { [info exists CHIPNAME] } { 9 | set _CHIPNAME $CHIPNAME 10 | } else { 11 | set _CHIPNAME stm32 12 | } 13 | 14 | if { [info exists ENDIAN] } { 15 | set _ENDIAN $ENDIAN 16 | } else { 17 | set _ENDIAN little 18 | } 19 | 20 | # jtag speed 21 | jtag_khz 500 22 | 23 | jtag_nsrst_delay 200 24 | jtag_ntrst_delay 200 25 | 26 | #use combined on interfaces or targets that can't set TRST/SRST separately 27 | reset_config trst_and_srst 28 | 29 | #jtag scan chain 30 | if { [info exists CPUTAPID ] } { 31 | set _CPUTAPID $CPUTAPID 32 | } else { 33 | # See STM Document RM0008 34 | # Section 26.6.3 35 | set _CPUTAPID 0x3ba00477 36 | } 37 | 38 | jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 39 | 40 | if { [info exists BSTAPID ] } { 41 | set _BSTAPID $BSTAPID 42 | } else { 43 | # See STM Document RM0008 44 | # Section 26.6.2 45 | # Medium Density RevA 46 | set _BSTAPID 0x06410041 47 | # Rev B and Rev Z 48 | set _BSTAPID 0x16410041 49 | # High Density Devices, Rev A 50 | #set _BSTAPID 0x06414041 51 | } 52 | 53 | jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID 54 | 55 | set _TARGETNAME [format "%s.cpu" $_CHIPNAME] 56 | target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME 57 | 58 | $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 0x5000 -work-area-backup 0 59 | 60 | flash bank stm32x 0x08000000 0x00010000 0 0 0 61 | 62 | init 63 | 64 | halt 65 | sleep 1000 66 | stm32x unlock 0 67 | flash erase_sector 0 0 0 68 | sleep 1000 69 | flash write_bank 0 tmpflash.bin 0 70 | sleep 3000 71 | reset 72 | sleep 3000 73 | shutdown 74 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_mem.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_mem.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Utility prototypes functions for memory/PMA transfers 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __USB_MEM_H 18 | #define __USB_MEM_H 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | /* Exported types ------------------------------------------------------------*/ 22 | /* Exported constants --------------------------------------------------------*/ 23 | /* Exported macro ------------------------------------------------------------*/ 24 | /* Exported functions ------------------------------------------------------- */ 25 | void UserToPMABufferCopy(u8 *pbUsrBuf, u16 wPMABufAddr, u16 wNBytes); 26 | void PMAToUserBufferCopy(u8 *pbUsrBuf, u16 wPMABufAddr, u16 wNBytes); 27 | 28 | /* External variables --------------------------------------------------------*/ 29 | 30 | #endif /*__USB_MEM_H*/ 31 | 32 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 33 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_lib.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_lib.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : USB library include files 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __USB_LIB_H 18 | #define __USB_LIB_H 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "usb_type.h" 22 | #include "usb_regs.h" 23 | #include "usb_def.h" 24 | #include "usb_core.h" 25 | #include "usb_init.h" 26 | #include "usb_mem.h" 27 | #include "usb_int.h" 28 | 29 | /* Exported types ------------------------------------------------------------*/ 30 | /* Exported constants --------------------------------------------------------*/ 31 | /* Exported macro ------------------------------------------------------------*/ 32 | /* Exported functions ------------------------------------------------------- */ 33 | /* External variables --------------------------------------------------------*/ 34 | 35 | #endif /* __USB_LIB_H */ 36 | 37 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 38 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/uart.c: -------------------------------------------------------------------------------- 1 | /** 2 | */ 3 | 4 | #include "chip.h" 5 | #include 6 | 7 | #define UART_RB_SIZE (64) 8 | #define CONFIG_BAUDRATE (115200) 9 | 10 | static RINGBUFF_T txring, rxring; 11 | static uint8_t rxbuff[UART_RB_SIZE], txbuff[UART_RB_SIZE]; 12 | 13 | void UART0_IRQHandler(void) 14 | { 15 | Chip_UART_IRQRBHandler(LPC_USART0, &rxring, &txring); 16 | } 17 | 18 | void uart_init() 19 | { 20 | Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); 21 | Chip_SWM_MovablePinAssign(SWM_U0_TXD_O, 4); 22 | Chip_SWM_MovablePinAssign(SWM_U0_RXD_I, 0); 23 | Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); 24 | 25 | Chip_Clock_SetUARTClockDiv(1); 26 | Chip_UART_Init(LPC_USART0); 27 | Chip_UART_ConfigData(LPC_USART0, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1); 28 | Chip_Clock_SetUSARTNBaseClockRate((115200 * 16), true); 29 | Chip_UART_SetBaud(LPC_USART0, CONFIG_BAUDRATE); 30 | Chip_UART_Enable(LPC_USART0); 31 | Chip_UART_TXEnable(LPC_USART0); 32 | RingBuffer_Init(&rxring, rxbuff, 1, UART_RB_SIZE); 33 | RingBuffer_Init(&txring, txbuff, 1, UART_RB_SIZE); 34 | Chip_UART_IntEnable(LPC_USART0, UART_INTEN_RXRDY); 35 | Chip_UART_IntDisable(LPC_USART0, UART_INTEN_TXRDY); 36 | NVIC_EnableIRQ(UART0_IRQn); 37 | } 38 | 39 | uint8_t uart_getc(void) 40 | { 41 | uint8_t c = 0; 42 | while (1) { 43 | int bytes = Chip_UART_ReadRB(LPC_USART0, &rxring, &c, 1); 44 | if (bytes > 0) { 45 | return c; 46 | } 47 | } 48 | } 49 | 50 | void uart_putc(uint8_t c) 51 | { 52 | while (1) { 53 | int bytes = Chip_UART_SendRB(LPC_USART0, &txring, (const uint8_t *) &c, 1); 54 | if (bytes > 0) { 55 | return; 56 | } 57 | } 58 | } 59 | 60 | void uart_puts(char *str) 61 | { 62 | while (*str) { 63 | uart_putc(*str++); 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntconf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntconf.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef NTCONF_H 34 | #define NTCONF_H 35 | 36 | /** 37 | * @note 38 | * This file provides internal definitions for inner modules. 39 | */ 40 | 41 | /** 42 | * @brief Maximum length for the editor module. 43 | */ 44 | #define NTCONF_EDITOR_MAXLEN (64) 45 | 46 | /** 47 | * @brief Maximum depth for the history module. 48 | */ 49 | #define NTCONF_HISTORY_DEPTH (8) 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /Software/Bootloader/flash/stm32.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32 2 | 3 | interface ft2232 4 | ft2232_device_desc "Olimex OpenOCD JTAG" 5 | ft2232_layout olimex-jtag 6 | ft2232_vid_pid 0x15ba 0x0003 7 | 8 | if { [info exists CHIPNAME] } { 9 | set _CHIPNAME $CHIPNAME 10 | } else { 11 | set _CHIPNAME stm32 12 | } 13 | 14 | if { [info exists ENDIAN] } { 15 | set _ENDIAN $ENDIAN 16 | } else { 17 | set _ENDIAN little 18 | } 19 | 20 | # jtag speed 21 | jtag_khz 500 22 | 23 | jtag_nsrst_delay 100 24 | jtag_ntrst_delay 100 25 | 26 | #use combined on interfaces or targets that can't set TRST/SRST separately 27 | reset_config trst_and_srst 28 | 29 | #jtag scan chain 30 | if { [info exists CPUTAPID ] } { 31 | set _CPUTAPID $CPUTAPID 32 | } else { 33 | # See STM Document RM0008 34 | # Section 26.6.3 35 | set _CPUTAPID 0x3ba00477 36 | } 37 | jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 38 | 39 | if { [info exists BSTAPID ] } { 40 | set _BSTAPID $BSTAPID 41 | } else { 42 | # See STM Document RM0008 43 | # Section 26.6.2 44 | # Medium Density RevA 45 | set _BSTAPID 0x06410041 46 | # Rev B and Rev Z 47 | set _BSTAPID 0x16410041 48 | # High Density Devices, Rev A 49 | #set _BSTAPID 0x06414041 50 | } 51 | jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID 52 | 53 | set _TARGETNAME [format "%s.cpu" $_CHIPNAME] 54 | target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME 55 | 56 | $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0 57 | 58 | #flash bank stm32x 0 0 0 0 0 59 | 60 | 61 | target create cortex_m3 -endian little 62 | #run_and_halt_time 0 30 63 | 64 | #working_area 0 0x20000000 0x4000 nobackup 65 | 66 | #flash bank stm32x 0x08000000 0x00010000 0 0 0 67 | reset 68 | sleep 3000 69 | shutdown 70 | # For more information about the configuration files, take a look at: 71 | # openocd.texi 72 | 73 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/acb-bf592/chip.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file chip.c 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.0 8 | * =============================================================== 9 | * Copyright (c) 2010-2015 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #include 34 | #include 35 | #include "chip.h" 36 | 37 | static void setup_pll(uint8_t mul_val, uint8_t div_val) 38 | { 39 | *pSIC_IWR = IWR_ENABLE(0); 40 | *pPLL_DIV = div_val; 41 | *pPLL_CTL = (mul_val) << 9; 42 | asm("cli r0; csync; idle; sti r0;": : :"R0"); 43 | *pSIC_IWR = IWR_ENABLE_ALL; 44 | } 45 | 46 | void chip_init(void) 47 | { 48 | setup_pll(16, 4); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntint.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntint.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef NTINT_H 34 | #define NTINT_H 35 | 36 | /** 37 | * @note 38 | * This file provides integer definitions. 39 | * You can use #include if your tool chain have the header. 40 | */ 41 | 42 | #if 1 43 | # include 44 | #else 45 | typedef unsigned char uint8_t; 46 | typedef unsigned short uint16_t; 47 | typedef unsigned int uint32_t; 48 | typedef char int8_t; 49 | typedef short int16_t; 50 | typedef int int32_t; 51 | typedef unsigned int size_t; 52 | #endif 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Software/Bootloader/common.h: -------------------------------------------------------------------------------- 1 | /* ***************************************************************************** 2 | * The MIT License 3 | * 4 | * Copyright (c) 2010 LeafLabs LLC. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * ****************************************************************************/ 24 | 25 | /** 26 | * @file common.h 27 | * 28 | * @brief toplevel include for bootloader source files 29 | * 30 | * 31 | */ 32 | 33 | #ifndef __COMMON_H 34 | #define __COMMON_H 35 | 36 | 37 | #include "stm32_lib/stm32f10x_type.h" 38 | #include "stm32_lib/cortexm3_macro.h" 39 | 40 | #include "config.h" 41 | #include "hardware.h" 42 | #include "usb.h" 43 | 44 | #define VER_MAJOR '1' 45 | #define VER_MINOR '1' 46 | 47 | #define RESET_POR (1 << 27) // power-on reset 48 | #define RESET_EXT (1 << 26) // reset button via reset pin 49 | #define RESET_ANY 0xfe000000 // all reset types 50 | 51 | 52 | #ifndef RESET_ACTIVATION 53 | #define RESET_ACTIVATION RESET_POR | RESET_EXT 54 | #endif 55 | 56 | 57 | typedef void (*FuncPtr)(void); 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef ANX_SETTINGS_H 2 | #define ANX_SETTINGS_H 3 | 4 | #define SETTINGS_ADDRESS 0xFF 5 | 6 | #define USERNAME_ADDRESS 0x1 7 | 8 | #define SUDO_DEFAULT 0 9 | #define SUDO_ADDRESS 0x9 10 | 11 | #define UNLOCKED_DEFAULT 0 12 | #define UNLOCKED_ADDRESS 0xA 13 | 14 | #define AIRPLANE_DEFAULT 0 15 | #define AIRPLANE_ADDRESS 0xB 16 | 17 | #define SWEARMODE_DEFAULT 0 18 | #define SWEARMODE_ADDRESS 0xC 19 | 20 | #define SCROLLING_DEFAULT "DEFCON 24" 21 | #define SCROLLING_ADDRESS 0xD //max length = 16 22 | 23 | #define TILT_DEFAULT 1 24 | #define TILT_ADDRESS 0x1D 25 | 26 | #define EYES_DEFAULT 1 27 | #define EYES_ADDRESS 0x1E 28 | 29 | #define ALERT_DEFAULT 1 30 | #define ALERT_ADDRESS 0x1F 31 | 32 | #define LEVEL_DEFAULT 1 33 | #define LEVEL_ADDRESS 0x20 34 | #define EXPERIENCE_DEFAULT 0 35 | #define EXPERIENCE_ADDRESS 0x21 //uint32_t 36 | 37 | #define SETTINGS_SIZE 0x24 38 | 39 | bool ANXGetAirplane(); 40 | void ANXSetAirplane(bool value); 41 | 42 | bool ANXGetAlert(); 43 | void ANXSetAlert(bool value); 44 | 45 | uint32_t ANXGetExperience(); 46 | void ANXSetExperience(uint32_t value); 47 | 48 | bool ANXGetEyes(); 49 | void ANXSetEyes(bool value); 50 | 51 | uint8_t ANXGetLevel(); 52 | void ANXSetLevel(uint8_t value); 53 | 54 | void ANXGetScrollText(char *scroll); 55 | void ANXSetScrollText(char *scroll); 56 | 57 | bool ANXGetSudo(); 58 | void ANXSetSudo(bool value); 59 | 60 | bool ANXGetSwearMode(); 61 | void ANXSetSwearMode(bool value); 62 | 63 | bool ANXGetTilt(); 64 | void ANXSetTilt(bool value); 65 | 66 | byte ANXGetUnlocked(); 67 | void ANXSetUnlocked(byte value); 68 | 69 | void ANXGetUsername(char *username); 70 | void ANXSetUsername(char *username); 71 | 72 | void editUsername(); 73 | byte getSetting(uint8_t address); 74 | void getSetting(uint8_t address, char *bytes, uint16_t size); 75 | void initSettings(); 76 | void modifySetting(uint8_t address, byte b, bool erase); 77 | void modifySetting(uint8_t address, char *bytes, uint16_t size, bool erase); 78 | void resetSettings(); 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Software/Bootloader/flash/debug.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32 2 | 3 | interface ft2232 4 | ft2232_device_desc "Olimex OpenOCD JTAG" 5 | ft2232_layout olimex-jtag 6 | ft2232_vid_pid 0x15ba 0x0003 7 | 8 | if { [info exists CHIPNAME] } { 9 | set _CHIPNAME $CHIPNAME 10 | } else { 11 | set _CHIPNAME stm32 12 | } 13 | 14 | if { [info exists ENDIAN] } { 15 | set _ENDIAN $ENDIAN 16 | } else { 17 | set _ENDIAN little 18 | } 19 | 20 | # jtag speed 21 | jtag_khz 600 22 | 23 | #use combined on interfaces or targets that can't set TRST/SRST separately 24 | reset_config trst_and_srst 25 | 26 | #jtag scan chain 27 | if { [info exists CPUTAPID ] } { 28 | set _CPUTAPID $CPUTAPID 29 | } else { 30 | # See STM Document RM0008 31 | # Section 26.6.3 32 | set _CPUTAPID 0x3ba00477 33 | } 34 | jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 35 | 36 | if { [info exists BSTAPID ] } { 37 | set _BSTAPID $BSTAPID 38 | } else { 39 | # See STM Document RM0008 40 | # Section 26.6.2 41 | # Medium Density RevA 42 | set _BSTAPID 0x06410041 43 | # Rev B and Rev Z 44 | set _BSTAPID 0x16410041 45 | # High Density Devices, Rev A 46 | #set _BSTAPID 0x06414041 47 | } 48 | jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID 49 | 50 | set _TARGETNAME [format "%s.cpu" $_CHIPNAME] 51 | target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME 52 | 53 | $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 0x5000 -work-area-backup 0 54 | #$_TARGETNAME configure -event halted halt_handle 55 | 56 | #flash bank stm32x 0 0 0 0 0 57 | 58 | 59 | #target create cortex_m3 -endian little 60 | #run_and_halt_time 0 30 61 | 62 | #working_area 0 0x20000000 0x4000 nobackup 63 | 64 | flash bank stm32x 0x08000000 0x00010000 0 0 0 65 | 66 | # For more information about the configuration files, take a look at: 67 | # openocd.texi 68 | 69 | #script flash.script 70 | 71 | proc halt_handle {} { 72 | resume 73 | } 74 | 75 | proc flash_test {} { 76 | puts "Entering DEBUG wait" 77 | sleep 100 78 | # reset run 79 | # sleep 500 80 | } 81 | 82 | init 83 | flash_test 84 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/crp.c: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // crp.c 3 | // 4 | // Source file to create CRP word expected by LPCXpresso IDE linker 5 | //***************************************************************************** 6 | // 7 | // Copyright(C) NXP Semiconductors, 2013 8 | // All rights reserved. 9 | // 10 | // Software that is described herein is for illustrative purposes only 11 | // which provides customers with programming information regarding the 12 | // LPC products. This software is supplied "AS IS" without any warranties of 13 | // any kind, and NXP Semiconductors and its licensor disclaim any and 14 | // all warranties, express or implied, including all implied warranties of 15 | // merchantability, fitness for a particular purpose and non-infringement of 16 | // intellectual property rights. NXP Semiconductors assumes no responsibility 17 | // or liability for the use of the software, conveys no license or rights under any 18 | // patent, copyright, mask work right, or any other intellectual property rights in 19 | // or to any products. NXP Semiconductors reserves the right to make changes 20 | // in the software without notification. NXP Semiconductors also makes no 21 | // representation or warranty that such application will be suitable for the 22 | // specified use without further testing or modification. 23 | // 24 | // Permission to use, copy, modify, and distribute this software and its 25 | // documentation is hereby granted, under NXP Semiconductors' and its 26 | // licensor's relevant copyrights in the software, without fee, provided that it 27 | // is used in conjunction with NXP Semiconductors microcontrollers. This 28 | // copyright, permission, and disclaimer notice must appear in all copies of 29 | // this code. 30 | //***************************************************************************** 31 | 32 | #if defined (__CODE_RED) 33 | #include 34 | // Variable to store CRP value in. Will be placed automatically 35 | // by the linker when "Enable Code Read Protect" selected. 36 | // See crp.h header for more information 37 | __CRP const unsigned int CRP_WORD = CRP_NO_CRP ; 38 | #endif 39 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntlibc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntlibc.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef NTLIBC_H 34 | #define NTLIBC_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | int ntlibc_strlen(const char *s); 41 | char *ntlibc_strcpy(char *des, const char *src); 42 | char *ntlibc_strcat(char *des, const char *src); 43 | int ntlibc_strcmp(const char *s1, const char *s2); 44 | int ntlibc_stricmp(const char *s1, const char *s2); 45 | int ntlibc_strncmp(const char *s1, const char *s2, int n); 46 | int ntlibc_isdigit(int c); 47 | int ntlibc_isalpha(int c); 48 | int ntlibc_iscntrl(int c); 49 | int ntlibc_toupper(int c); 50 | int ntlibc_tolower(int c); 51 | int ntlibc_atoi(const char *nptr); 52 | char *ntlibc_strchr(const char *s, int c); 53 | char *ntlibc_utoa(unsigned int value, char *s, int radix); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /Software/Bootloader/flash/flash.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32 2 | 3 | interface ft2232 4 | ft2232_device_desc "Olimex OpenOCD JTAG" 5 | ft2232_layout olimex-jtag 6 | ft2232_vid_pid 0x15ba 0x0003 7 | 8 | if { [info exists CHIPNAME] } { 9 | set _CHIPNAME $CHIPNAME 10 | } else { 11 | set _CHIPNAME stm32 12 | } 13 | 14 | if { [info exists ENDIAN] } { 15 | set _ENDIAN $ENDIAN 16 | } else { 17 | set _ENDIAN little 18 | } 19 | 20 | # jtag speed 21 | jtag_khz 600 22 | 23 | #use combined on interfaces or targets that can't set TRST/SRST separately 24 | reset_config trst_and_srst 25 | 26 | #jtag scan chain 27 | if { [info exists CPUTAPID ] } { 28 | set _CPUTAPID $CPUTAPID 29 | } else { 30 | # See STM Document RM0008 31 | # Section 26.6.3 32 | set _CPUTAPID 0x3ba00477 33 | } 34 | jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 35 | 36 | if { [info exists BSTAPID ] } { 37 | set _BSTAPID $BSTAPID 38 | } else { 39 | # See STM Document RM0008 40 | # Section 26.6.2 41 | # Medium Density RevA 42 | set _BSTAPID 0x06410041 43 | # Rev B and Rev Z 44 | set _BSTAPID 0x16410041 45 | # High Density Devices, Rev A 46 | #set _BSTAPID 0x06414041 47 | } 48 | jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID 49 | 50 | set _TARGETNAME [format "%s.cpu" $_CHIPNAME] 51 | target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME 52 | 53 | $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 0x5000 -work-area-backup 0 54 | #$_TARGETNAME configure -event halted halt_handle 55 | 56 | #flash bank stm32x 0 0 0 0 0 57 | 58 | 59 | #target create cortex_m3 -endian little 60 | #run_and_halt_time 0 30 61 | 62 | #working_area 0 0x20000000 0x4000 nobackup 63 | 64 | flash bank stm32x 0x08000000 0x00010000 0 0 0 65 | 66 | # For more information about the configuration files, take a look at: 67 | # openocd.texi 68 | 69 | #script flash.script 70 | 71 | proc halt_handle {} { 72 | resume 73 | } 74 | 75 | proc flash_test {} { 76 | puts "Trying to flash" 77 | sleep 100 78 | halt 79 | sleep 300 80 | stm32x mass_erase 0 81 | sleep 20 82 | flash write_bank 0 tmpflash.bin 0 83 | sleep 50 84 | # reset run 85 | # sleep 500 86 | reset run 87 | shutdown 88 | } 89 | 90 | init 91 | flash_test 92 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntopt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntopt.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef NTOPT_H 34 | #define NTOPT_H 35 | 36 | #include "ntconf.h" 37 | 38 | /** 39 | * @brief The text maximum length. 40 | */ 41 | #define NTOPT_TEXT_MAXLEN (NTCONF_EDITOR_MAXLEN) 42 | 43 | /** 44 | * @brief The text maximum arguments. 45 | */ 46 | #define NTOPT_TEXT_MAXARGS (NTCONF_EDITOR_MAXLEN / 2) 47 | 48 | /** 49 | * @brief The callback function. 50 | * 51 | * @param argc The number of the parameters. 52 | * @param argv The pointer to the parameters. 53 | * @param extobj The external object. 54 | * 55 | * @return A return value. 56 | */ 57 | typedef int (*NTOPT_CALLBACK)(int argc, char **argv, void *extobj); 58 | 59 | #ifdef __cplusplus 60 | extern "C" { 61 | #endif 62 | 63 | int ntopt_parse(const char *str, NTOPT_CALLBACK func, void *extobj); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /Software/Bootloader/stm32_lib/cortexm3_macro.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : cortexm3_macro.h 3 | * Author : MCD Application Team 4 | * Version : V2.0.3 5 | * Date : 09/22/2008 6 | * Description : Header file for cortexm3_macro.s. 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __CORTEXM3_MACRO_H 18 | #define __CORTEXM3_MACRO_H 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "stm32f10x_type.h" 22 | 23 | /* Exported types ------------------------------------------------------------*/ 24 | /* Exported constants --------------------------------------------------------*/ 25 | /* Exported macro ------------------------------------------------------------*/ 26 | /* Exported functions ------------------------------------------------------- */ 27 | void __WFI(void); 28 | void __WFE(void); 29 | void __SEV(void); 30 | void __ISB(void); 31 | void __DSB(void); 32 | void __DMB(void); 33 | void __SVC(void); 34 | u32 __MRS_CONTROL(void); 35 | void __MSR_CONTROL(u32 Control); 36 | u32 __MRS_PSP(void); 37 | void __MSR_PSP(u32 TopOfProcessStack); 38 | u32 __MRS_MSP(void); 39 | void __MSR_MSP(u32 TopOfMainStack); 40 | void __RESETPRIMASK(void); 41 | void __SETPRIMASK(void); 42 | u32 __READ_PRIMASK(void); 43 | void __RESETFAULTMASK(void); 44 | void __SETFAULTMASK(void); 45 | u32 __READ_FAULTMASK(void); 46 | void __BASEPRICONFIG(u32 NewPriority); 47 | u32 __GetBASEPRI(void); 48 | u16 __REV_HalfWord(u16 Data); 49 | u32 __REV_Word(u32 Data); 50 | 51 | #endif /* __CORTEXM3_MACRO_H */ 52 | 53 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 54 | -------------------------------------------------------------------------------- /Provision/README: -------------------------------------------------------------------------------- 1 | AND!XOR Badge Data Provisioning 2 | =============================== 3 | 4 | This folder contains a series of Python scripts, shell scripts (for Linux 5 | users), and bat files (for Windows users) to properly provision a badge from 6 | bare metal. These scripts will also upgrade existing badges and re-format 7 | graphics in a way that the badge can read it. 8 | 9 | assets/ - Folder containing all images / animations used on the badge. 10 | 11 | ANXFlash.py - When used in conjunction with "Serial Mode" on the badge, this is 12 | used to flash raw .bin files to the internal SPI NAND Flash memory on the badge. 13 | This uses a custom-made serial protocol designed for the badge. By custom-made 14 | we mean 15 | 16 | ANXWrite.py - Converts individual images and text binary and writes to arbitrary 17 | locations in a .bin file. Used with shell scripts to re-generate .bin images for 18 | the NAND. All that's required is an offset within the file to place the data. 19 | Careful, it does not know what's it's overwriting and will not protect against 20 | it. 21 | 22 | datatobin.sh - Uses ANXWrite.py to generate a .bin file. Any 2-bit index image 23 | is supported including .gif animations. Additionally, it randomizes the file 24 | before overwriting with images as a mild form of obfuscation. 25 | Example: ./datatobin.sh 26 | 27 | flashdata.sh - Uses ANXFlash.py to flash a badge that's running in serial mode. 28 | After writing to NAND flash, it will write a unique node id to NAND. 29 | Example: ./flashdata.sh /dev/ttyACM0 ANDnXOR_Badge-Flash.bin 30 | 31 | flasher.py - Similar to ANXFlash.py but can write individual images and text to 32 | the NAND flash at arbitrary locations. Does not account for the fact that NAND 33 | must be erased in 4K blocks to changes 0 to 1. Assumes it is writing to 0xFF 34 | sections of memory. 35 | Example (Writes unique node ID to the badge at 0x95000 36 | python flasher.py -s -d /dev/ttyACM0 -a 0x95000 37 | 38 | human.sh - Script for provisioning a badge from bare metal to fully functional. 39 | Bare metal badges do not have USB bootloaders. This is designed to flash the 40 | bootloader over USB to Serial then badge code and NAND flash data using USB. 41 | 42 | nodes.csv - CSV file mapping unique node ids (1-254) to unique MCU serial 43 | numbers. This ensures each badge is uniuqe on the network and the ids survive 44 | re-flashes. 45 | 46 | Program_flash.bat - Windows bat file equivalent of flashdata.sh 47 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_NeoPixel-ANDnXOR/examples/strandtest/strandtest.pde: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | colorWipe(strip.Color(255, 0, 0), 50); // Red 22 | colorWipe(strip.Color(0, 255, 0), 50); // Green 23 | colorWipe(strip.Color(0, 0, 255), 50); // Blue 24 | rainbow(20); 25 | rainbowCycle(20); 26 | } 27 | 28 | // Fill the dots one after the other with a color 29 | void colorWipe(uint32_t c, uint8_t wait) { 30 | for(uint16_t i=0; i //get it here: https://www.github.com/lowpowerlab/rfm69 9 | #include //get it here: https://github.com/lowpowerlab/spiflash 10 | #include //get library from: https://github.com/LowPowerLab/LowPower 11 | 12 | #define NODEID 18 //unique for each node on same network 13 | #define NETWORKID 100 //the same on all nodes that talk to each other 14 | #define GATEWAYID 1 15 | //Match frequency to the hardware version of the radio on your Moteino (uncomment one): 16 | //#define FREQUENCY RF69_433MHZ 17 | //#define FREQUENCY RF69_868MHZ 18 | #define FREQUENCY RF69_915MHZ 19 | #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! 20 | //#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! 21 | #define ACK_TIME 30 // max # of ms to wait for an ack 22 | #define LED 9 // Moteinos have LEDs on D9 23 | #define SERIAL_BAUD 115200 24 | #define MOTIONPIN 1 //hardware interrupt 1 (D3) 25 | 26 | RFM69 radio; 27 | volatile boolean motionDetected=false; 28 | 29 | void setup() { 30 | Serial.begin(SERIAL_BAUD); 31 | radio.initialize(FREQUENCY,NODEID,NETWORKID); 32 | #ifdef IS_RFM69HW 33 | radio.setHighPower(); //uncomment only for RFM69HW! 34 | #endif 35 | radio.encrypt(ENCRYPTKEY); 36 | attachInterrupt(MOTIONPIN, motionIRQ, RISING); 37 | char buff[50]; 38 | sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); 39 | Serial.println(buff); 40 | } 41 | 42 | void motionIRQ() 43 | { 44 | motionDetected=true; 45 | } 46 | 47 | void loop() { 48 | if (motionDetected) 49 | { 50 | if (radio.sendWithRetry(GATEWAYID, "MOTION", 6)) 51 | { 52 | Serial.println(" ok!"); 53 | Blink(LED,3); 54 | } 55 | else Serial.println(" nothing..."); 56 | motionDetected=false; 57 | } 58 | radio.sleep(); 59 | LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 60 | } 61 | 62 | void Blink(byte PIN, int DELAY_MS) 63 | { 64 | pinMode(PIN, OUTPUT); 65 | digitalWrite(PIN,HIGH); 66 | delay(DELAY_MS); 67 | digitalWrite(PIN,LOW); 68 | } 69 | -------------------------------------------------------------------------------- /Software/lib/Adafruit_NeoPixel-ANDnXOR/Adafruit_NeoPixel-ANDnXOR.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------- 2 | This file is part of the Adafruit NeoPixel library. 3 | 4 | NeoPixel is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as 6 | published by the Free Software Foundation, either version 3 of 7 | the License, or (at your option) any later version. 8 | 9 | NeoPixel is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with NeoPixel. If not, see 16 | . 17 | --------------------------------------------------------------------*/ 18 | 19 | #ifndef ADAFRUIT_NEOPIXEL_H 20 | #define ADAFRUIT_NEOPIXEL_H 21 | 22 | #include 23 | 24 | // 'type' flags for LED pixels (third parameter to constructor): 25 | #define NEO_RGB 0x00 // Wired for RGB data order 26 | #define NEO_GRB 0x01 // Wired for GRB data order 27 | #define NEO_COLMASK 0x01 28 | #define NEO_KHZ400 0x00 // 400 KHz datastream 29 | #define NEO_KHZ800 0x02 // 800 KHz datastream 30 | #define NEO_SPDMASK 0x02 31 | 32 | class Adafruit_NeoPixel { 33 | 34 | public: 35 | 36 | // Constructor: number of LEDs, pin number, LED type 37 | Adafruit_NeoPixel(uint16_t n, uint8_t p=6, uint8_t t=NEO_GRB + NEO_KHZ800); 38 | 39 | void 40 | begin(void), 41 | show(void), 42 | setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b), 43 | setPixelColor(uint16_t n, uint32_t c), 44 | setBrightness(uint8_t); 45 | uint16_t 46 | numPixels(void); 47 | static uint32_t 48 | Color(uint8_t r, uint8_t g, uint8_t b); 49 | uint32_t 50 | getPixelColor(uint16_t n); 51 | 52 | private: 53 | 54 | const uint16_t 55 | numLEDs, // Number of RGB LEDs in strip 56 | numBytes; // Size of 'pixels' buffer below 57 | const uint8_t 58 | pin, // Output pin number 59 | type; // Pixel flags (400 vs 800 KHz, RGB vs GRB color) 60 | uint8_t 61 | brightness, 62 | *pixels; // Holds LED color values (3 bytes each) 63 | uint32_t 64 | endTime; // Latch timing reference 65 | #ifdef __AVR__ 66 | const volatile uint8_t 67 | *port; // Output PORT register 68 | const uint8_t 69 | pinMask; // Output PORT bitmask 70 | #endif 71 | 72 | }; 73 | 74 | #endif // ADAFRUIT_NEOPIXEL_H 75 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_init.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_init.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Initialization routines & global variables 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __USB_INIT_H 18 | #define __USB_INIT_H 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | /* Exported types ------------------------------------------------------------*/ 22 | /* Exported constants --------------------------------------------------------*/ 23 | /* Exported macro ------------------------------------------------------------*/ 24 | /* Exported functions ------------------------------------------------------- */ 25 | void USB_Init(void); 26 | 27 | /* External variables --------------------------------------------------------*/ 28 | /* The number of current endpoint, it will be used to specify an endpoint */ 29 | extern u8 EPindex; 30 | /* The number of current device, it is an index to the Device_Table */ 31 | /*extern u8 Device_no; */ 32 | /* Points to the DEVICE_INFO structure of current device */ 33 | /* The purpose of this register is to speed up the execution */ 34 | extern DEVICE_INFO* pInformation; 35 | /* Points to the DEVICE_PROP structure of current device */ 36 | /* The purpose of this register is to speed up the execution */ 37 | extern DEVICE_PROP* pProperty; 38 | /* Temporary save the state of Rx & Tx status. */ 39 | /* Whenever the Rx or Tx state is changed, its value is saved */ 40 | /* in this variable first and will be set to the EPRB or EPRA */ 41 | /* at the end of interrupt process */ 42 | extern USER_STANDARD_REQUESTS *pUser_Standard_Requests; 43 | 44 | extern u16 SaveState ; 45 | extern volatile u16 wInterrupt_Mask; 46 | 47 | #endif /* __USB_INIT_H */ 48 | 49 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 50 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/acb-bf592/uart.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file uart.c 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.0 8 | * =============================================================== 9 | * Copyright (c) 2010-2015 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #include 34 | #include 35 | #include "uart.h" 36 | #include "chip.h" 37 | 38 | #define UART0_BAUDRATE (57600) 39 | #define UART0_DIVISOR (CHIP_SYSCLK_HZ / 16 / UART0_BAUDRATE) 40 | 41 | void uart_init(void) 42 | { 43 | *pUART0_GCTL = 1; 44 | 45 | *pUART0_LCR |= DLAB; 46 | *pUART0_DLL = UART0_DIVISOR & 0xFF; 47 | *pUART0_DLH = UART0_DIVISOR >> 8; 48 | *pUART0_LCR &= ~DLAB; 49 | 50 | *pUART0_LCR = WLS(8); 51 | 52 | *pUART0_IER = 0; 53 | 54 | *pPORTF_MUX &= ~(PF11 | PF12); 55 | *pPORTF_FER |= (PF11 | PF12); 56 | } 57 | 58 | int uart_putc(char c) 59 | { 60 | while (0 == (*pUART0_LSR & THRE)) { 61 | ssync(); 62 | } 63 | *pUART0_THR = c; 64 | ssync(); 65 | return c; 66 | } 67 | 68 | int uart_getc(void) 69 | { 70 | while (0 == (*pUART0_LSR & DR)) { 71 | ssync(); 72 | } 73 | return *pUART0_RBR; 74 | } 75 | 76 | int uart_puts(const char *s) 77 | { 78 | int cnt = 0; 79 | char *p = (char *)s; 80 | while (*p) { 81 | uart_putc(*p); 82 | p++; 83 | cnt++; 84 | } 85 | return cnt; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/text_history.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file text_history.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef TEXT_HISTORY_H 34 | #define TEXT_HISTORY_H 35 | 36 | #include "ntconf.h" 37 | 38 | /** 39 | * @brief Maximum length per a history. 40 | */ 41 | #define TEXTHISTORY_MAXLEN (NTCONF_EDITOR_MAXLEN) 42 | 43 | /** 44 | * @brief Depth of the history. 45 | */ 46 | #define TEXTHISTORY_DEPTH (NTCONF_HISTORY_DEPTH) 47 | 48 | /** 49 | * @brief Structure of the text history module. 50 | */ 51 | typedef struct { 52 | /** 53 | * @brief History buffer. 54 | */ 55 | char history[TEXTHISTORY_MAXLEN * TEXTHISTORY_DEPTH]; 56 | 57 | /** 58 | * @brief Read pointer. 59 | */ 60 | int rp; 61 | 62 | /** 63 | * @brief Write pointer. 64 | */ 65 | int wp; 66 | } text_history_t; 67 | 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | void text_history_init(text_history_t *p); 73 | int text_history_write(text_history_t *p, char *buf); 74 | int text_history_read(text_history_t *p, char *buf, const int siz); 75 | int text_history_read_point_next(text_history_t *p); 76 | int text_history_read_point_prev(text_history_t *p); 77 | int text_history_find(text_history_t *p, const int index, const char *text, char *buf, const int siz); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/gpio_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx GPIO driver 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #include "chip.h" 33 | 34 | /***************************************************************************** 35 | * Private types/enumerations/variables 36 | ****************************************************************************/ 37 | 38 | /***************************************************************************** 39 | * Public types/enumerations/variables 40 | ****************************************************************************/ 41 | 42 | /***************************************************************************** 43 | * Private functions 44 | ****************************************************************************/ 45 | 46 | /***************************************************************************** 47 | * Public functions 48 | ****************************************************************************/ 49 | 50 | /* GPIO initilisation function */ 51 | void Chip_GPIO_Init(LPC_GPIO_T *pGPIO) 52 | { 53 | Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO); 54 | } 55 | 56 | /* GPIO deinitialisation function */ 57 | void Chip_GPIO_DeInit(LPC_GPIO_T *pGPIO) 58 | { 59 | Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_GPIO); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/text_editor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file text_editor.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef TEXT_EDITOR_H 34 | #define TEXT_EDITOR_H 35 | 36 | #include "ntconf.h" 37 | 38 | /** 39 | * @brief Maximum length of the text string. 40 | */ 41 | #define TEXTEDITOR_MAXLEN (NTCONF_EDITOR_MAXLEN) 42 | 43 | /** 44 | * @brief Text editor handler. 45 | */ 46 | typedef struct { 47 | char buffer[TEXTEDITOR_MAXLEN]; /**< Buffer for the text string. */ 48 | int pos; /**< Position of the logical cursor. */ 49 | int len; /**< Length of the text string. */ 50 | } text_editor_t; 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | void text_editor_init(text_editor_t *p); 57 | int text_editor_insert(text_editor_t *p, char c); 58 | int text_editor_backspace(text_editor_t *p); 59 | int text_editor_delete(text_editor_t *p); 60 | int text_editor_cursor_get_position(text_editor_t *p); 61 | int text_editor_cursor_head(text_editor_t *p); 62 | int text_editor_cursor_tail(text_editor_t *p); 63 | int text_editor_cursor_left(text_editor_t *p); 64 | int text_editor_cursor_right(text_editor_t *p); 65 | int text_editor_set_text(text_editor_t *p, char *buf); 66 | int text_editor_get_text(text_editor_t *p, char *buf, int siz); 67 | void text_editor_clear(text_editor_t *p); 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/chip_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx Miscellaneous chip specific functions 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #include "chip.h" 33 | 34 | /***************************************************************************** 35 | * Private types/enumerations/variables 36 | ****************************************************************************/ 37 | 38 | /***************************************************************************** 39 | * Public types/enumerations/variables 40 | ****************************************************************************/ 41 | 42 | /* System Clock Frequency (Core Clock) */ 43 | uint32_t SystemCoreClock; 44 | 45 | /***************************************************************************** 46 | * Private functions 47 | ****************************************************************************/ 48 | 49 | /***************************************************************************** 50 | * Public functions 51 | ****************************************************************************/ 52 | 53 | /* Update system core clock rate, should be called if the system has 54 | a clock rate change */ 55 | void SystemCoreClockUpdate(void) 56 | { 57 | /* CPU core speed */ 58 | SystemCoreClock = Chip_Clock_GetSystemClockRate(); 59 | } 60 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/acb-bf592/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.0 8 | * =============================================================== 9 | * Copyright (c) 2010-2015 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #include 34 | #include "ntshell.h" 35 | #include "chip.h" 36 | #include "uart.h" 37 | #include "ntlibc.h" 38 | 39 | #define UNUSED_VARIABLE(N) do { (void)(N); } while (0) 40 | 41 | static int func_read(char *buf, int cnt, void *extobj) 42 | { 43 | int i; 44 | UNUSED_VARIABLE(extobj); 45 | for (i = 0; i < cnt; i++) { 46 | buf[i] = uart_getc(); 47 | } 48 | return cnt; 49 | } 50 | 51 | static int func_write(const char *buf, int cnt, void *extobj) 52 | { 53 | int i; 54 | UNUSED_VARIABLE(extobj); 55 | for (i = 0; i < cnt; i++) { 56 | uart_putc(buf[i]); 57 | } 58 | return cnt; 59 | } 60 | 61 | static int func_callback(const char *text, void *extobj) 62 | { 63 | ntshell_t *ntshell = (ntshell_t *)extobj; 64 | UNUSED_VARIABLE(ntshell); 65 | UNUSED_VARIABLE(extobj); 66 | if (ntlibc_strlen(text) > 0) { 67 | uart_puts("User input text:'"); 68 | uart_puts(text); 69 | uart_puts("'\r\n"); 70 | } 71 | return 0; 72 | } 73 | 74 | int main(void) 75 | { 76 | ntshell_t ntshell; 77 | chip_init(); 78 | uart_init(); 79 | ntshell_init( 80 | &ntshell, 81 | func_read, 82 | func_write, 83 | func_callback, 84 | (void *)&ntshell); 85 | ntshell_set_prompt(&ntshell, "BlueTank>"); 86 | ntshell_execute(&ntshell); 87 | return 0; 88 | } 89 | 90 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #include "chip.h" 34 | #include "uart.h" 35 | #include "ntshell.h" 36 | #include "usrcmd.h" 37 | #include 38 | 39 | static int serial_read(char *buf, int cnt, void *extobj) 40 | { 41 | for (int i = 0; i < cnt; i++) { 42 | buf[i] = uart_getc(); 43 | } 44 | return cnt; 45 | } 46 | 47 | static int serial_write(const char *buf, int cnt, void *extobj) 48 | { 49 | for (int i = 0; i < cnt; i++) { 50 | uart_putc(buf[i]); 51 | } 52 | return cnt; 53 | } 54 | 55 | static int user_callback(const char *text, void *extobj) 56 | { 57 | #if 0 58 | /* 59 | * This is a really simple example codes for the callback function. 60 | */ 61 | uart_puts("USERINPUT["); 62 | uart_puts(text); 63 | uart_puts("]\r\n"); 64 | #else 65 | /* 66 | * This is a complete example for a real embedded application. 67 | */ 68 | usrcmd_execute(text); 69 | #endif 70 | return 0; 71 | } 72 | 73 | int main(void) 74 | { 75 | void *extobj = 0; 76 | ntshell_t nts; 77 | SystemCoreClockUpdate(); 78 | uart_init(); 79 | uart_puts("User command example for NT-Shell.\r\n"); 80 | ntshell_init(&nts, serial_read, serial_write, user_callback, extobj); 81 | ntshell_set_prompt(&nts, "LPC824>"); 82 | while (1) { 83 | ntshell_execute(&nts); 84 | } 85 | return 0 ; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_type.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_type.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Type definitions used by the USB Library 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __USB_TYPE_H 18 | #define __USB_TYPE_H 19 | 20 | /* Exported types ------------------------------------------------------------*/ 21 | /* Exported constants --------------------------------------------------------*/ 22 | #ifndef NULL 23 | #define NULL ((void *)0) 24 | #endif 25 | 26 | #ifndef __STM32F10x_TYPE_H 27 | 28 | typedef signed long s32; 29 | typedef signed short s16; 30 | typedef signed char s8; 31 | 32 | typedef volatile signed long vs32; 33 | typedef volatile signed short vs16; 34 | typedef volatile signed char vs8; 35 | 36 | typedef unsigned long u32; 37 | typedef unsigned short u16; 38 | typedef unsigned char u8; 39 | 40 | typedef unsigned long const uc32; /* Read Only */ 41 | typedef unsigned short const uc16; /* Read Only */ 42 | typedef unsigned char const uc8; /* Read Only */ 43 | 44 | typedef volatile unsigned long vu32; 45 | typedef volatile unsigned short vu16; 46 | typedef volatile unsigned char vu8; 47 | 48 | typedef volatile unsigned long const vuc32; /* Read Only */ 49 | typedef volatile unsigned short const vuc16; /* Read Only */ 50 | typedef volatile unsigned char const vuc8; /* Read Only */ 51 | 52 | 53 | typedef enum 54 | { 55 | FALSE = 0, TRUE = !FALSE 56 | } 57 | bool; 58 | 59 | typedef enum { RESET = 0, SET = !RESET } FlagStatus, ITStatus; 60 | 61 | typedef enum { DISABLE = 0, ENABLE = !DISABLE} FunctionalState; 62 | 63 | typedef enum { ERROR = 0, SUCCESS = !ERROR} ErrorStatus; 64 | #endif 65 | 66 | /* Exported macro ------------------------------------------------------------*/ 67 | /* Exported functions ------------------------------------------------------- */ 68 | /* External variables --------------------------------------------------------*/ 69 | 70 | #endif /* __USB_TYPE_H */ 71 | 72 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /Software/Bootloader/build/usb_callbacks.lst: -------------------------------------------------------------------------------- 1 | 1 .syntax unified 2 | 2 .cpu cortex-m3 3 | 3 .fpu softvfp 4 | 4 .eabi_attribute 20, 1 5 | 5 .eabi_attribute 21, 1 6 | 6 .eabi_attribute 23, 3 7 | 7 .eabi_attribute 24, 1 8 | 8 .eabi_attribute 25, 1 9 | 9 .eabi_attribute 26, 1 10 | 10 .eabi_attribute 30, 4 11 | 11 .eabi_attribute 34, 1 12 | 12 .eabi_attribute 18, 4 13 | 13 .thumb 14 | 14 .file "usb_callbacks.c" 15 | 15 .text 16 | 16 .Ltext0: 17 | 17 .section .gnu.lto_.inline.524bd2d75b5d5e5d,"",%progbits 18 | 18 0000 789C6362 .ascii "x\234cb`b\300\006\020\242\000\000\272\000\007" 19 | 18 6062C006 20 | 18 10A20000 21 | 18 BA0007 22 | 19 .text 23 | 20 .section .gnu.lto_.pureconst.524bd2d75b5d5e5d,"",%progbits 24 | 21 0000 789C6362 .ascii "x\234cb`b`d\200\002\000\000F\000\006" 25 | 21 60626064 26 | 21 80020000 27 | 21 460006 28 | 22 .text 29 | 23 .section .gnu.lto_.symbol_nodes.524bd2d75b5d5e5d,"",%progbits 30 | 24 0000 789C6362 .ascii "x\234cb`\002B\030\000\000\000V\000\007" 31 | 24 60024218 32 | 24 00000056 33 | 24 0007 34 | 25 .text 35 | 26 .section .gnu.lto_.refs.524bd2d75b5d5e5d,"",%progbits 36 | 27 0000 789C6362 .ascii "x\234cb`b`d\200\002\000\000F\000\006" 37 | 27 60626064 38 | 27 80020000 39 | 27 460006 40 | 28 .text 41 | 29 .section .gnu.lto_.decls.524bd2d75b5d5e5d,"",%progbits 42 | 30 0000 789C6362 .ascii "x\234cb`bPa``\370\017\004@\212\201\021\212\355\030\010" 43 | 30 60625061 44 | 30 6060F80F 45 | 30 04408A81 46 | 30 118AED18 47 | 31 0015 0000CE1B .ascii "\000\000\316\033\004e" 48 | 31 0465 49 | 32 .text 50 | 33 .section .gnu.lto_.symtab.524bd2d75b5d5e5d,"",%progbits 51 | 34 .text 52 | 35 .section .gnu.lto_.opts,"",%progbits 53 | 36 0000 272D6D74 .ascii "'-mthumb' '-mcpu=cortex-m3' '-mthumb-interwork' '-g" 54 | 36 68756D62 55 | 36 2720272D 56 | 36 6D637075 57 | 36 3D636F72 58 | 37 0033 2720272D .ascii "' '-Os' '-ffunction-sections' '-fdata-sections' '-f" 59 | 37 4F732720 60 | 37 272D6666 61 | 37 756E6374 62 | 37 696F6E2D 63 | 38 0066 6C746F27 .ascii "lto'\000" 64 | 38 00 65 | 39 .text 66 | 40 .cfi_sections .debug_frame 67 | 41 .Letext0: 68 | DEFINED SYMBOLS 69 | *ABS*:0000000000000000 usb_callbacks.c 70 | *COM*:0000000000000001 __gnu_lto_v1 71 | 72 | NO UNDEFINED SYMBOLS 73 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_def.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_def.h 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Definitions related to USB Core 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Define to prevent recursive inclusion -------------------------------------*/ 17 | #ifndef __USB_DEF_H 18 | #define __USB_DEF_H 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | /* Exported types ------------------------------------------------------------*/ 22 | typedef enum _RECIPIENT_TYPE 23 | { 24 | DEVICE_RECIPIENT, /* Recipient device */ 25 | INTERFACE_RECIPIENT, /* Recipient interface */ 26 | ENDPOINT_RECIPIENT, /* Recipient endpoint */ 27 | OTHER_RECIPIENT 28 | } RECIPIENT_TYPE; 29 | 30 | 31 | typedef enum _STANDARD_REQUESTS 32 | { 33 | GET_STATUS = 0, 34 | CLEAR_FEATURE, 35 | RESERVED1, 36 | SET_FEATURE, 37 | RESERVED2, 38 | SET_ADDRESS, 39 | GET_DESCRIPTOR, 40 | SET_DESCRIPTOR, 41 | GET_CONFIGURATION, 42 | SET_CONFIGURATION, 43 | GET_INTERFACE, 44 | SET_INTERFACE, 45 | TOTAL_sREQUEST, /* Total number of Standard request */ 46 | SYNCH_FRAME = 12 47 | } STANDARD_REQUESTS; 48 | 49 | /* Definition of "USBwValue" */ 50 | typedef enum _DESCRIPTOR_TYPE 51 | { 52 | DEVICE_DESCRIPTOR = 1, 53 | CONFIG_DESCRIPTOR, 54 | STRING_DESCRIPTOR, 55 | INTERFACE_DESCRIPTOR, 56 | ENDPOINT_DESCRIPTOR 57 | } DESCRIPTOR_TYPE; 58 | 59 | /* Feature selector of a SET_FEATURE or CLEAR_FEATURE */ 60 | typedef enum _FEATURE_SELECTOR 61 | { 62 | ENDPOINT_STALL, 63 | DEVICE_REMOTE_WAKEUP 64 | } FEATURE_SELECTOR; 65 | 66 | /* Exported constants --------------------------------------------------------*/ 67 | /* Definition of "USBbmRequestType" */ 68 | #define REQUEST_TYPE 0x60 /* Mask to get request type */ 69 | #define STANDARD_REQUEST 0x00 /* Standard request */ 70 | #define CLASS_REQUEST 0x20 /* Class request */ 71 | #define VENDOR_REQUEST 0x40 /* Vendor request */ 72 | 73 | #define RECIPIENT 0x1F /* Mask to get recipient */ 74 | 75 | /* Exported macro ------------------------------------------------------------*/ 76 | /* Exported functions ------------------------------------------------------- */ 77 | 78 | #endif /* __USB_DEF_H */ 79 | 80 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 81 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/sysinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Common SystemInit function for LPC8xx chips 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2013-14 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #if defined(NO_BOARD_LIB) 33 | #include "chip.h" 34 | #else 35 | #include "board.h" 36 | #endif 37 | 38 | /***************************************************************************** 39 | * Private types/enumerations/variables 40 | ****************************************************************************/ 41 | 42 | /***************************************************************************** 43 | * Public types/enumerations/variables 44 | ****************************************************************************/ 45 | 46 | #if defined(NO_BOARD_LIB) 47 | const uint32_t OscRateIn = 12000000; 48 | const uint32_t ExtRateIn = 0; 49 | #endif 50 | 51 | /***************************************************************************** 52 | * Private functions 53 | ****************************************************************************/ 54 | 55 | /***************************************************************************** 56 | * Public functions 57 | ****************************************************************************/ 58 | 59 | /* Set up and initialize hardware prior to call to main */ 60 | void SystemInit(void) 61 | { 62 | #if defined(NO_BOARD_LIB) 63 | /* Chip specific SystemInit */ 64 | Chip_SystemInit(); 65 | #else 66 | /* Board specific SystemInit */ 67 | Board_SystemInit(); 68 | #endif 69 | } 70 | -------------------------------------------------------------------------------- /Software/ANDnXOR_Badge/games.h: -------------------------------------------------------------------------------- 1 | #ifndef GAMES_H 2 | #define GAMES_H 3 | 4 | #include 5 | #include 6 | #include "flash.h" 7 | #include "games.h" 8 | 9 | //Asteroids Settings 10 | #define ASTEROIDS_BULLET_STEP_MS 300 11 | #define ASTEROIDS_GAME_STEP_MS 100 12 | #define ASTEROIDS_NUMBER_BULLETS 8 13 | #define ASTEROIDS_NUMBER_SKULLS 4 14 | #define ASTEROIDS_MAX_DX 1.6 15 | #define ASTEROIDS_MAX_DY 1.6 16 | #define ASTEROIDS_BULLET_VELOCITY 3.5 17 | #define ASTEROIDS_SHIP_ACCEL 0.7 18 | #define ASTEROIDS_SHIP_MARGIN 4 19 | #define ASTEROIDS_XP_PER_SKULL 3 20 | 21 | //Dodge settings 22 | #define DODGE_CREATE_OBJECT_PCT 10 23 | #define DODGE_FALL_VELOCITY 1.9 24 | #define DODGE_STEP_MS 80 25 | #define DODGE_PLAYER_STEP_MS 100 26 | #define DODGE_SPRITE_COUNT 16 27 | #define DODGE_POINTS_PER_FLOPPY 10 28 | #define DODGE_POINTS_PER_MISS -8 29 | #define DODGE_XP_PER_POINT 0.3 30 | 31 | //Flappy settings 32 | #define FLAPPY_PIPE_COUT 4 33 | #define FLAPPY_PIPE_GAP 30 34 | #define FLAPPY_PIPE_MIN_HEIGHT 8 35 | #define FLAPPY_PIPE_SPACING 90 36 | #define FLAPPY_PLAYER_X 30 37 | #define FLAPPY_PIPE_MAX_HEIGHT 64 - PIPE_GAP - (2 * PIPE_MIN_HEIGHT) 38 | #define FLAPPY_PIPE_VELOCITY 3 39 | #define FLAPPY_UP_TIME_MS 500 40 | #define FLAPPY_STEP_MS 80 41 | #define FLAPPY_MAX_VELOCITY 8 42 | #define FLAPPY_VELOCITY_UP -1.5 43 | #define FLAPPY_GRAVITY 0.8 44 | 45 | //Ski settings 46 | #define SKI_ACCELERATION 0.01 47 | #define SKI_M_PER_XP 70 48 | #define SKI_STEP_MS 80 49 | #define SKI_X 56 50 | #define SKI_Y 4 51 | #define SKI_MARGIN 4 52 | #define SKI_SPRITE_COUNT 16 53 | #define SKI_WORLD_WIDTH 3 54 | #define SKI_WORLD_HEIGHT 2 55 | 56 | extern Adafruit_SSD1306 display; 57 | extern ANXFlash flash; 58 | extern Adafruit_NeoPixel leds; 59 | 60 | struct sprite { 61 | float x, y; 62 | int8_t dx, dy; 63 | uint32_t address; 64 | }; 65 | 66 | struct bullet { 67 | float x, y, dx, dy; 68 | }; 69 | 70 | struct dodgeState { 71 | int32_t points; 72 | float x; 73 | sprite sprites[DODGE_SPRITE_COUNT]; 74 | }; 75 | 76 | struct pipe { 77 | int16_t x; 78 | uint8_t h; 79 | bool passed; 80 | }; 81 | 82 | struct flappyState { 83 | bool flapUp; 84 | float playerY; 85 | pipe pipes[FLAPPY_PIPE_COUT]; 86 | uint16_t pipesPassed; 87 | uint32_t xp; 88 | 89 | uint8_t skullSizeBytes = 26; 90 | uint8_t skullDown[26]; 91 | uint8_t skullUp[26]; 92 | 93 | uint8_t pipeSizeBytes = 120; 94 | uint8_t pipeBottom[120]; 95 | uint8_t pipeTop[120]; 96 | }; 97 | 98 | struct skiState { 99 | sprite sprites[SKI_SPRITE_COUNT]; 100 | int8_t angle; 101 | float distance; 102 | float velocity, velocityAngled; 103 | }; 104 | 105 | struct skull { 106 | float x, y, dx, dy; 107 | }; 108 | 109 | extern void asteroids(); 110 | extern void dodge(); 111 | extern void flappy(); 112 | extern void gameProgress(); 113 | extern void ski(); 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /Software/lib/LowPowerLab-RFM69-STM32-ANDnXOR/Examples/RandomNumbers/RandomNumbers.ino: -------------------------------------------------------------------------------- 1 | // Sample RFM69 random temperature sender at fixed intervals (F) 2 | // Library and code by Felix Rusu - felix@lowpowerlab.com 3 | // Get the RFM69 library at: https://github.com/LowPowerLab/ 4 | #include //get it here: https://www.github.com/lowpowerlab/rfm69 5 | #include 6 | 7 | #define NODEID 98 //unique for each node on same network 8 | #define NETWORKID 100 //the same on all nodes that talk to each other 9 | #define GATEWAYID 1 10 | //Match frequency to the hardware version of the radio on your Moteino (uncomment one): 11 | #define FREQUENCY RF69_433MHZ 12 | #define FREQUENCY RF69_915MHZ 13 | #define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! 14 | #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! 15 | #define ACK_TIME 30 // max # of ms to wait for an ack 16 | 17 | #ifdef __AVR_ATmega1284P__ 18 | #define LED 15 // Moteino MEGAs have LEDs on D15 19 | #define FLASH_SS 23 // and FLASH SS on D23 20 | #else 21 | #define LED 9 // Moteinos have LEDs on D9 22 | #define FLASH_SS 8 // and FLASH SS on D8 23 | #endif 24 | 25 | #define SERIAL_BAUD 115200 26 | 27 | int TRANSMITPERIOD = 10000; //transmit a packet to gateway so often (in ms) 28 | char buff[35]; 29 | byte sendSize=0; 30 | RFM69 radio; 31 | 32 | void setup() { 33 | Serial.begin(SERIAL_BAUD); 34 | radio.initialize(FREQUENCY,NODEID,NETWORKID); 35 | #ifdef IS_RFM69HW 36 | radio.setHighPower(); //uncomment only for RFM69HW! 37 | #endif 38 | radio.encrypt(ENCRYPTKEY); 39 | 40 | char buff[50]; 41 | sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); 42 | Serial.println(buff); 43 | } 44 | 45 | long lastPeriod = 0; 46 | long randNumber1 = 0; 47 | long randNumber2 = 0; 48 | void loop() { 49 | if (radio.receiveDone()) 50 | { 51 | Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] "); 52 | for (byte i = 0; i < radio.DATALEN; i++) 53 | Serial.print((char)radio.DATA[i]); 54 | Serial.print(" [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]"); 55 | 56 | if (radio.ACKRequested()) 57 | { 58 | radio.sendACK(); 59 | Serial.print(" - ACK sent"); 60 | } 61 | Blink(LED,3); 62 | Serial.println(); 63 | } 64 | 65 | int currPeriod = millis()/TRANSMITPERIOD; 66 | if (currPeriod != lastPeriod) 67 | { 68 | lastPeriod=currPeriod; 69 | randNumber1 = random(99); 70 | randNumber2 = random(99); 71 | 72 | if (randNumber2 > 70) 73 | sprintf(buff, "F:%d.5", randNumber1); 74 | else 75 | sprintf(buff, "F:-%d.5", randNumber1); 76 | sendSize = strlen(buff); 77 | 78 | if (radio.sendWithRetry(GATEWAYID, buff, sendSize)) 79 | Serial.print(" ok!"); 80 | else Serial.print(" nothing..."); 81 | 82 | Serial.println(); 83 | Blink(LED,3); 84 | } 85 | } 86 | 87 | void Blink(byte PIN, int DELAY_MS) 88 | { 89 | pinMode(PIN, OUTPUT); 90 | digitalWrite(PIN,HIGH); 91 | delay(DELAY_MS); 92 | digitalWrite(PIN,LOW); 93 | } 94 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/inc/rom_pwr_8xx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx Power ROM API declarations and functions 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #ifndef __ROM_PWR_8XX_H_ 33 | #define __ROM_PWR_8XX_H_ 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** @defgroup PWRD_8XX CHIP: LPC8xx Power ROM API declarations and functions 40 | * @ingroup CHIP_8XX_Drivers 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief LPC8xx Power ROM APIs - set_pll mode options 46 | */ 47 | #define CPU_FREQ_EQU 0 48 | #define CPU_FREQ_LTE 1 49 | #define CPU_FREQ_GTE 2 50 | #define CPU_FREQ_APPROX 3 51 | 52 | /** 53 | * @brief LPC8xx Power ROM APIs - set_pll response0 options 54 | */ 55 | #define PLL_CMD_SUCCESS 0 56 | #define PLL_INVALID_FREQ 1 57 | #define PLL_INVALID_MODE 2 58 | #define PLL_FREQ_NOT_FOUND 3 59 | #define PLL_NOT_LOCKED 4 60 | 61 | /** 62 | * @brief LPC8xx Power ROM APIs - set_power mode options 63 | */ 64 | #define PWR_DEFAULT 0 65 | #define PWR_CPU_PERFORMANCE 1 66 | #define PWR_EFFICIENCY 2 67 | #define PWR_LOW_CURRENT 3 68 | 69 | /** 70 | * @brief LPC8xx Power ROM APIs - set_power response0 options 71 | */ 72 | #define PWR_CMD_SUCCESS 0 73 | #define PWR_INVALID_FREQ 1 74 | #define PWR_INVALID_MODE 2 75 | 76 | /** 77 | * @brief LPC8XX Power ROM API structure 78 | */ 79 | typedef struct PWRD_API { 80 | void (*set_pll)(uint32_t cmd[], uint32_t resp[]); /*!< Set PLL function */ 81 | void (*set_power)(uint32_t cmd[], uint32_t resp[]); /*!< Set power function */ 82 | } PWRD_API_T; 83 | 84 | /** 85 | * @} 86 | */ 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif /* __ROM_PWR_8XX_H_ */ 93 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_init.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_init.c 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Initialization routines & global variables 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Includes ------------------------------------------------------------------*/ 17 | #include "usb_lib.h" 18 | 19 | /* Private typedef -----------------------------------------------------------*/ 20 | /* Private define ------------------------------------------------------------*/ 21 | /* Private macro -------------------------------------------------------------*/ 22 | /* Private variables ---------------------------------------------------------*/ 23 | /* The number of current endpoint, it will be used to specify an endpoint */ 24 | u8 EPindex; 25 | /* The number of current device, it is an index to the Device_Table */ 26 | /* u8 Device_no; */ 27 | /* Points to the DEVICE_INFO structure of current device */ 28 | /* The purpose of this register is to speed up the execution */ 29 | DEVICE_INFO *pInformation; 30 | /* Points to the DEVICE_PROP structure of current device */ 31 | /* The purpose of this register is to speed up the execution */ 32 | DEVICE_PROP *pProperty; 33 | /* Temporary save the state of Rx & Tx status. */ 34 | /* Whenever the Rx or Tx state is changed, its value is saved */ 35 | /* in this variable first and will be set to the EPRB or EPRA */ 36 | /* at the end of interrupt process */ 37 | u16 SaveState ; 38 | volatile u16 wInterrupt_Mask; 39 | DEVICE_INFO Device_Info; 40 | USER_STANDARD_REQUESTS *pUser_Standard_Requests; 41 | 42 | /* Extern variables ----------------------------------------------------------*/ 43 | /* Private function prototypes -----------------------------------------------*/ 44 | /* Private functions ---------------------------------------------------------*/ 45 | 46 | /******************************************************************************* 47 | * Function Name : USB_Init 48 | * Description : USB system initialization 49 | * Input : None. 50 | * Output : None. 51 | * Return : None. 52 | *******************************************************************************/ 53 | void USB_Init(void) 54 | { 55 | pInformation = &Device_Info; 56 | pInformation->ControlState = 2; 57 | pProperty = &Device_Property; 58 | pUser_Standard_Requests = &User_Standard_Requests; 59 | /* Initialize devices one by one */ 60 | 61 | pProperty->Init(); 62 | } 63 | 64 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 65 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/swm_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx Pin Switch Matrix driver 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licenser disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #include "chip.h" 33 | 34 | /***************************************************************************** 35 | * Private types/enumerations/variables 36 | ****************************************************************************/ 37 | 38 | #define PINASSIGN_IDX(movable) (((movable) >> 4)) 39 | #define PINSHIFT(movable) (((movable) & 0xF) << 3) 40 | 41 | /***************************************************************************** 42 | * Public types/enumerations/variables 43 | ****************************************************************************/ 44 | 45 | /***************************************************************************** 46 | * Private functions 47 | ****************************************************************************/ 48 | 49 | /***************************************************************************** 50 | * Public functions 51 | ****************************************************************************/ 52 | 53 | /* assign a movable pin function to a physical pin */ 54 | void Chip_SWM_MovablePinAssign(CHIP_SWM_PIN_MOVABLE_T movable, uint8_t pin) 55 | { 56 | uint32_t temp; 57 | int pinshift = PINSHIFT(movable), regIndex = PINASSIGN_IDX(movable); 58 | 59 | temp = LPC_SWM->PINASSIGN[regIndex] & (~(0xFF << pinshift)); 60 | LPC_SWM->PINASSIGN[regIndex] = temp | (pin << pinshift); 61 | } 62 | 63 | /* true enables, false disables a Switch Matrix fixed-pin Function */ 64 | void Chip_SWM_FixedPinEnable(CHIP_SWM_PIN_FIXED_T pin, bool enable) 65 | { 66 | if (enable) { 67 | Chip_SWM_EnableFixedPin(pin); 68 | } 69 | else { 70 | Chip_SWM_DisableFixedPin(pin); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/wwdt_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx WWDT chip driver 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #include "chip.h" 33 | 34 | /***************************************************************************** 35 | * Private types/enumerations/variables 36 | ****************************************************************************/ 37 | 38 | /***************************************************************************** 39 | * Public types/enumerations/variables 40 | ****************************************************************************/ 41 | 42 | /***************************************************************************** 43 | * Private functions 44 | ****************************************************************************/ 45 | 46 | /***************************************************************************** 47 | * Public functions 48 | ****************************************************************************/ 49 | 50 | /* Initialize the Watchdog timer */ 51 | void Chip_WWDT_Init(LPC_WWDT_T *pWWDT) 52 | { 53 | Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_WWDT); 54 | 55 | /* Disable watchdog */ 56 | pWWDT->MOD = 0; 57 | pWWDT->TC = 0xFF; 58 | pWWDT->WARNINT = 0xFFFF; 59 | pWWDT->WINDOW = 0xFFFFFF; 60 | } 61 | 62 | /* Shutdown the Watchdog timer */ 63 | void Chip_WWDT_DeInit(LPC_WWDT_T *pWWDT) 64 | { 65 | Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_WWDT); 66 | } 67 | 68 | /* Clear WWDT interrupt status flags */ 69 | void Chip_WWDT_ClearStatusFlag(LPC_WWDT_T *pWWDT, uint32_t status) 70 | { 71 | if (status & WWDT_WDMOD_WDTOF) { 72 | pWWDT->MOD &= (~WWDT_WDMOD_WDTOF) & WWDT_WDMOD_BITMASK; 73 | } 74 | 75 | if (status & WWDT_WDMOD_WDINT) { 76 | pWWDT->MOD = WWDT_WDMOD_WDINT | (pWWDT->MOD & ~WWDT_MOD_RESERVED); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/sct_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx State Configurable Timer driver 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2013 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #include "chip.h" 33 | 34 | /***************************************************************************** 35 | * Private types/enumerations/variables 36 | ****************************************************************************/ 37 | 38 | /***************************************************************************** 39 | * Public types/enumerations/variables 40 | ****************************************************************************/ 41 | 42 | /***************************************************************************** 43 | * Private functions 44 | ****************************************************************************/ 45 | 46 | /***************************************************************************** 47 | * Public functions 48 | ****************************************************************************/ 49 | 50 | /* Initialize SCT */ 51 | void Chip_SCT_Init(LPC_SCT_T *pSCT) 52 | { 53 | Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SCT); 54 | Chip_SYSCTL_PeriphReset(RESET_SCT); 55 | } 56 | 57 | /* Shutdown SCT */ 58 | void Chip_SCT_DeInit(LPC_SCT_T *pSCT) 59 | { 60 | Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SCT); 61 | } 62 | 63 | /* Set/Clear SCT control register */ 64 | void Chip_SCT_SetClrControl(LPC_SCT_T *pSCT, uint32_t value, FunctionalState ena) 65 | { 66 | if (ena == ENABLE) { 67 | Chip_SCT_SetControl(pSCT, value); 68 | } 69 | else { 70 | Chip_SCT_ClearControl(pSCT, value); 71 | } 72 | } 73 | 74 | /* Set Conflict resolution */ 75 | void Chip_SCT_SetConflictResolution(LPC_SCT_T *pSCT, uint8_t outnum, uint8_t value) 76 | { 77 | uint32_t tem; 78 | 79 | tem = pSCT->RES & ~((0x03 << (2 * outnum))|SCT_RES_RESERVED); 80 | pSCT->RES = tem | (value << (2 * outnum)); 81 | } 82 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntstdio.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntstdio.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | /*------------------------------------------------------------------------/ 34 | / Universal string handler for user console interface 35 | /-------------------------------------------------------------------------/ 36 | / 37 | / Copyright (C) 2011, ChaN, all right reserved. 38 | / 39 | / * This software is a free software and there is NO WARRANTY. 40 | / * No restriction on use. You can use, modify and redistribute it for 41 | / personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. 42 | / * Redistributions of source code must retain the above copyright notice. 43 | / 44 | /-------------------------------------------------------------------------*/ 45 | 46 | #ifndef NTSTDIO_H 47 | #define NTSTDIO_H 48 | 49 | /** 50 | * 1: Convert \n ==> \r\n in the output char. 51 | */ 52 | #define NTSTDIO_OPTION_CR_CRLF (1 << 0) 53 | 54 | /** 55 | * 1: Echo back input chars in ntstdio_gets function. 56 | */ 57 | #define NTSTDIO_OPTION_LINE_ECHO (1 << 1) 58 | 59 | typedef unsigned char (*NTSTDIO_XI)(void); 60 | typedef void (*NTSTDIO_XO)(unsigned char c); 61 | 62 | typedef struct { 63 | NTSTDIO_XI xi; 64 | NTSTDIO_XO xo; 65 | char *outptr; 66 | unsigned int option; 67 | } ntstdio_t; 68 | 69 | void ntstdio_init(ntstdio_t *handle, unsigned int option, NTSTDIO_XI xi, NTSTDIO_XO xo); 70 | 71 | void ntstdio_putc(ntstdio_t *handle, char c); 72 | void ntstdio_puts(ntstdio_t *handle, const char *str); 73 | void ntstdio_fputs(ntstdio_t *handle, NTSTDIO_XO xo, const char *str); 74 | void ntstdio_printf(ntstdio_t *handle, const char *fmt, ...); 75 | void ntstdio_sprintf(ntstdio_t *handle, char *buf, const char *fmt, ...); 76 | void ntstdio_fprintf(ntstdio_t *handle, NTSTDIO_XO xo, const char *fmt, ...); 77 | 78 | int ntstdio_gets(ntstdio_t *handle, char *buf, int len); 79 | int ntstdio_fgets(ntstdio_t *handle, NTSTDIO_XI xi, char *buf, int len); 80 | 81 | #endif 82 | 83 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/inc/romapi_8xx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx ROM API declarations and functions 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | 32 | #ifndef __ROMAPI_8XX_H_ 33 | #define __ROMAPI_8XX_H_ 34 | 35 | #include "iap.h" 36 | #include "error_8xx.h" 37 | #include "rom_i2c_8xx.h" 38 | #include "rom_pwr_8xx.h" 39 | #include "rom_uart_8xx.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** @defgroup ROMAPI_8XX CHIP: LPC8xx ROM API declarations and functions 46 | * @ingroup CHIP_8XX_Drivers 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @brief LPC8XX High level ROM API structure 52 | */ 53 | typedef struct ROM_API { 54 | const uint32_t unused[3]; 55 | const PWRD_API_T *pPWRD; /*!< Power profiles API function table */ 56 | const uint32_t p_dev1; 57 | const I2CD_API_T *pI2CD; /*!< I2C driver routines functions table */ 58 | const uint32_t p_dev3; 59 | const uint32_t p_dev4; 60 | const uint32_t p_dev5; 61 | const UARTD_API_T *pUARTD; /*!< UART driver routines function table */ 62 | } LPC_ROM_API_T; 63 | 64 | /* Pointer to ROM API function address */ 65 | #define LPC_ROM_API_BASE_LOC 0x1FFF1FF8UL 66 | #define LPC_ROM_API (*(LPC_ROM_API_T * *) LPC_ROM_API_BASE_LOC) 67 | 68 | /* Pointer to @ref PWRD_API_T functions in ROM */ 69 | #define LPC_PWRD_API ((LPC_ROM_API)->pPWRD) 70 | 71 | /* Pointer to @ref I2CD_API_T functions in ROM */ 72 | #define LPC_I2CD_API ((LPC_ROM_API)->pI2CD) 73 | 74 | /* Pointer to @ref UARTD_API_T functions in ROM */ 75 | #define LPC_UARTD_API ((LPC_ROM_API)->pUARTD) 76 | 77 | /* Pointer to ROM IAP entry functions */ 78 | #define IAP_ENTRY_LOCATION 0X1FFF1FF1UL 79 | 80 | /** 81 | * @brief LPC8XX IAP_ENTRY API function type 82 | */ 83 | static INLINE void iap_entry(unsigned int cmd_param[], unsigned int status_result[]) 84 | { 85 | ((IAP_ENTRY_T) IAP_ENTRY_LOCATION)(cmd_param, status_result); 86 | } 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __ROMAPI_8XX_H_ */ 97 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_chip_8xx/src/wkt_8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief LPC8xx Self Wakeup Timer (WKT) chip driver 3 | * 4 | * @note 5 | * Copyright(C) NXP Semiconductors, 2012 6 | * All rights reserved. 7 | * 8 | * @par 9 | * Software that is described herein is for illustrative purposes only 10 | * which provides customers with programming information regarding the 11 | * LPC products. This software is supplied "AS IS" without any warranties of 12 | * any kind, and NXP Semiconductors and its licensor disclaim any and 13 | * all warranties, express or implied, including all implied warranties of 14 | * merchantability, fitness for a particular purpose and non-infringement of 15 | * intellectual property rights. NXP Semiconductors assumes no responsibility 16 | * or liability for the use of the software, conveys no license or rights under any 17 | * patent, copyright, mask work right, or any other intellectual property rights in 18 | * or to any products. NXP Semiconductors reserves the right to make changes 19 | * in the software without notification. NXP Semiconductors also makes no 20 | * representation or warranty that such application will be suitable for the 21 | * specified use without further testing or modification. 22 | * 23 | * @par 24 | * Permission to use, copy, modify, and distribute this software and its 25 | * documentation is hereby granted, under NXP Semiconductors' and its 26 | * licensor's relevant copyrights in the software, without fee, provided that it 27 | * is used in conjunction with NXP Semiconductors microcontrollers. This 28 | * copyright, permission, and disclaimer notice must appear in all copies of 29 | * this code. 30 | */ 31 | #include "chip.h" 32 | 33 | /***************************************************************************** 34 | * Private types/enumerations/variables 35 | ****************************************************************************/ 36 | 37 | /***************************************************************************** 38 | * Public types/enumerations/variables 39 | ****************************************************************************/ 40 | 41 | /***************************************************************************** 42 | * Private functions 43 | ****************************************************************************/ 44 | 45 | /***************************************************************************** 46 | * Public functions 47 | ****************************************************************************/ 48 | 49 | /* Set clock source for WKT */ 50 | void Chip_WKT_SetClockSource(LPC_WKT_T *pWKT, WKT_CLKSRC_T clkSrc) 51 | { 52 | if (clkSrc == WKT_CLKSRC_10KHZ) { 53 | pWKT->CTRL |= WKT_CTRL_CLKSEL; /* using Low Power clock 10kHz */ 54 | } 55 | else { 56 | pWKT->CTRL &= ~WKT_CTRL_CLKSEL; /* using Divided IRC clock 750kHz */ 57 | } 58 | } 59 | 60 | /* Return approximate rate for the selected clock source */ 61 | uint32_t Chip_WKT_GetClockRate(LPC_WKT_T *pWKT) 62 | { 63 | if (Chip_WKT_GetClockSource(pWKT) == WKT_CLKSRC_DIVIRC) { 64 | /* Approximately 750KHz */ 65 | return (750 * 1000); 66 | } 67 | else { 68 | /* Approximately 10KHz */ 69 | return (10 * 1000); 70 | } 71 | } 72 | 73 | /* Start wake-up timer interrupt, set clock source, set timer interval */ 74 | void Chip_WKT_Start(LPC_WKT_T *pWKT, WKT_CLKSRC_T clkSrc, uint32_t cntVal) 75 | { 76 | /* Set the WKT clock source */ 77 | Chip_WKT_SetClockSource(pWKT, (WKT_CLKSRC_T) clkSrc); 78 | 79 | /* Set the WKT counter & start it */ 80 | pWKT->COUNT = cntVal; 81 | } 82 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/ntshell.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntshell.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef NTSHELL_H 34 | #define NTSHELL_H 35 | 36 | #include "vtrecv.h" 37 | #include "vtsend.h" 38 | #include "text_editor.h" 39 | #include "text_history.h" 40 | 41 | #define NTSHELL_PROMPT_MAXLEN (32) 42 | #define NTSHELL_PROMPT_DEFAULT ">" 43 | #define NTSHELL_PROMPT_NEWLINE "\r\n" 44 | 45 | typedef int (*NTSHELL_SERIAL_READ)(char *buf, int cnt, void *extobj); 46 | typedef int (*NTSHELL_SERIAL_WRITE)(const char *buf, int cnt, void *extobj); 47 | typedef int (*NTSHELL_USER_CALLBACK)(const char *text, void *extobj); 48 | 49 | /** 50 | * @brief The handler of NT-Shell. 51 | * @details 52 | * The best way to provide a handler, We should hide the implementation from the library users. 53 | * But some small embedded environments can not use memory allocation dynamically. 54 | * So this implementation open the fields of the handler in this header. 55 | * You can use this handler on the stacks. 56 | */ 57 | typedef struct { 58 | unsigned int initcode; /**< Initialization flag. */ 59 | vtsend_t vtsend; /**< The handler of vtsend. */ 60 | vtrecv_t vtrecv; /**< The handler of vtrecv. */ 61 | text_editor_t editor; /**< The handler of text_editor. */ 62 | text_history_t history; /**< The handler of text_history. */ 63 | int suggest_index; 64 | char suggest_source[TEXTEDITOR_MAXLEN]; 65 | NTSHELL_SERIAL_READ func_read; 66 | NTSHELL_SERIAL_WRITE func_write; 67 | NTSHELL_USER_CALLBACK func_callback; 68 | void *extobj; 69 | char prompt[NTSHELL_PROMPT_MAXLEN]; 70 | } ntshell_t; 71 | 72 | #ifdef __cplusplus 73 | extern "C" { 74 | #endif 75 | 76 | void ntshell_init(ntshell_t *p, 77 | NTSHELL_SERIAL_READ func_read, 78 | NTSHELL_SERIAL_WRITE func_write, 79 | NTSHELL_USER_CALLBACK func_callback, 80 | void *extobj); 81 | void ntshell_execute(ntshell_t *p); 82 | void ntshell_set_prompt(ntshell_t *p, const char *prompt); 83 | void ntshell_version(int *major, int *minor, int *release); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif 90 | 91 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/sample/target/nxp-lpc824/lpc_monitor/src/mtb.c: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // +--+ 3 | // | ++----+ 4 | // +-++ | 5 | // | | 6 | // +-+--+ | 7 | // | +--+--+ 8 | // +----+ Copyright (c) 2013 Code Red Technologies Ltd. 9 | // 10 | // mtb.c 11 | // 12 | // Optionally defines an array to be used as a buffer for Micro Trace 13 | // Buffer (MTB) instruction trace on Cortex-M0+ parts 14 | // 15 | // Version : 130502 16 | // 17 | // Software License Agreement 18 | // 19 | // The software is owned by Code Red Technologies and/or its suppliers, and is 20 | // protected under applicable copyright laws. All rights are reserved. Any 21 | // use in violation of the foregoing restrictions may subject the user to criminal 22 | // sanctions under applicable laws, as well as to civil liability for the breach 23 | // of the terms and conditions of this license. 24 | // 25 | // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED 26 | // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 27 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. 28 | // USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT 29 | // TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH 30 | // CODE RED TECHNOLOGIES LTD. 31 | // 32 | //***************************************************************************** 33 | 34 | /******************************************************************* 35 | * Symbols controlling behavior of this code... 36 | * 37 | * __MTB_DISABLE 38 | * If this symbol is defined, then the buffer array for the MTB 39 | * will not be created. 40 | * 41 | * __MTB_BUFFER_SIZE 42 | * Symbol specifying the sizer of the buffer array for the MTB. 43 | * This must be a power of 2 in size, and fit into the available 44 | * RAM. The MTB buffer will also be aligned to its 'size' 45 | * boundary and be placed at the start of a RAM bank (which 46 | * should ensure minimal or zero padding due to alignment). 47 | * 48 | * __MTB_RAM_BANK 49 | * Allows MTB Buffer to be placed into specific RAM bank. When 50 | * this is not defined, the "default" (first if there are 51 | * several) RAM bank is used. 52 | *******************************************************************/ 53 | 54 | // Ignore with none Code Red tools 55 | #if defined (__CODE_RED) 56 | 57 | // Allow MTB to be removed by setting a define (via command line) 58 | #if !defined (__MTB_DISABLE) 59 | 60 | // Allow for MTB buffer size being set by define set via command line 61 | // Otherwise provide small default buffer 62 | #if !defined (__MTB_BUFFER_SIZE) 63 | #define __MTB_BUFFER_SIZE 128 64 | #endif 65 | 66 | // Check that buffer size requested is >0 bytes in size 67 | #if (__MTB_BUFFER_SIZE > 0) 68 | // Pull in MTB related macros 69 | #include 70 | 71 | // Check if MYTB buffer is to be placed in specific RAM bank 72 | #if defined(__MTB_RAM_BANK) 73 | // Place MTB buffer into explicit bank of RAM 74 | __CR_MTB_BUFFER_EXT(__MTB_BUFFER_SIZE,__MTB_RAM_BANK); 75 | #else 76 | // Place MTB buffer into 'default' bank of RAM 77 | __CR_MTB_BUFFER(__MTB_BUFFER_SIZE); 78 | 79 | #endif // defined(__MTB_RAM_BANK) 80 | 81 | #endif // (__MTB_BUFFER_SIZE > 0) 82 | 83 | #endif // !defined (__MTB_DISABLE) 84 | 85 | #endif // defined (__CODE_RED) 86 | 87 | -------------------------------------------------------------------------------- /Software/Bootloader/usb_lib/usb_mem.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : usb_mem.c 3 | * Author : MCD Application Team 4 | * Version : V2.2.1 5 | * Date : 09/22/2008 6 | * Description : Utility functions for memory transfers to/from PMA 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | /* Includes ------------------------------------------------------------------*/ 17 | #include "usb_lib.h" 18 | 19 | /* Private typedef -----------------------------------------------------------*/ 20 | /* Private define ------------------------------------------------------------*/ 21 | /* Private macro -------------------------------------------------------------*/ 22 | /* Private variables ---------------------------------------------------------*/ 23 | /* Extern variables ----------------------------------------------------------*/ 24 | /* Private function prototypes -----------------------------------------------*/ 25 | /* Private functions ---------------------------------------------------------*/ 26 | /******************************************************************************* 27 | * Function Name : UserToPMABufferCopy 28 | * Description : Copy a buffer from user memory area to packet memory area (PMA) 29 | * Input : - pbUsrBuf: pointer to user memory area. 30 | * - wPMABufAddr: address into PMA. 31 | * - wNBytes: no. of bytes to be copied. 32 | * Output : None. 33 | * Return : None . 34 | *******************************************************************************/ 35 | void UserToPMABufferCopy(u8 *pbUsrBuf, u16 wPMABufAddr, u16 wNBytes) 36 | { 37 | u32 n = (wNBytes + 1) >> 1; /* n = (wNBytes + 1) / 2 */ 38 | u32 i, temp1, temp2; 39 | u16 *pdwVal; 40 | pdwVal = (u16 *)(wPMABufAddr * 2 + PMAAddr); 41 | for (i = n; i != 0; i--) 42 | { 43 | temp1 = (u16) * pbUsrBuf; 44 | pbUsrBuf++; 45 | temp2 = temp1 | (u16) * pbUsrBuf << 8; 46 | *pdwVal++ = temp2; 47 | pdwVal++; 48 | pbUsrBuf++; 49 | } 50 | } 51 | /******************************************************************************* 52 | * Function Name : PMAToUserBufferCopy 53 | * Description : Copy a buffer from user memory area to packet memory area (PMA) 54 | * Input : - pbUsrBuf = pointer to user memory area. 55 | * - wPMABufAddr = address into PMA. 56 | * - wNBytes = no. of bytes to be copied. 57 | * Output : None. 58 | * Return : None. 59 | *******************************************************************************/ 60 | void PMAToUserBufferCopy(u8 *pbUsrBuf, u16 wPMABufAddr, u16 wNBytes) 61 | { 62 | u32 n = (wNBytes + 1) >> 1;/* /2*/ 63 | u32 i; 64 | u32 *pdwVal; 65 | pdwVal = (u32 *)(wPMABufAddr * 2 + PMAAddr); 66 | for (i = n; i != 0; i--) 67 | { 68 | *(u16*)pbUsrBuf++ = *pdwVal++; 69 | pbUsrBuf++; 70 | } 71 | } 72 | 73 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 74 | -------------------------------------------------------------------------------- /Software/Bootloader/stm32_lib/stm32f10x_type.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : stm32f10x_type.h 3 | * Author : MCD Application Team 4 | * Version : V2.0.3 5 | * Date : 09/22/2008 6 | * Description : This file contains all the common data types used for the 7 | * STM32F10x firmware library. 8 | ******************************************************************************** 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | *******************************************************************************/ 16 | 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __STM32F10x_TYPE_H 19 | #define __STM32F10x_TYPE_H 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | /* Exported types ------------------------------------------------------------*/ 23 | typedef signed long s32; 24 | typedef signed short s16; 25 | typedef signed char s8; 26 | 27 | typedef signed long const sc32; /* Read Only */ 28 | typedef signed short const sc16; /* Read Only */ 29 | typedef signed char const sc8; /* Read Only */ 30 | 31 | typedef volatile signed long vs32; 32 | typedef volatile signed short vs16; 33 | typedef volatile signed char vs8; 34 | 35 | typedef volatile signed long const vsc32; /* Read Only */ 36 | typedef volatile signed short const vsc16; /* Read Only */ 37 | typedef volatile signed char const vsc8; /* Read Only */ 38 | 39 | typedef unsigned long u32; 40 | typedef unsigned short u16; 41 | typedef unsigned char u8; 42 | 43 | typedef unsigned long const uc32; /* Read Only */ 44 | typedef unsigned short const uc16; /* Read Only */ 45 | typedef unsigned char const uc8; /* Read Only */ 46 | 47 | typedef volatile unsigned long vu32; 48 | typedef volatile unsigned short vu16; 49 | typedef volatile unsigned char vu8; 50 | 51 | typedef volatile unsigned long const vuc32; /* Read Only */ 52 | typedef volatile unsigned short const vuc16; /* Read Only */ 53 | typedef volatile unsigned char const vuc8; /* Read Only */ 54 | 55 | typedef enum {FALSE = 0, TRUE = !FALSE} bool; 56 | 57 | typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; 58 | 59 | typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; 60 | #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) 61 | 62 | typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; 63 | 64 | #define U8_MAX ((u8)255) 65 | #define S8_MAX ((s8)127) 66 | #define S8_MIN ((s8)-128) 67 | #define U16_MAX ((u16)65535u) 68 | #define S16_MAX ((s16)32767) 69 | #define S16_MIN ((s16)-32768) 70 | #define U32_MAX ((u32)4294967295uL) 71 | #define S32_MAX ((s32)2147483647) 72 | #define S32_MIN ((s32)-2147483648) 73 | 74 | /* Exported constants --------------------------------------------------------*/ 75 | /* Exported macro ------------------------------------------------------------*/ 76 | /* Exported functions ------------------------------------------------------- */ 77 | 78 | #endif /* __STM32F10x_TYPE_H */ 79 | 80 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 81 | -------------------------------------------------------------------------------- /Software/lib/NT-Shell-ANDnXOR/vtsend.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vtsend.h 3 | * @author CuBeatSystems 4 | * @author Shinichiro Nakamura 5 | * @copyright 6 | * =============================================================== 7 | * Natural Tiny Shell (NT-Shell) Version 0.3.1 8 | * =============================================================== 9 | * Copyright (c) 2010-2016 Shinichiro Nakamura 10 | * 11 | * Permission is hereby granted, free of charge, to any person 12 | * obtaining a copy of this software and associated documentation 13 | * files (the "Software"), to deal in the Software without 14 | * restriction, including without limitation the rights to use, 15 | * copy, modify, merge, publish, distribute, sublicense, and/or 16 | * sell copies of the Software, and to permit persons to whom the 17 | * Software is furnished to do so, subject to the following 18 | * conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be 21 | * included in all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | * OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #ifndef VTSEND_H 34 | #define VTSEND_H 35 | 36 | #define VTSEND_COLOR_BLACK (0) 37 | #define VTSEND_COLOR_RED (1) 38 | #define VTSEND_COLOR_GREEN (2) 39 | #define VTSEND_COLOR_YELLOW (3) 40 | #define VTSEND_COLOR_BLUE (4) 41 | #define VTSEND_COLOR_MAGENTA (5) 42 | #define VTSEND_COLOR_CYAN (6) 43 | #define VTSEND_COLOR_WHITE (7) 44 | 45 | #define VTSEND_ATTR_OFF (0) 46 | #define VTSEND_ATTR_BOLD_ON (1) 47 | #define VTSEND_ATTR_UNDERSCORE (4) 48 | #define VTSEND_ATTR_BLINK_ON (5) 49 | #define VTSEND_ATTR_REVERSE (7) 50 | #define VTSEND_ATTR_CONCEALED_ON (8) 51 | 52 | typedef int (*VTSEND_SERIAL_WRITE)(const char *buf, const int siz, void *extobj); 53 | 54 | typedef struct { 55 | VTSEND_SERIAL_WRITE uart_write; 56 | void *extobj; 57 | } vtsend_t; 58 | 59 | #ifdef __cplusplus 60 | extern "C" { 61 | #endif 62 | 63 | int vtsend_init(vtsend_t *p, VTSEND_SERIAL_WRITE uart_write, void *extobj); 64 | int vtsend_cursor_position(vtsend_t *p, const int column, const int line); 65 | int vtsend_cursor_up(vtsend_t *p, const int n); 66 | int vtsend_cursor_down(vtsend_t *p, const int n); 67 | int vtsend_cursor_forward(vtsend_t *p, const int n); 68 | int vtsend_cursor_backward(vtsend_t *p, const int n); 69 | int vtsend_cursor_position_save(vtsend_t *p); 70 | int vtsend_cursor_position_restore(vtsend_t *p); 71 | int vtsend_erase_display(vtsend_t *p); 72 | int vtsend_erase_line(vtsend_t *p); 73 | int vtsend_set_color_foreground(vtsend_t *p, const int color); 74 | int vtsend_set_color_background(vtsend_t *p, const int color); 75 | int vtsend_set_attribute(vtsend_t *p, const int attr); 76 | int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom); 77 | int vtsend_set_cursor(vtsend_t *p, const int visible); 78 | int vtsend_reset(vtsend_t *p); 79 | 80 | int vtsend_draw_box( 81 | vtsend_t *p, 82 | const int x1, const int y1, const int x2, const int y2); 83 | int vtsend_fill_box( 84 | vtsend_t *p, 85 | const int x1, const int y1, const int x2, const int y2); 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif 92 | 93 | -------------------------------------------------------------------------------- /Provision/ANXFlash.py: -------------------------------------------------------------------------------- 1 | import csv 2 | import math 3 | import serial 4 | from time import sleep 5 | import sys, getopt 6 | from PIL import Image 7 | from optparse import OptionParser 8 | 9 | def main(argv): 10 | parser = OptionParser() 11 | parser.add_option( 12 | "-f", "--file", 13 | action="store", 14 | dest="filename", 15 | help="File to Write to Flash", 16 | metavar="FILE") 17 | parser.add_option( 18 | "-d", "--device", 19 | action="store", 20 | dest="device", 21 | help="Serial Device to Flash") 22 | parser.add_option( 23 | "-v", "--verbose", 24 | action="store_true", 25 | dest="verbose", 26 | help="Verbose Output") 27 | parser.add_option( 28 | "-a", "--address", 29 | action="store", 30 | dest="address", 31 | type="int", 32 | help="Address in flash memory to write") 33 | parser.add_option( 34 | "-o", "--offset", 35 | action="store", 36 | dest="offset", 37 | type="int", 38 | default=0, 39 | help="Offset within bin file to start writing") 40 | 41 | 42 | (options, args) = parser.parse_args() 43 | 44 | ser = serial.Serial() 45 | ser.port=options.device 46 | ser.baudrate=115200 47 | ser.xonxoff=False 48 | ser.stopbits=serial.STOPBITS_ONE 49 | 50 | 51 | 52 | doFileTransfer(ser, options) 53 | 54 | def waitForLine(ser, test, options): 55 | line = None 56 | 57 | #Wait for device to be ready 58 | while (line != test): 59 | line = ser.readline().rstrip().decode("latin_1") 60 | # line = ser.readline().rstrip() 61 | #if options.verbose: 62 | # print("<<", line) 63 | 64 | def readSerial(ser, options): 65 | ser.Open(); 66 | waitForLine(ser, "Ready", options) 67 | #Write some data 68 | print("** Sending read serial command") 69 | ser.write(b's') 70 | line = ser.readline().rstrip().decode("utf-8") 71 | print("MCU Serial is", line) 72 | waitForLine(ser, "Done", options) 73 | return line 74 | ser.close() 75 | 76 | def doFileTransfer(ser, options): 77 | 78 | if ser.isOpen(): 79 | ser.close() 80 | ser.open() 81 | print(ser.isOpen()) 82 | 83 | with open(options.filename, "rb") as f: 84 | binData = bytearray(f.read()) 85 | 86 | 87 | size = len(binData) - options.offset 88 | print("Flashing File", options.filename) 89 | print("\tSize (bytes): ", size) 90 | waitForLine(ser, "Ready", options) 91 | 92 | #Write some data 93 | print("\tSending write command") 94 | ser.write(b'w') 95 | 96 | print("\tWaiting for address") 97 | #Wait for the device to ask for an address 98 | waitForLine(ser, "Address:", options) 99 | #write the address 100 | if options.verbose: 101 | print("\tSending " + hex(options.address) + " as address") 102 | ser.write(bytearray(str(options.address), encoding = "ascii")) 103 | ser.write(b'\n') 104 | #Wait to send the page count 105 | waitForLine(ser, "Size(Bytes):", options) 106 | ser.write(str(size).encode('latin_1')) 107 | ser.write(b'\n') 108 | 109 | #Wait for go signal 110 | waitForLine(ser, "OK GO", options) 111 | 112 | print("\t***Flashing, please wait***") 113 | 114 | #write bytes 115 | count = 0 116 | for byte in binData: 117 | #skip offset bytes 118 | if count >= options.offset: 119 | ser.write(bytes([byte])) 120 | #sleep(0.001) 121 | waitForLine(ser, "A", options) 122 | if options.verbose: 123 | print(count, ":", hex(byte)) 124 | count += 1 125 | pct = (100 * count / size) 126 | if (pct > 100): 127 | pct = 100 128 | sys.stdout.write("\r\t%3.1f%%" % pct) 129 | sys.stdout.flush() 130 | 131 | waitForLine(ser, "DONE", options) 132 | print("Done.") 133 | ser.close() 134 | 135 | if __name__ == "__main__": 136 | main(sys.argv[1:]) 137 | 138 | -------------------------------------------------------------------------------- /Software/Bootloader/stm32_lib/cortexm3_macro.s: -------------------------------------------------------------------------------- 1 | # 1 "./stm32_lib/cortexm3_macro.S" 2 | # 1 "" 3 | # 1 "" 4 | # 1 "./stm32_lib/cortexm3_macro.S" 5 | # 16 "./stm32_lib/cortexm3_macro.S" 6 | .cpu cortex-m3 7 | .fpu softvfp 8 | .syntax unified 9 | .thumb 10 | .text 11 | 12 | 13 | .globl __WFI 14 | .globl __WFE 15 | .globl __SEV 16 | .globl __ISB 17 | .globl __DSB 18 | .globl __DMB 19 | .globl __SVC 20 | .globl __MRS_CONTROL 21 | .globl __MSR_CONTROL 22 | .globl __MRS_PSP 23 | .globl __MSR_PSP 24 | .globl __MRS_MSP 25 | .globl __MSR_MSP 26 | .globl __RESETPRIMASK 27 | .globl __SETPRIMASK 28 | .globl __READ_PRIMASK 29 | .globl __RESETFAULTMASK 30 | .globl __SETFAULTMASK 31 | .globl __READ_FAULTMASK 32 | .globl __BASEPRICONFIG 33 | .globl __GetBASEPRI 34 | .globl __REV_HalfWord 35 | .globl __REV_Word 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | .thumb_func 44 | __WFI: 45 | 46 | WFI 47 | BX r14 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | .thumb_func 56 | __WFE: 57 | 58 | WFE 59 | BX r14 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | .thumb_func 68 | __SEV: 69 | 70 | SEV 71 | BX r14 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | .thumb_func 80 | __ISB: 81 | 82 | ISB 83 | BX r14 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | .thumb_func 92 | __DSB: 93 | 94 | DSB 95 | BX r14 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | .thumb_func 104 | __DMB: 105 | 106 | DMB 107 | BX r14 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | .thumb_func 116 | __SVC: 117 | 118 | SVC 0x01 119 | BX r14 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | .thumb_func 128 | __MRS_CONTROL: 129 | 130 | MRS r0,control 131 | BX r14 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | .thumb_func 140 | __MSR_CONTROL: 141 | 142 | MSR control, r0 143 | ISB 144 | BX r14 145 | 146 | 147 | 148 | 149 | 150 | 151 | .thumb_func 152 | __MRS_PSP: 153 | 154 | MRS r0, psp 155 | BX r14 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | .thumb_func 164 | __MSR_PSP: 165 | 166 | MSR psp, r0 167 | BX r14 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | .thumb_func 176 | __MRS_MSP: 177 | 178 | MRS r0, msp 179 | BX r14 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | .thumb_func 188 | __MSR_MSP: 189 | 190 | MSR msp, r0 191 | BX r14 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | .thumb_func 200 | __RESETPRIMASK: 201 | 202 | CPSIE i 203 | BX r14 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | .thumb_func 212 | __SETPRIMASK: 213 | 214 | CPSID i 215 | BX r14 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | .thumb_func 224 | __READ_PRIMASK: 225 | 226 | MRS r0, PRIMASK 227 | BX r14 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | .thumb_func 236 | __RESETFAULTMASK: 237 | 238 | CPSIE f 239 | BX r14 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | .thumb_func 248 | __SETFAULTMASK: 249 | 250 | CPSID f 251 | BX r14 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | .thumb_func 260 | __READ_FAULTMASK: 261 | 262 | MRS r0, FAULTMASK 263 | BX r14 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | .thumb_func 272 | __BASEPRICONFIG: 273 | 274 | MSR basepri, r0 275 | BX r14 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | .thumb_func 284 | __GetBASEPRI: 285 | 286 | MRS r0, basepri_max 287 | BX r14 288 | 289 | 290 | 291 | 292 | 293 | 294 | .thumb_func 295 | __REV_HalfWord: 296 | 297 | REV16 r0, r0 298 | BX r14 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | .thumb_func 307 | __REV_Word: 308 | 309 | REV r0, r0 310 | BX r14 311 | 312 | .end 313 | --------------------------------------------------------------------------------