├── .gitattributes ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug.md │ ├── forum.md │ └── request.md ├── .gitignore ├── .travis.yml ├── COMPILING.md ├── Drivers ├── 98-ChameleonMini.rules ├── DFU Driver │ ├── COPYING_GPL.txt │ ├── amd64 │ │ ├── libusb0.dll │ │ └── libusb0.sys │ ├── atmel_usb_dfu.cat │ ├── atmel_usb_dfu.inf │ ├── ia64 │ │ ├── libusb0.dll │ │ └── libusb0.sys │ └── x86 │ │ ├── libusb0.sys │ │ └── libusb0_x86.dll └── install_udev.sh ├── Firmware ├── Atmel-DFU-Bootloader │ ├── .gitignore │ ├── ASF-License.txt │ ├── README.md │ ├── common │ │ ├── boards │ │ │ └── board.h │ │ ├── services │ │ │ ├── clock │ │ │ │ ├── genclk.h │ │ │ │ ├── osc.h │ │ │ │ ├── pll.h │ │ │ │ ├── sysclk.h │ │ │ │ └── xmega │ │ │ │ │ ├── osc.h │ │ │ │ │ ├── pll.h │ │ │ │ │ ├── sysclk.c │ │ │ │ │ └── sysclk.h │ │ │ ├── isp │ │ │ │ └── flip │ │ │ │ │ ├── flip_protocol.h │ │ │ │ │ ├── isp.h │ │ │ │ │ └── xmega │ │ │ │ │ ├── cstartup.s90 │ │ │ │ │ └── isp.c │ │ │ └── usb │ │ │ │ ├── class │ │ │ │ └── dfu_flip │ │ │ │ │ ├── device │ │ │ │ │ ├── bootloader │ │ │ │ │ │ └── xmega │ │ │ │ │ │ │ ├── atxmega32a4u │ │ │ │ │ │ │ └── iar │ │ │ │ │ │ │ │ ├── asf.h │ │ │ │ │ │ │ │ ├── atxmega32a4u_boot.xcl │ │ │ │ │ │ │ │ ├── xmega_small.dep │ │ │ │ │ │ │ │ ├── xmega_small.ewd │ │ │ │ │ │ │ │ ├── xmega_small.ewp │ │ │ │ │ │ │ │ ├── xmega_small.ewt │ │ │ │ │ │ │ │ └── xmega_small.eww │ │ │ │ │ │ │ ├── conf │ │ │ │ │ │ │ ├── conf_board.h │ │ │ │ │ │ │ ├── conf_clock.h │ │ │ │ │ │ │ ├── conf_isp.h │ │ │ │ │ │ │ └── conf_usb.h │ │ │ │ │ │ │ ├── main.c │ │ │ │ │ │ │ ├── main.h │ │ │ │ │ │ │ └── sysclk_opt.c │ │ │ │ │ ├── udi_dfu_atmel.c │ │ │ │ │ ├── udi_dfu_atmel.h │ │ │ │ │ ├── udi_dfu_atmel_conf.h │ │ │ │ │ └── udi_dfu_atmel_desc.c │ │ │ │ │ └── usb_protocol_dfu.h │ │ │ │ ├── udc │ │ │ │ ├── udc.h │ │ │ │ ├── udc_desc.h │ │ │ │ ├── udc_dfu_small.c │ │ │ │ ├── udd.h │ │ │ │ └── udi.h │ │ │ │ ├── usb_atmel.h │ │ │ │ └── usb_protocol.h │ │ └── utils │ │ │ ├── interrupt.h │ │ │ ├── interrupt │ │ │ └── interrupt_avr8.h │ │ │ └── parts.h │ └── xmega │ │ ├── boards │ │ └── dummy │ │ │ └── dummy_board.h │ │ ├── drivers │ │ ├── cpu │ │ │ ├── ccp.h │ │ │ ├── ccp.s │ │ │ └── xmega_reset_cause.h │ │ ├── nvm │ │ │ ├── nvm.c │ │ │ ├── nvm.h │ │ │ └── nvm_asm.s │ │ └── usb │ │ │ ├── usb_device.c │ │ │ └── usb_device.h │ │ └── utils │ │ ├── assembler.h │ │ ├── assembler │ │ └── iar.h │ │ ├── bit_handling │ │ └── clz_ctz.h │ │ ├── compiler.h │ │ ├── preprocessor │ │ ├── mrepeat.h │ │ ├── preprocessor.h │ │ ├── stringz.h │ │ └── tpaste.h │ │ ├── progmem.h │ │ └── status_codes.h ├── ChameleonMini │ ├── .gitignore │ ├── AntennaLevel.c │ ├── AntennaLevel.h │ ├── Application │ │ ├── Application.h │ │ ├── Crypto1.c │ │ ├── Crypto1.h │ │ ├── ISO14443-3A.c │ │ ├── ISO14443-3A.h │ │ ├── MifareClassic.c │ │ ├── MifareClassic.h │ │ ├── MifareUltralight.c │ │ ├── MifareUltralight.h │ │ ├── NTAG21x.c │ │ └── NTAG21x.h │ ├── Button.c │ ├── Button.h │ ├── ChameleonMini.c │ ├── ChameleonMini.componentinfo.xml │ ├── ChameleonMini.cproj │ ├── ChameleonMini.h │ ├── Codec │ │ ├── Codec.c │ │ ├── Codec.h │ │ ├── ISO14443-2A.c │ │ └── ISO14443-2A.h │ ├── Common.c │ ├── Common.h │ ├── Configuration.c │ ├── Configuration.h │ ├── LED.c │ ├── LED.h │ ├── LUFA │ │ ├── Build │ │ │ ├── DMBS │ │ │ │ ├── .gitignore │ │ │ │ ├── DMBS │ │ │ │ │ ├── HID_EEPROM_Loader │ │ │ │ │ │ ├── HID_EEPROM_Loader.c │ │ │ │ │ │ └── makefile │ │ │ │ │ ├── License.txt │ │ │ │ │ ├── ModulesOverview.md │ │ │ │ │ ├── WritingYourOwnModules.md │ │ │ │ │ ├── atprogram.md │ │ │ │ │ ├── atprogram.mk │ │ │ │ │ ├── avrdude.md │ │ │ │ │ ├── avrdude.mk │ │ │ │ │ ├── core.md │ │ │ │ │ ├── core.mk │ │ │ │ │ ├── cppcheck.md │ │ │ │ │ ├── cppcheck.mk │ │ │ │ │ ├── dfu.md │ │ │ │ │ ├── dfu.mk │ │ │ │ │ ├── doxygen.md │ │ │ │ │ ├── doxygen.mk │ │ │ │ │ ├── gcc.md │ │ │ │ │ ├── gcc.mk │ │ │ │ │ ├── hid.md │ │ │ │ │ └── hid.mk │ │ │ │ ├── Readme.md │ │ │ │ └── Template │ │ │ │ │ ├── Template.c │ │ │ │ │ └── makefile │ │ │ ├── LUFA │ │ │ │ ├── lufa-gcc.mk │ │ │ │ └── lufa-sources.mk │ │ │ ├── lufa_atprogram.mk │ │ │ ├── lufa_avrdude.mk │ │ │ ├── lufa_build.mk │ │ │ ├── lufa_core.mk │ │ │ ├── lufa_cppcheck.mk │ │ │ ├── lufa_dfu.mk │ │ │ ├── lufa_doxygen.mk │ │ │ ├── lufa_hid.mk │ │ │ └── lufa_sources.mk │ │ ├── Common │ │ │ ├── ArchitectureSpecific.h │ │ │ ├── Architectures.h │ │ │ ├── Attributes.h │ │ │ ├── BoardTypes.h │ │ │ ├── Common.h │ │ │ ├── CompilerSpecific.h │ │ │ └── Endianness.h │ │ ├── Drivers │ │ │ ├── Board │ │ │ │ ├── AVR8 │ │ │ │ │ ├── ADAFRUITU4 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── ATAVRUSBRF01 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── BENITO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── BIGMULTIO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── BLACKCAT │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── BUI │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── BUMBLEB │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── CULV3 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── DUCE │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── EVK527 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── JMDBU2 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── LEONARDO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MAXIMUS │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MICRO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MICROPENDOUS │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MICROSIN162 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MINIMUS │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── MULTIO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── OLIMEX162 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── OLIMEX32U4 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── OLIMEXISPMK2 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── OLIMEXT32U4 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── POLOLUMICRO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── RZUSBSTICK │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── SPARKFUN8U2 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── STANGE_ISP │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── STK525 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── STK526 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── TEENSY │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── TUL │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── U2S │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── UDIP │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── UNO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── USB2AX │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── USBFOO │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── USBKEY │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── USBTINYMKII │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── XPLAIN │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── XPLAINED_MINI │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ └── YUN │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ ├── Board.h │ │ │ │ ├── Buttons.h │ │ │ │ ├── Dataflash.h │ │ │ │ ├── Joystick.h │ │ │ │ ├── LEDs.h │ │ │ │ ├── Temperature.c │ │ │ │ ├── Temperature.h │ │ │ │ ├── UC3 │ │ │ │ │ ├── EVK1100 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── EVK1101 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ ├── Joystick.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── EVK1104 │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ │ └── UC3A3_XPLAINED │ │ │ │ │ │ ├── Board.h │ │ │ │ │ │ ├── Buttons.h │ │ │ │ │ │ └── LEDs.h │ │ │ │ └── XMEGA │ │ │ │ │ ├── A3BU_XPLAINED │ │ │ │ │ ├── Board.h │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ └── LEDs.h │ │ │ │ │ ├── B1_XPLAINED │ │ │ │ │ ├── Board.h │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ └── LEDs.h │ │ │ │ │ └── C3_XPLAINED │ │ │ │ │ ├── Board.h │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ ├── Misc │ │ │ │ ├── AT45DB321C.h │ │ │ │ ├── AT45DB642D.h │ │ │ │ ├── RingBuffer.h │ │ │ │ └── TerminalCodes.h │ │ │ ├── Peripheral │ │ │ │ ├── ADC.h │ │ │ │ ├── AVR8 │ │ │ │ │ ├── ADC_AVR8.h │ │ │ │ │ ├── SPI_AVR8.h │ │ │ │ │ ├── SerialSPI_AVR8.h │ │ │ │ │ ├── Serial_AVR8.c │ │ │ │ │ ├── Serial_AVR8.h │ │ │ │ │ ├── TWI_AVR8.c │ │ │ │ │ └── TWI_AVR8.h │ │ │ │ ├── SPI.h │ │ │ │ ├── Serial.h │ │ │ │ ├── SerialSPI.h │ │ │ │ ├── TWI.h │ │ │ │ └── XMEGA │ │ │ │ │ ├── SPI_XMEGA.h │ │ │ │ │ ├── SerialSPI_XMEGA.h │ │ │ │ │ ├── Serial_XMEGA.c │ │ │ │ │ ├── Serial_XMEGA.h │ │ │ │ │ ├── TWI_XMEGA.c │ │ │ │ │ └── TWI_XMEGA.h │ │ │ └── USB │ │ │ │ ├── Class │ │ │ │ ├── AndroidAccessoryClass.h │ │ │ │ ├── AudioClass.h │ │ │ │ ├── CDCClass.h │ │ │ │ ├── Common │ │ │ │ │ ├── AndroidAccessoryClassCommon.h │ │ │ │ │ ├── AudioClassCommon.h │ │ │ │ │ ├── CDCClassCommon.h │ │ │ │ │ ├── HIDClassCommon.h │ │ │ │ │ ├── HIDParser.c │ │ │ │ │ ├── HIDParser.h │ │ │ │ │ ├── HIDReportData.h │ │ │ │ │ ├── MIDIClassCommon.h │ │ │ │ │ ├── MassStorageClassCommon.h │ │ │ │ │ ├── PrinterClassCommon.h │ │ │ │ │ ├── RNDISClassCommon.h │ │ │ │ │ └── StillImageClassCommon.h │ │ │ │ ├── Device │ │ │ │ │ ├── AudioClassDevice.c │ │ │ │ │ ├── AudioClassDevice.h │ │ │ │ │ ├── CDCClassDevice.c │ │ │ │ │ ├── CDCClassDevice.h │ │ │ │ │ ├── HIDClassDevice.c │ │ │ │ │ ├── HIDClassDevice.h │ │ │ │ │ ├── MIDIClassDevice.c │ │ │ │ │ ├── MIDIClassDevice.h │ │ │ │ │ ├── MassStorageClassDevice.c │ │ │ │ │ ├── MassStorageClassDevice.h │ │ │ │ │ ├── PrinterClassDevice.c │ │ │ │ │ ├── PrinterClassDevice.h │ │ │ │ │ ├── RNDISClassDevice.c │ │ │ │ │ └── RNDISClassDevice.h │ │ │ │ ├── HIDClass.h │ │ │ │ ├── Host │ │ │ │ │ ├── AndroidAccessoryClassHost.c │ │ │ │ │ ├── AndroidAccessoryClassHost.h │ │ │ │ │ ├── AudioClassHost.c │ │ │ │ │ ├── AudioClassHost.h │ │ │ │ │ ├── CDCClassHost.c │ │ │ │ │ ├── CDCClassHost.h │ │ │ │ │ ├── HIDClassHost.c │ │ │ │ │ ├── HIDClassHost.h │ │ │ │ │ ├── MIDIClassHost.c │ │ │ │ │ ├── MIDIClassHost.h │ │ │ │ │ ├── MassStorageClassHost.c │ │ │ │ │ ├── MassStorageClassHost.h │ │ │ │ │ ├── PrinterClassHost.c │ │ │ │ │ ├── PrinterClassHost.h │ │ │ │ │ ├── RNDISClassHost.c │ │ │ │ │ ├── RNDISClassHost.h │ │ │ │ │ ├── StillImageClassHost.c │ │ │ │ │ └── StillImageClassHost.h │ │ │ │ ├── MIDIClass.h │ │ │ │ ├── MassStorageClass.h │ │ │ │ ├── PrinterClass.h │ │ │ │ ├── RNDISClass.h │ │ │ │ └── StillImageClass.h │ │ │ │ ├── Core │ │ │ │ ├── AVR8 │ │ │ │ │ ├── Device_AVR8.c │ │ │ │ │ ├── Device_AVR8.h │ │ │ │ │ ├── EndpointStream_AVR8.c │ │ │ │ │ ├── EndpointStream_AVR8.h │ │ │ │ │ ├── Endpoint_AVR8.c │ │ │ │ │ ├── Endpoint_AVR8.h │ │ │ │ │ ├── Host_AVR8.c │ │ │ │ │ ├── Host_AVR8.h │ │ │ │ │ ├── OTG_AVR8.h │ │ │ │ │ ├── PipeStream_AVR8.c │ │ │ │ │ ├── PipeStream_AVR8.h │ │ │ │ │ ├── Pipe_AVR8.c │ │ │ │ │ ├── Pipe_AVR8.h │ │ │ │ │ ├── Template │ │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ │ ├── Template_Endpoint_RW.c │ │ │ │ │ │ └── Template_Pipe_RW.c │ │ │ │ │ ├── USBController_AVR8.c │ │ │ │ │ ├── USBController_AVR8.h │ │ │ │ │ ├── USBInterrupt_AVR8.c │ │ │ │ │ └── USBInterrupt_AVR8.h │ │ │ │ ├── ConfigDescriptors.c │ │ │ │ ├── ConfigDescriptors.h │ │ │ │ ├── Device.h │ │ │ │ ├── DeviceStandardReq.c │ │ │ │ ├── DeviceStandardReq.h │ │ │ │ ├── Endpoint.h │ │ │ │ ├── EndpointStream.h │ │ │ │ ├── Events.c │ │ │ │ ├── Events.h │ │ │ │ ├── Host.h │ │ │ │ ├── HostStandardReq.c │ │ │ │ ├── HostStandardReq.h │ │ │ │ ├── OTG.h │ │ │ │ ├── Pipe.h │ │ │ │ ├── PipeStream.h │ │ │ │ ├── StdDescriptors.h │ │ │ │ ├── StdRequestType.h │ │ │ │ ├── UC3 │ │ │ │ │ ├── Device_UC3.c │ │ │ │ │ ├── Device_UC3.h │ │ │ │ │ ├── EndpointStream_UC3.c │ │ │ │ │ ├── EndpointStream_UC3.h │ │ │ │ │ ├── Endpoint_UC3.c │ │ │ │ │ ├── Endpoint_UC3.h │ │ │ │ │ ├── Host_UC3.c │ │ │ │ │ ├── Host_UC3.h │ │ │ │ │ ├── PipeStream_UC3.c │ │ │ │ │ ├── PipeStream_UC3.h │ │ │ │ │ ├── Pipe_UC3.c │ │ │ │ │ ├── Pipe_UC3.h │ │ │ │ │ ├── Template │ │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ │ ├── Template_Endpoint_RW.c │ │ │ │ │ │ └── Template_Pipe_RW.c │ │ │ │ │ ├── USBController_UC3.c │ │ │ │ │ ├── USBController_UC3.h │ │ │ │ │ ├── USBInterrupt_UC3.c │ │ │ │ │ └── USBInterrupt_UC3.h │ │ │ │ ├── USBController.h │ │ │ │ ├── USBInterrupt.h │ │ │ │ ├── USBMode.h │ │ │ │ ├── USBTask.c │ │ │ │ ├── USBTask.h │ │ │ │ └── XMEGA │ │ │ │ │ ├── Device_XMEGA.c │ │ │ │ │ ├── Device_XMEGA.h │ │ │ │ │ ├── EndpointStream_XMEGA.c │ │ │ │ │ ├── EndpointStream_XMEGA.h │ │ │ │ │ ├── Endpoint_XMEGA.c │ │ │ │ │ ├── Endpoint_XMEGA.h │ │ │ │ │ ├── Host_XMEGA.c │ │ │ │ │ ├── PipeStream_XMEGA.c │ │ │ │ │ ├── Pipe_XMEGA.c │ │ │ │ │ ├── Template │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ └── Template_Endpoint_RW.c │ │ │ │ │ ├── USBController_XMEGA.c │ │ │ │ │ ├── USBController_XMEGA.h │ │ │ │ │ ├── USBInterrupt_XMEGA.c │ │ │ │ │ └── USBInterrupt_XMEGA.h │ │ │ │ └── USB.h │ │ ├── License.txt │ │ ├── Platform │ │ │ ├── Platform.h │ │ │ ├── UC3 │ │ │ │ ├── ClockManagement.h │ │ │ │ ├── Exception.S │ │ │ │ ├── InterruptManagement.c │ │ │ │ ├── InterruptManagement.h │ │ │ │ └── UC3ExperimentalInfo.txt │ │ │ └── XMEGA │ │ │ │ ├── ClockManagement.h │ │ │ │ └── XMEGAExperimentalInfo.txt │ │ └── Version.h │ ├── LUFAConfig.h │ ├── LUFADescriptors.c │ ├── LUFADescriptors.h │ ├── Makefile │ ├── Map.c │ ├── Map.h │ ├── Memory │ │ ├── EEPROM.c │ │ ├── EEPROM.h │ │ ├── Memory.c │ │ ├── Memory.h │ │ ├── SPIFlash.c │ │ └── SPIFlash.h │ ├── Random.c │ ├── Random.h │ ├── Settings.c │ ├── Settings.h │ ├── System.c │ ├── System.h │ └── Terminal │ │ ├── CommandLine.c │ │ ├── CommandLine.h │ │ ├── Commands.c │ │ ├── Commands.h │ │ ├── Terminal.c │ │ ├── Terminal.h │ │ ├── XModem.c │ │ └── XModem.h └── Original-Compiled │ ├── ChameleonMiniRDV2.0_ATxmega32A4U.hex │ ├── ITS_A_CARD.hex │ └── atxmega32a4u_104_PA6.hex ├── LICENSE.txt ├── README.md ├── Schematics └── Chameleon_mini_E_RDV20_REBOOTED.pdf └── Software ├── Flashing-Windows ├── BOOT_LOADER_EXE.exe ├── Createbin.exe ├── GenerateBootloader.bat ├── avr-objcopy.exe ├── dfu-programmer-win-0.7.2.zip ├── flash.bat └── msvcr120d.dll ├── Original-Windows ├── BOOT_LOADER_EXE.exe ├── Chameleon Mini RevE Rebooted.exe ├── Chameleon Mini RevE Rebooted_en.exe ├── Createbin.exe ├── GenerateBootloader.bat ├── avr-objcopy.exe ├── flash.bat ├── libusb0.dll └── msvcr120d.dll └── Tools ├── crypt_operations.py ├── pm3_eml2mfd.py ├── pm3_eml_mfd_test.py ├── pm3_mfd2eml.py └── pm3_mfdread.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # .gitattributes 2 | # prevent binary files from CRLF handling, diff and merge: 3 | *.hex -crlf -diff 4 | *.bin -crlf -diff 5 | *.z -crlf -diff 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: iceman1001 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ["https://www.paypal.me/iceman1001"] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/forum.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Forum' 3 | about: 'You would like to ask questions and/or share information with other users.' 4 | title: '[FORUM] Please enter a topic title' 5 | labels: 'question' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Feature/Enhancement Request' 3 | about: 'You would like to place a feature or enhancement request.' 4 | title: '[REQ] Enter a brief description of requested enhancement/feature' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Description 11 | 12 | 13 | ### Interest 14 | 15 | 16 | ### Possible implementation 17 | 18 | 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Chameleon specific 2 | *.sym 3 | *.lss 4 | *.s19 5 | *.bin 6 | 7 | # Generic 8 | *.bak 9 | *.gho 10 | *.ori 11 | *.orig 12 | *.tmp 13 | *.history 14 | *.log 15 | *.eml 16 | *.o 17 | *.a 18 | *.d 19 | *.elf 20 | *.s19 21 | *.map 22 | *.bin 23 | *.dll 24 | *.dbg 25 | 26 | # Vim 27 | [._]*.s[a-v][a-z] 28 | [._]*.sw[a-p] 29 | [._]s[a-rt-v][a-z] 30 | [._]ss[a-gi-z] 31 | [._]sw[a-p] 32 | Session.vim 33 | Sessionx.vim 34 | .netrwhist 35 | tags 36 | [._]*.un~ 37 | 38 | # Emacs 39 | \#*\# 40 | .emacs.desktop 41 | .emacs.desktop.lock 42 | *.elc 43 | auto-save-list 44 | tramp 45 | .\#* 46 | .org-id-locations 47 | *_archive 48 | *_flymake.* 49 | **/eshell/history 50 | **/eshell/lastdir 51 | **/elpa/ 52 | *.rel 53 | .cask/ 54 | flycheck_*.el 55 | .projectile 56 | .dir-locals.el 57 | **/network-security.data 58 | 59 | # Eclipse 60 | .metadata 61 | bin/ 62 | tmp/ 63 | *.tmp 64 | *.bak 65 | *.swp 66 | *~.nib 67 | local.properties 68 | .settings/ 69 | .loadpath 70 | .recommenders 71 | .externalToolBuilders/ 72 | *.launch 73 | *.pydevproject 74 | .cproject 75 | .autotools 76 | .factorypath 77 | .buildpath 78 | .target 79 | .tern-project 80 | .texlipse 81 | .springBeans 82 | .recommenders/ 83 | .apt_generated/ 84 | .cache-main 85 | .scala_dependencies 86 | .worksheet 87 | 88 | # Linux 89 | .fuse_hidden* 90 | .directory 91 | .Trash-* 92 | .nfs* 93 | *~ 94 | 95 | # Windows 96 | Thumbs.db 97 | Thumbs.db:encryptable 98 | ehthumbs.db 99 | ehthumbs_vista.db 100 | *.stackdump 101 | [Dd]esktop.ini 102 | $RECYCLE.BIN/ 103 | *.cab 104 | *.msi 105 | *.msix 106 | *.msm 107 | *.msp 108 | *.lnk 109 | 110 | # OSX 111 | .DS_Store 112 | .AppleDouble 113 | .LSOverride 114 | ._* 115 | .DocumentRevisions-V100 116 | .fseventsd 117 | .Spotlight-V100 118 | .TemporaryItems 119 | .Trashes 120 | .VolumeIcon.icns 121 | .com.apple.timemachine.donotpresent 122 | .AppleDB 123 | .AppleDesktop 124 | Network Trash Folder 125 | Temporary Items 126 | .apdisk 127 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: gcc 3 | matrix: 4 | include: 5 | - os: linux 6 | dist: xenial 7 | sudo: required 8 | before_install: sudo apt-get update -qq 9 | install: sudo apt-get install -y gcc-avr avr-libc binutils-avr 10 | before_script: 11 | script: cd Firmware/ChameleonMini/; make 12 | deploy: 13 | provider: releases 14 | api_key: $GH_API_KEY 15 | file: 16 | - "$TRAVIS_BUILD_DIR/Firmware/ChameleonMini/ChameleonMini.hex" 17 | - "$TRAVIS_BUILD_DIR/Firmware/ChameleonMini/ChameleonMini.eep" 18 | skip_cleanup: true 19 | -------------------------------------------------------------------------------- /COMPILING.md: -------------------------------------------------------------------------------- 1 | Compiling 2 | ========= 3 | 4 | Please see the "Compiling" section on our [Wiki](https://github.com/iceman1001/ChameleonMini-rebooted/wiki): 5 | - [GNU/Linux](https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Compiling-Linux-(Unix)) 6 | - [Windows](https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Compiling-Windows) 7 | - [OSX](https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Compiling-OSX) 8 | 9 | -------------------------------------------------------------------------------- /Drivers/98-ChameleonMini.rules: -------------------------------------------------------------------------------- 1 | # Rule for ChameleonMini RFID Research tool (RevG) 2 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="04b2", GROUP="users", MODE="0666", SYMLINK+="chameleonG", ENV{ID_MM_DEVICE_IGNORE}="1" 3 | 4 | # Rule for ChameleonMini RFID Research tool (RevE) 5 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2044", GROUP="users", MODE="0666", SYMLINK+="chameleonE", ENV{ID_MM_DEVICE_IGNORE}="1" 6 | 7 | # DFU mode (i.e., flashing the devices) 8 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fde", GROUP="users", MODE="0666" 9 | -------------------------------------------------------------------------------- /Drivers/DFU Driver/amd64/libusb0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/amd64/libusb0.dll -------------------------------------------------------------------------------- /Drivers/DFU Driver/amd64/libusb0.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/amd64/libusb0.sys -------------------------------------------------------------------------------- /Drivers/DFU Driver/atmel_usb_dfu.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/atmel_usb_dfu.cat -------------------------------------------------------------------------------- /Drivers/DFU Driver/atmel_usb_dfu.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/atmel_usb_dfu.inf -------------------------------------------------------------------------------- /Drivers/DFU Driver/ia64/libusb0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/ia64/libusb0.dll -------------------------------------------------------------------------------- /Drivers/DFU Driver/ia64/libusb0.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/ia64/libusb0.sys -------------------------------------------------------------------------------- /Drivers/DFU Driver/x86/libusb0.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/x86/libusb0.sys -------------------------------------------------------------------------------- /Drivers/DFU Driver/x86/libusb0_x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Drivers/DFU Driver/x86/libusb0_x86.dll -------------------------------------------------------------------------------- /Drivers/install_udev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # simple script to install and refreash the udev rules. 3 | # 4 | sudo cp -rf driver/98-ChameleonMini.rules /etc/udev/rules.d/98-ChameleonMini.rules 5 | sudo udevadm control --reload-rules 6 | 7 | if [ -f "/etc/arch-release" ]; then #If user is running ArchLinux 8 | sudo usermod -aG uucp $(USER) #Use specific command and group 9 | else 10 | sudo adduser $(USER) dialout 11 | fi -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/.gitignore: -------------------------------------------------------------------------------- 1 | # Chameleon specific 2 | 3 | # Generic C files 4 | *.d 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | *.ilk 10 | *.map 11 | *.exp 12 | *.gch 13 | *.pch 14 | *.lib 15 | *.a 16 | *.la 17 | *.lo 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | *.exe 23 | *.out 24 | *.app 25 | *.i*86 26 | *.x86_64 27 | *.hex 28 | *.dSYM/ 29 | *.su 30 | *.idb 31 | *.pdb 32 | 33 | # Atmel Studio and IAR AVR 34 | [Dd]ebug/ 35 | [Rr]elease/ 36 | Obj/ 37 | List/ 38 | Exe/ 39 | settings/ 40 | *.o 41 | *.d 42 | *.eep 43 | *.elf 44 | *.hex 45 | *.map 46 | *.srec 47 | *.atsuo 48 | *.dep 49 | *.ewt 50 | *.dbg 51 | *.crun 52 | *.dbgdt 53 | *.cspy 54 | *.cspy.* 55 | *.dni 56 | *.wsdt 57 | *.wspos 58 | *.sim 59 | *.pbd 60 | *.pbd.* 61 | *.pbi 62 | *.pbi.* 63 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/ASF-License.txt: -------------------------------------------------------------------------------- 1 | * Redistribution and use in source and binary forms, with or without 2 | * modification, are permitted provided that the following conditions are met: 3 | * 4 | * 1. Redistributions of source code must retain the above copyright notice, 5 | * this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, 8 | * this list of conditions and the following disclaimer in the documentation 9 | * and/or other materials provided with the distribution. 10 | * 11 | * 3. The name of Atmel may not be used to endorse or promote products derived 12 | * from this software without specific prior written permission. 13 | * 14 | * 4. This software may only be redistributed and used in connection with an 15 | * Atmel microcontroller product. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 21 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 26 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/README.md: -------------------------------------------------------------------------------- 1 | # Atmel ATxmega32A4U DFU USB bootloader source with changed default ISP I/O pining 2 | 3 | See [Wiki](https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Reference-RevE-Bootloader) for more information. 4 | 5 | This must be compiled with [IAR AVR Workbench](https://www.iar.com/iar-embedded-workbench/#!?architecture=AVR). 6 | 7 | The project workspace can be found in `common/services/usb/class/dfu_flip/device/bootloader/xmega/atxmega32a4u/iar/`. 8 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/isp/flip/flip_protocol.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Firmware/Atmel-DFU-Bootloader/common/services/isp/flip/flip_protocol.h -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/usb/class/dfu_flip/device/bootloader/xmega/atxmega32a4u/iar/xmega_small.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $WS_DIR$\xmega_small.ewp 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/usb/class/dfu_flip/device/bootloader/xmega/conf/conf_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Board configuration 5 | * 6 | * Copyright (c) 2011 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef CONF_BOARD_H_INCLUDED 45 | #define CONF_BOARD_H_INCLUDED 46 | 47 | #endif /* CONF_BOARD_H_INCLUDED */ 48 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/usb/class/dfu_flip/device/bootloader/xmega/conf/conf_clock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Chip-specific system clock manager configuration 5 | * 6 | * Copyright (c) 2011-2012 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | #ifndef CONF_CLOCK_H_INCLUDED 44 | #define CONF_CLOCK_H_INCLUDED 45 | 46 | //! Configuration using On-Chip RC oscillator at 48MHz 47 | //! The RC oscillator is calibrated via USB Start Of Frame 48 | //! Clk USB = 48MHz (used by USB) 49 | //! Clk sys = 48MHz 50 | //! Clk cpu/per = 24MHz 51 | #define CONFIG_USBCLK_SOURCE USBCLK_SRC_RCOSC 52 | #define CONFIG_OSC_RC32_CAL 48000000UL 53 | 54 | #define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_USBSOF 55 | 56 | #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC32MHZ 57 | #define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_2 58 | #define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 59 | 60 | 61 | #endif /* CONF_CLOCK_H_INCLUDED */ 62 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/usb/class/dfu_flip/device/bootloader/xmega/main.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Main functions 5 | * 6 | * Copyright (c) 2011 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _MAIN_H_ 45 | #define _MAIN_H_ 46 | 47 | #endif // _MAIN_H_ 48 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/common/services/usb/class/dfu_flip/device/udi_dfu_atmel_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Default Atmel DFU configuration for a USB Device 5 | * with a single interface Atmel DFU 6 | * 7 | * Copyright (c) 2011-2012 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * 4. This software may only be redistributed and used in connection with an 27 | * Atmel microcontroller product. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | * \asf_license_stop 42 | * 43 | */ 44 | 45 | #ifndef _UDI_DFU_ATMEL_CONF_H_ 46 | #define _UDI_DFU_ATMEL_CONF_H_ 47 | 48 | #include "conf_usb.h" 49 | #include "flip_protocol.h" 50 | 51 | /** 52 | * \addtogroup udi_dfu_atmel_group_single_desc 53 | * @{ 54 | */ 55 | 56 | //! Control endpoint size 57 | #if (FLIP_PROTOCOL_VERSION == FLIP_PROTOCOL_VERSION_2) 58 | #define USB_DEVICE_EP_CTRL_SIZE 64 59 | #else 60 | #define USB_DEVICE_EP_CTRL_SIZE 32 61 | #endif 62 | 63 | //! Interface number 64 | #define UDI_DFU_ATMEL_IFACE_NUMBER 0 65 | 66 | /** 67 | * \name UDD Configuration 68 | */ 69 | //@{ 70 | //! 0 endpoints used by DFU interface 71 | #define USB_DEVICE_MAX_EP 0 72 | //@} 73 | 74 | //@} 75 | 76 | #endif // _UDI_DFU_ATMEL_CONF_H_ 77 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/xmega/boards/dummy/dummy_board.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * \file 4 | * 5 | * \brief Dummy board header file. 6 | * 7 | * This file contains empty definitions to support board-independant applications (e.g. bootloader) 8 | * 9 | * To use this board, define BOARD=DUMMY_BOARD. 10 | * 11 | * Copyright (c) 2010 Atmel Corporation. All rights reserved. 12 | * 13 | * \asf_license_start 14 | * 15 | * \page License 16 | * 17 | * Redistribution and use in source and binary forms, with or without 18 | * modification, are permitted provided that the following conditions are met: 19 | * 20 | * 1. Redistributions of source code must retain the above copyright notice, 21 | * this list of conditions and the following disclaimer. 22 | * 23 | * 2. Redistributions in binary form must reproduce the above copyright notice, 24 | * this list of conditions and the following disclaimer in the documentation 25 | * and/or other materials provided with the distribution. 26 | * 27 | * 3. The name of Atmel may not be used to endorse or promote products derived 28 | * from this software without specific prior written permission. 29 | * 30 | * 4. This software may only be redistributed and used in connection with an 31 | * Atmel microcontroller product. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 34 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 35 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 36 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 37 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 38 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 39 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 40 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 41 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 42 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 43 | * POSSIBILITY OF SUCH DAMAGE. 44 | * 45 | * \asf_license_stop 46 | * 47 | ******************************************************************************/ 48 | 49 | 50 | #ifndef _DUMMY_BOARD_H_ 51 | #define _DUMMY_BOARD_H_ 52 | 53 | #endif // _DUMMY_BOARD_H_ 54 | -------------------------------------------------------------------------------- /Firmware/Atmel-DFU-Bootloader/xmega/utils/preprocessor/preprocessor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Preprocessor utils. 5 | * 6 | * Copyright (c) 2009 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | #ifndef _PREPROCESSOR_H_ 44 | #define _PREPROCESSOR_H_ 45 | 46 | #include "tpaste.h" 47 | #include "stringz.h" 48 | #include "mrepeat.h" 49 | 50 | 51 | #endif // _PREPROCESSOR_H_ 52 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/AntennaLevel.c: -------------------------------------------------------------------------------- 1 | #include "AntennaLevel.h" 2 | #include "Application/Application.h" 3 | 4 | void AntennaLevelInit(void) { 5 | ADCA.CTRLA = ADC_ENABLE_bm; 6 | ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc; 7 | ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm; 8 | ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc; 9 | ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc; 10 | ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN7_gc; 11 | } 12 | 13 | uint16_t AntennaLevelGet(void) { 14 | ADCA.CH0.CTRL |= ADC_CH_START_bm; 15 | while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) ); 16 | 17 | ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm; 18 | 19 | int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET; 20 | if (Result < 0) Result = 0; 21 | 22 | return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR); 23 | } 24 | 25 | void AntennaLevelTick(void) { 26 | uint16_t rssi = AntennaLevelGet(); 27 | 28 | // UidSize != 0 implies that we are emulating right now 29 | if( (rssi < ANTENNA_FIELD_MIN_RSSI) && (ActiveConfiguration.UidSize != 0) ) { 30 | ApplicationReset(); // reset the application just like a real card gets reset when there is no field 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/AntennaLevel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Firmware/ChameleonMini/AntennaLevel.h -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Application/Application.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Application.h 3 | * 4 | * Created on: 18.02.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef APPLICATION_H_ 9 | #define APPLICATION_H_ 10 | 11 | #include "../Common.h" 12 | #include "../Configuration.h" 13 | 14 | /* Applications */ 15 | #include "MifareClassic.h" 16 | #include "MifareUltralight.h" 17 | #include "NTAG21x.h" 18 | /* Function wrappers */ 19 | INLINE void ApplicationInit(void) { 20 | ActiveConfiguration.ApplicationInitFunc(); 21 | } 22 | 23 | INLINE void ApplicationTask(void) { 24 | ActiveConfiguration.ApplicationTaskFunc(); 25 | } 26 | 27 | INLINE void ApplicationTick(void) { 28 | ActiveConfiguration.ApplicationTickFunc(); 29 | } 30 | 31 | INLINE void ApplicationButton(void) { 32 | ActiveConfiguration.ApplicationButtonFunc(); 33 | } 34 | 35 | INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { 36 | return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); 37 | } 38 | 39 | INLINE void ApplicationReset(void) { 40 | ActiveConfiguration.ApplicationResetFunc(); 41 | } 42 | 43 | INLINE void ApplicationGetUid(ConfigurationUidType Uid) { 44 | ActiveConfiguration.ApplicationGetUidFunc(Uid); 45 | } 46 | 47 | INLINE void ApplicationSetUid(ConfigurationUidType Uid) { 48 | ActiveConfiguration.ApplicationSetUidFunc(Uid); 49 | //LogEntry(LOG_INFO_UID_SET, Uid, ActiveConfiguration.UidSize); 50 | } 51 | 52 | INLINE void ApplicationGetSak(uint8_t * Sak) { 53 | ActiveConfiguration.ApplicationGetSakFunc(Sak); 54 | } 55 | 56 | INLINE void ApplicationSetSak(uint8_t Sak) { 57 | ActiveConfiguration.ApplicationSetSakFunc(Sak); 58 | } 59 | 60 | INLINE void ApplicationGetAtqa(uint16_t * Atqa) { 61 | ActiveConfiguration.ApplicationGetAtqaFunc(Atqa); 62 | } 63 | 64 | INLINE void ApplicationSetAtqa(uint16_t Atqa) { 65 | ActiveConfiguration.ApplicationSetAtqaFunc(Atqa); 66 | } 67 | 68 | #endif /* APPLICATION_H_ */ 69 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Application/Crypto1.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTO1_H 2 | #define CRYPTO1_H 3 | 4 | #include 5 | #include 6 | 7 | /* Set up Crypto1 cipher using the given Key, Uid and CardNonce. Also encrypts 8 | * the CardNonce in-place while in non-linear mode. 9 | * If CardNonceParity is not null, saves parity for nested authentication */ 10 | void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4], uint8_t CardNonceParity[4]); 11 | 12 | 13 | /* Load the decrypted ReaderNonce into the Crypto1 state LFSR */ 14 | void Crypto1Auth(uint8_t EncryptedReaderNonce[4]); 15 | 16 | /* Generate 8 Bits of key stream */ 17 | uint8_t Crypto1Byte(void); 18 | 19 | /* Generate 4 Bits of key stream */ 20 | uint8_t Crypto1Nibble(void); 21 | 22 | /* Execute 'ClockCount' cycles on the PRNG state 'State' */ 23 | void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount); 24 | 25 | uint8_t Crypto1FilterOutput(void); 26 | 27 | #endif //CRYPTO1_H 28 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Application/ISO14443-3A.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ISO14443-2A.h 3 | * 4 | * Created on: 19.03.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef ISO14443_3A_H_ 9 | #define ISO14443_3A_H_ 10 | 11 | #include "../Common.h" 12 | #include 13 | 14 | #define ISO14443A_UID_SIZE_SINGLE 4 /* bytes */ 15 | #define ISO14443A_UID_SIZE_DOUBLE 7 16 | #define ISO14443A_UID_SIZE_TRIPLE 10 17 | 18 | #define ISO14443A_CMD_REQA 0x26 19 | #define ISO14443A_CMD_WUPA 0x52 20 | #define ISO14443A_CMD_SELECT_CL1 0x93 21 | #define ISO14443A_CMD_SELECT_CL2 0x95 22 | #define ISO14443A_CMD_SELECT_CL3 0x97 23 | #define ISO14443A_CMD_HLTA 0x50 24 | 25 | #define ISO14443A_NVB_AC_START 0x20 26 | #define ISO14443A_NVB_AC_END 0x70 27 | 28 | #define ISO14443A_CL_UID_OFFSET 0 29 | #define ISO14443A_CL_UID_SIZE 4 30 | #define ISO14443A_CL_BCC_OFFSET 4 31 | #define ISO14443A_CL_BCC_SIZE 1 /* Byte */ 32 | #define ISO14443A_CL_FRAME_SIZE ((ISO14443A_CL_UID_SIZE + ISO14443A_CL_BCC_SIZE) * 8) /* UID[N...N+3] || BCCN */ 33 | #define ISO14443A_SAK_INCOMPLETE 0x04 34 | #define ISO14443A_SAK_COMPLETE_COMPLIANT 0x20 35 | #define ISO14443A_SAK_COMPLETE_NOT_COMPLIANT 0x00 36 | 37 | #define ISO14443A_ATQA_FRAME_SIZE (2 * 8) /* Bit */ 38 | #define ISO14443A_SAK_FRAME_SIZE (3 * 8) /* Bit */ 39 | 40 | #define ISO14443A_UID0_RANDOM 0x08 41 | #define ISO14443A_UID0_CT 0x88 42 | 43 | #define ISO14443A_CRCA_SIZE 2 44 | 45 | #define ISO14443A_CALC_BCC(ByteBuffer) \ 46 | ( ByteBuffer[0] ^ ByteBuffer[1] ^ ByteBuffer[2] ^ ByteBuffer[3] ) 47 | 48 | void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount); 49 | bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount); 50 | bool ISO14443AIsWakeUp(uint8_t* Buffer, bool FromHalt); 51 | void ISO14443ASetWakeUpResponse(uint8_t* Buffer, uint16_t ATQAValue); 52 | bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt); 53 | bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Application/MifareUltralight.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MifareUltralight.h 3 | * 4 | * Created on: 20.03.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifdef CONFIG_MF_ULTRALIGHT_SUPPORT 9 | 10 | #ifndef MIFAREULTRALIGHT_H_ 11 | #define MIFAREULTRALIGHT_H_ 12 | 13 | #include "Application.h" 14 | #include "ISO14443-3A.h" 15 | 16 | #define MIFARE_ULTRALIGHT_UID_SIZE ISO14443A_UID_SIZE_DOUBLE 17 | #define MIFARE_ULTRALIGHT_PAGE_SIZE 4 18 | #define MIFARE_ULTRALIGHT_PAGES 16 19 | #define MIFARE_ULTRALIGHT_EV11_PAGES 20 20 | #define MIFARE_ULTRALIGHT_EV12_PAGES 41 21 | #define MIFARE_ULTRALIGHT_MEM_SIZE (MIFARE_ULTRALIGHT_PAGES * MIFARE_ULTRALIGHT_PAGE_SIZE) 22 | #define MIFARE_ULTRALIGHT_EV11_MEM_SIZE (MIFARE_ULTRALIGHT_EV11_PAGES * MIFARE_ULTRALIGHT_PAGE_SIZE) 23 | #define MIFARE_ULTRALIGHT_EV12_MEM_SIZE (MIFARE_ULTRALIGHT_EV12_PAGES * MIFARE_ULTRALIGHT_PAGE_SIZE) 24 | #define MIFARE_ULTRALIGHT_PWD_ADDRESS 0 // In working memory 25 | #define MIFARE_ULTRALIGHT_PWD_SIZE 4 // Bytes 26 | 27 | void MifareUltralightAppInit(void); 28 | void MifareUltralightEV11AppInit(void); 29 | void MifareUltralightEV12AppInit(void); 30 | void MifareUltralightAppReset(void); 31 | 32 | uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount); 33 | 34 | void MifareUltralightGetUid(ConfigurationUidType Uid); 35 | void MifareUltralightSetUid(ConfigurationUidType Uid); 36 | 37 | void MifareUltralightGetAtqa(uint16_t * Atqa); 38 | void MifareUltralightSetAtqa(uint16_t Atqa); 39 | void MifareUltralightGetSak(uint8_t * Sak); 40 | void MifareUltralightSetSak(uint8_t Sak); 41 | 42 | #endif /* MIFAREULTRALIGHT_H_ */ 43 | 44 | #endif /* Compilation support */ 45 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Application/NTAG21x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NTAG21x.h 3 | * 4 | * Created on: 20.02.2019 5 | * Author: gcammisa 6 | */ 7 | 8 | #if ((defined CONFIG_NTAG213_SUPPORT) || (defined CONFIG_NTAG215_SUPPORT) || (defined CONFIG_NTAG216_SUPPORT)) 9 | 10 | #ifndef NTAG21x_H_ 11 | #define NTAG21x_H_ 12 | #include "Application.h" 13 | #include "ISO14443-3A.h" 14 | 15 | #define NTAG21x_UID_SIZE ISO14443A_UID_SIZE_DOUBLE //7 bytes UID 16 | 17 | #define NTAG21x_PAGE_SIZE 4 //bytes per page 18 | #define NTAG213_PAGES 45 //45 pages total for ntag213, from 0 to 44 19 | #define NTAG215_PAGES 135 //135 pages total for ntag215, from 0 to 134 20 | #define NTAG216_PAGES 231 //231 pages total for ntag216, from 0 to 230 21 | 22 | #define NTAG213_MEM_SIZE ( NTAG21x_PAGE_SIZE * NTAG213_PAGES ) 23 | #define NTAG215_MEM_SIZE ( NTAG21x_PAGE_SIZE * NTAG215_PAGES ) 24 | #define NTAG216_MEM_SIZE ( NTAG21x_PAGE_SIZE * NTAG216_PAGES ) 25 | 26 | void NTAG213AppInit(void); 27 | /* void NTAG213AppReset(void); */ 28 | 29 | void NTAG215AppInit(void); 30 | /* void NTAG215AppReset(void); */ 31 | 32 | void NTAG216AppInit(void); 33 | /* void NTAG216AppReset(void); */ 34 | void NTAG21xAppReset(void); 35 | 36 | uint16_t NTAG21xAppProcess(uint8_t *Buffer, uint16_t BitCount); 37 | /* uint16_t NTAG213AppProcess(uint8_t *Buffer, uint16_t BitCount); */ 38 | /* uint16_t NTAG215AppProcess(uint8_t *Buffer, uint16_t BitCount); */ 39 | /* uint16_t NTAG216AppProcess(uint8_t *Buffer, uint16_t BitCount); */ 40 | 41 | void NTAG21xGetUid(ConfigurationUidType Uid); 42 | void NTAG21xSetUid(ConfigurationUidType Uid); 43 | 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Button.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Button.h 3 | * 4 | * Created on: 13.05.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef BUTTON_H_ 9 | #define BUTTON_H_ 10 | 11 | #include "Common.h" 12 | #include "Application/Application.h" 13 | 14 | #define BUTTON_PORT PORTA 15 | #define BUTTON_MASK PIN6_bm 16 | #define BUTTON_PINCTRL PIN6CTRL 17 | 18 | #define BUTTON_NAME_MAX_LEN 20 19 | #define BUTTON_LONG_PRESS_TICK_COUNT 10 20 | 21 | typedef enum { 22 | BUTTON_ACTION_NONE, 23 | BUTTON_ACTION_UID_RANDOM, 24 | BUTTON_ACTION_UID_LEFT_INCREMENT, 25 | BUTTON_ACTION_UID_RIGHT_INCREMENT, 26 | BUTTON_ACTION_UID_LEFT_DECREMENT, 27 | BUTTON_ACTION_UID_RIGHT_DECREMENT, 28 | BUTTON_ACTION_CYCLE_SETTINGS, 29 | BUTTON_ACTION_TOGGLE_READONLY, 30 | BUTTON_ACTION_FUNCTION, 31 | /* This has to be last element */ 32 | BUTTON_ACTION_COUNT 33 | } ButtonActionEnum; 34 | 35 | typedef enum { 36 | BUTTON_PRESS_SHORT, 37 | BUTTON_PRESS_LONG 38 | } ButtonTypeEnum; 39 | 40 | void ButtonInit(void); 41 | void ButtonTick(void); 42 | 43 | void ButtonGetActionList(char* ListOut, uint16_t BufferSize); 44 | void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action); 45 | void ButtonGetActionByName(ButtonTypeEnum Type, char* ActionOut, uint16_t BufferSize); 46 | bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action); 47 | 48 | #endif /* BUTTON_H_ */ 49 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/ChameleonMini.c: -------------------------------------------------------------------------------- 1 | #include "ChameleonMini.h" 2 | 3 | int main(void) { 4 | SystemInit(); 5 | MemoryInit(); 6 | SettingsLoad(); 7 | LEDInit(); 8 | ConfigurationInit(); 9 | TerminalInit(); 10 | RandomInit(); 11 | ButtonInit(); 12 | AntennaLevelInit(); 13 | SystemInterruptInit(); 14 | 15 | while(1) { 16 | if (SystemTick100ms()) { 17 | LEDTick(); 18 | RandomTick(); 19 | TerminalTick(); 20 | ButtonTick(); 21 | ApplicationTick(); 22 | //CommandLineTick(); 23 | //AntennaLevelTick(); 24 | } 25 | TerminalTask(); 26 | CodecTask(); 27 | //ApplicationTask(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/ChameleonMini.componentinfo.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/ChameleonMini.h: -------------------------------------------------------------------------------- 1 | #ifndef CHAMELEON_MINI_H 2 | #define CHAMELEON_MINI_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "System.h" 10 | #include "Memory/Memory.h" 11 | #include "LED.h" 12 | #include "Terminal/Terminal.h" 13 | #include "Codec/Codec.h" 14 | #include "Application/Application.h" 15 | #include "Configuration.h" 16 | #include "Random.h" 17 | #include "Button.h" 18 | #include "AntennaLevel.h" 19 | #include "Settings.h" 20 | 21 | #endif //CHAMELEON_MINI_H 22 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Codec/Codec.c: -------------------------------------------------------------------------------- 1 | #include "Codec.h" 2 | 3 | uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; 4 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Codec/Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef CODEC_H_ 2 | #define CODEC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../Common.h" 8 | #include "../Configuration.h" 9 | 10 | #include "ISO14443-2A.h" 11 | 12 | #define CODEC_DEMOD_POWER_PORT PORTB 13 | #define CODEC_DEMOD_POWER_MASK PIN1_bm 14 | #define CODEC_DEMOD_IN_PORT PORTB 15 | #define CODEC_DEMOD_IN_MASK (CODEC_DEMOD_IN_MASK0 | CODEC_DEMOD_IN_MASK1) 16 | #define CODEC_DEMOD_IN_MASK0 PIN0_bm 17 | #define CODEC_DEMOD_IN_MASK1 PIN2_bm 18 | #define CODEC_DEMOD_IN_PINCTRL0 PIN0CTRL 19 | #define CODEC_DEMOD_IN_PINCTRL1 PIN2CTRL 20 | #define CODEC_DEMOD_IN_EVMUX0 EVSYS_CHMUX_PORTB_PIN0_gc 21 | #define CODEC_DEMOD_IN_EVMUX1 EVSYS_CHMUX_PORTB_PIN2_gc 22 | #define CODEC_DEMOD_IN_INT0_VECT PORTB_INT0_vect 23 | #define CODEC_LOADMOD_PORT PORTC 24 | #define CODEC_LOADMOD_MASK PIN6_bm 25 | #define CODEC_CARRIER_IN_PORT PORTC 26 | #define CODEC_CARRIER_IN_MASK PIN2_bm 27 | #define CODEC_CARRIER_IN_PINCTRL PIN2CTRL 28 | #define CODEC_CARRIER_IN_EVMUX EVSYS_CHMUX_PORTC_PIN2_gc 29 | #define CODEC_SUBCARRIER_PORT PORTC 30 | #define CODEC_SUBCARRIER_MASK_PSK PIN0_bm 31 | #define CODEC_SUBCARRIER_MASK_OOK PIN1_bm 32 | #define CODEC_SUBCARRIER_MASK (CODEC_SUBCARRIER_MASK_PSK | CODEC_SUBCARRIER_MASK_OOK) 33 | #define CODEC_SUBCARRIER_TIMER TCC0 34 | #define CODEC_SUBCARRIER_CC_PSK CCA 35 | #define CODEC_SUBCARRIER_CC_OOK CCB 36 | #define CODEC_SUBCARRIER_CCEN_PSK TC0_CCAEN_bm 37 | #define CODEC_SUBCARRIER_CCEN_OOK TC0_CCBEN_bm 38 | #define CODEC_TIMER_SAMPLING TCC1 39 | #define CODEC_TIMER_SAMPLING_CCA_VECT TCC1_CCA_vect 40 | #define CODEC_TIMER_LOADMOD TCD1 41 | #define CODEC_TIMER_OVF_VECT TCD1_OVF_vect 42 | 43 | #define CODEC_BUFFER_SIZE 256 /* Byte */ 44 | 45 | #define CODEC_CARRIER_FREQ 13560000 46 | 47 | extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; 48 | 49 | INLINE void CodecInit(void) { 50 | ActiveConfiguration.CodecInitFunc(); 51 | } 52 | 53 | INLINE void CodecTask(void) { 54 | ActiveConfiguration.CodecTaskFunc(); 55 | } 56 | 57 | INLINE void CodecSetDemodPower(bool bOnOff) { 58 | CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; 59 | 60 | if (bOnOff) { 61 | CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; 62 | } else { 63 | CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK; 64 | } 65 | } 66 | 67 | #endif /* CODEC_H_ */ 68 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Codec/ISO14443-2A.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ISO14443-2A.h 3 | * 4 | * Created on: 18.02.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef ISO14443_2A_H_ 9 | #define ISO14443_2A_H_ 10 | 11 | #include "Codec.h" 12 | 13 | #define ISO14443A_APP_NO_RESPONSE 0x0000 14 | #define ISO14443A_APP_CUSTOM_PARITY 0x1000 15 | 16 | #define ISO14443A_BUFFER_PARITY_OFFSET (CODEC_BUFFER_SIZE/2) 17 | 18 | /* Codec Interface */ 19 | void ISO14443ACodecInit(void); 20 | void ISO14443ACodecTask(void); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common.h 3 | * 4 | * Created on: 20.03.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef COMMON_H_ 9 | #define COMMON_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #define ODD_PARITY(Value) OddParityBit(Value)//(parity_even_bit(Value) ? 0 : 1) 19 | 20 | #define INLINE \ 21 | static inline __attribute__((always_inline)) 22 | 23 | #define ARRAY_COUNT(x) \ 24 | (sizeof(x) / sizeof(x[0])) 25 | 26 | #define NIBBLE_TO_HEXCHAR(x) ( (x) < 0x0A ? (x) + '0' : (x) + 'A' - 0x0A ) 27 | #define HEXCHAR_TO_NIBBLE(x) ( (x) < 'A' ? (x) - '0' : (x) - 'A' + 0x0A ) 28 | #define VALID_HEXCHAR(x) ( ( (x) >= '0' && (x) <= '9' ) || ( (x) >= 'A' && (x) <= 'F' ) ) 29 | #define MIN(x,y) ( (x) < (y) ? (x) : (y) ) 30 | #define MAX(x,y) ( (x) > (y) ? (x) : (y) ) 31 | #define SYSTICK_DIFF(since) ((uint16_t) (SystemGetSysTick() - since)) 32 | #define SYSTICK_DIFF_100MS(since) (SYSTICK_DIFF(since) / 100) 33 | 34 | #define BITS_PER_BYTE 8 35 | 36 | uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount); 37 | uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn); 38 | 39 | INLINE uint8_t BitReverseByte(uint8_t Byte) 40 | { 41 | extern const uint8_t PROGMEM BitReverseByteTable[]; 42 | 43 | return pgm_read_byte(&BitReverseByteTable[Byte]); 44 | } 45 | 46 | INLINE uint8_t OddParityBit(uint8_t Byte) 47 | { 48 | extern const uint8_t PROGMEM OddParityByteTable[]; 49 | 50 | return pgm_read_byte(&OddParityByteTable[Byte]); 51 | } 52 | 53 | INLINE uint8_t StringLength(const char* Str, uint8_t MaxLen) 54 | { 55 | uint8_t StrLen = 0; 56 | 57 | while(MaxLen > 0) { 58 | if (*Str++ == '\0') 59 | break; 60 | 61 | MaxLen--; 62 | StrLen++; 63 | } 64 | 65 | return StrLen; 66 | } 67 | 68 | #endif /* COMMON_H_ */ 69 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LED.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "LED.h" 5 | #include "Settings.h" 6 | #include "Common.h" 7 | 8 | static const LedPining_t LEDPiningTable[] PROGMEM = { 9 | [LED_ONE] = { .ledPort = &LED_HIGH_PORT, .ledPin = PIN5_bm }, 10 | [LED_TWO] = { .ledPort = &LED_HIGH_PORT, .ledPin = PIN4_bm }, 11 | [LED_THREE] = { .ledPort = &LED_HIGH_PORT, .ledPin = PIN3_bm }, 12 | [LED_FOUR] = { .ledPort = &LED_HIGH_PORT, .ledPin = PIN2_bm }, 13 | [LED_FIVE] = { .ledPort = &LED_LOW_PORT, .ledPin = PIN3_bm }, 14 | [LED_SIX] = { .ledPort = &LED_LOW_PORT, .ledPin = PIN2_bm }, 15 | [LED_SEVEN] = { .ledPort = &LED_LOW_PORT, .ledPin = PIN1_bm }, 16 | [LED_EIGHT] = { .ledPort = &LED_LOW_PORT, .ledPin = PIN0_bm } 17 | }; 18 | 19 | INLINE void LEDAllOff(void) { 20 | LED_HIGH_PORT.OUTCLR = LED_HIGH_MASK; 21 | LED_LOW_PORT.OUTCLR = LED_LOW_MASK; 22 | } 23 | 24 | INLINE void LEDMode(void) { 25 | LEDAllOff(); 26 | LEDSetOn(GlobalSettings.ActiveSettingIdx); 27 | } 28 | 29 | void LEDTick(void) { 30 | LED_HIGH_PORT.OUTCLR = LED_LOW_PULSE_MASK; 31 | LED_LOW_PORT.OUTCLR = LED_HIGH_PULSE_MASK; 32 | LEDMode(); 33 | } 34 | 35 | void LEDInit(void) { 36 | LED_LOW_PORT.DIRSET = LED_LOW_MASK; 37 | LED_HIGH_PORT.DIRSET = LED_HIGH_MASK; 38 | } 39 | 40 | INLINE void LEDSet(Led LedId, bool on) { 41 | PORT_t * ledPort = ( (PORT_t *)pgm_read_ptr( &(LEDPiningTable[LedId].ledPort) ) ); 42 | uint8_t ledPin = ( (uint8_t)pgm_read_byte( &(LEDPiningTable[LedId].ledPin) ) ); 43 | (on) ? (ledPort->OUTSET = ledPin) : (ledPort->OUTCLR = ledPin); 44 | } 45 | 46 | void LEDSetOn(Led LedId) { 47 | LEDSet(LedId, true); 48 | } 49 | void LEDSetOff(Led LedId) { 50 | LEDSet(LedId, false); 51 | } 52 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LED.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LED.h 3 | * 4 | * Created on: 10.02.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef _CM_LED_H_ 9 | #define _CM_LED_H_ 10 | 11 | #include 12 | 13 | #define LED_HIGH_PORT PORTA 14 | #define LED_HIGH_MASK (PIN5_bm | PIN4_bm | PIN3_bm | PIN2_bm) 15 | #define LED_LOW_PORT PORTE 16 | #define LED_LOW_MASK (PIN3_bm | PIN2_bm | PIN1_bm | PIN0_bm) 17 | #define LED_LOW_PULSE_MASK 0 18 | #define LED_HIGH_PULSE_MASK 0 19 | 20 | typedef enum { 21 | LED_ONE, 22 | LED_TWO, 23 | LED_THREE, 24 | LED_FOUR, 25 | LED_FIVE, 26 | LED_SIX, 27 | LED_SEVEN, 28 | LED_EIGHT 29 | } Led; 30 | 31 | typedef struct { 32 | PORT_t * ledPort; 33 | uint8_t ledPin; 34 | } LedPining_t; 35 | 36 | void LEDInit(void); 37 | void LEDTick(void); 38 | void LEDSetOn(Led LedId); 39 | void LEDSetOff(Led LedId); 40 | 41 | #endif /* _CM_LED_H_ */ 42 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/.gitignore: -------------------------------------------------------------------------------- 1 | *.lss 2 | *.bin 3 | *.elf 4 | *.hex 5 | *.eep 6 | *.map 7 | *.o 8 | *.d 9 | *.sym 10 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c: -------------------------------------------------------------------------------- 1 | /* 2 | DMBS Build System 3 | Released into the public domain. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | /** \file 10 | * 11 | * Special application to extract an EEPROM image stored in FLASH memory, and 12 | * copy it to the device EEPROM. This application is designed to be used with 13 | * the HID build system module of DMBS to program the EEPROM of a target device 14 | * that uses the HID bootloader protocol, which does not have native EEPROM 15 | * programming support. 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | /* References to the binary EEPROM data linked in the AVR's FLASH memory space */ 23 | extern const char _binary_InputEEData_bin_start[]; 24 | extern const char _binary_InputEEData_bin_end[]; 25 | extern const char _binary_InputEEData_bin_size[]; 26 | 27 | /* Friendly names for the embedded binary data stored in FLASH memory space */ 28 | #define InputEEData _binary_InputEEData_bin_start 29 | #define InputEEData_size ((int)_binary_InputEEData_bin_size) 30 | 31 | int main(void) 32 | { 33 | /* Copy out the embedded EEPROM data from FLASH to EEPROM memory space */ 34 | for (uint16_t i = 0; i < InputEEData_size; i++) 35 | eeprom_update_byte((uint8_t*)i, pgm_read_byte(&InputEEData[i])); 36 | 37 | /* Infinite loop once complete */ 38 | for (;;); 39 | } 40 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | # Run "make help" for target help. 10 | 11 | MCU = atmega128 12 | ARCH = AVR8 13 | F_CPU = 1000000 14 | OPTIMIZATION = s 15 | TARGET = HID_EEPROM_Loader 16 | SRC = $(TARGET).c 17 | CC_FLAGS = 18 | LD_FLAGS = 19 | OBJECT_FILES = InputEEData.o 20 | 21 | # Default target 22 | all: 23 | 24 | # Determine the AVR sub-architecture of the build main application object file 25 | FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) 26 | 27 | # Create a linkable object file with the input binary EEPROM data stored in the FLASH section 28 | InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) 29 | @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" 30 | avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ 31 | 32 | # Include LUFA build script makefiles 33 | include ../core.mk 34 | include ../gcc.mk 35 | include ../hid.mk 36 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/License.txt: -------------------------------------------------------------------------------- 1 | DMBS Build System 2 | Released into the public domain. 3 | 4 | dean [at] fourwalledcubicle [dot] com 5 | www.fourwalledcubicle.com 6 | 7 | 8 | 9 | This is free and unencumbered software released into the public domain. 10 | 11 | Anyone is free to copy, modify, publish, use, compile, sell, or 12 | distribute this software, either in source code form or as a compiled 13 | binary, for any purpose, commercial or non-commercial, and by any 14 | means. 15 | 16 | In jurisdictions that recognize copyright laws, the author or authors 17 | of this software dedicate any and all copyright interest in the 18 | software to the public domain. We make this dedication for the benefit 19 | of the public at large and to the detriment of our heirs and 20 | successors. We intend this dedication to be an overt act of 21 | relinquishment in perpetuity of all present and future rights to this 22 | software under copyright law. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 28 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 29 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | OTHER DEALINGS IN THE SOFTWARE. 31 | 32 | For more information, please refer to 33 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/ModulesOverview.md: -------------------------------------------------------------------------------- 1 | DMBS - Dean's Makefile Build System 2 | =================================== 3 | 4 | 5 | Modules Overview 6 | ---------------- 7 | 8 | The following modules are currently included: 9 | 10 | - [ATPROGRAM](atprogram.md) - Device Programming 11 | - [AVRDUDE](avrdude.md) - Device Programming 12 | - [CORE](core.md) - DMBS Core Functionality 13 | - [CPPCHECK](cppcheck.md) - Static Code Analysis 14 | - [DFU](dfu.md) - Device Programming 15 | - [DOXYGEN](doxygen.md) - Automated Source Code Documentation 16 | - [GCC](gcc.md) - Compiling/Assembling/Linking with GCC 17 | - [HID](hid.md) - Device Programming 18 | 19 | ## Importing modules into your project makefile 20 | 21 | To use a module, it is recommended to add the following boilerplate to your 22 | makefile: 23 | 24 | # Include DMBS build script makefiles 25 | DMBS_PATH ?= ../DMBS 26 | 27 | Which can then used to indicate the location of your DMBS installation, relative 28 | to the current directory, when importing modules. For example: 29 | 30 | DMBS_PATH ?= ../DMBS 31 | include $(DMBS_PATH)/core.mk 32 | include $(DMBS_PATH)/gcc.mk 33 | 34 | Imports the `CORE` and `GCC` modules from DMBS using a single path relative to 35 | your project's makefile. 36 | 37 | If you wish to write your own DMBS module(s), 38 | [see the documentation here for more details.](WritingYourOwnModules.md) 39 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/atprogram.mk: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | DMBS_BUILD_MODULES += ATPROGRAM 10 | DMBS_BUILD_TARGETS += atprogram atprogram-ee 11 | DMBS_BUILD_MANDATORY_VARS += MCU TARGET 12 | DMBS_BUILD_OPTIONAL_VARS += ATPROGRAM_PROGRAMMER ATPROGRAM_INTERFACE ATPROGRAM_PORT 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | # Conditionally import the CORE module of DMBS if it is not already imported 17 | DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 18 | ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) 19 | include $(DMBS_MODULE_PATH)/core.mk 20 | endif 21 | 22 | # Default values of optionally user-supplied variables 23 | ATPROGRAM_PROGRAMMER ?= atmelice 24 | ATPROGRAM_INTERFACE ?= jtag 25 | ATPROGRAM_PORT ?= 26 | 27 | # Sanity check user supplied values 28 | $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) 29 | $(call ERROR_IF_EMPTY, MCU) 30 | $(call ERROR_IF_EMPTY, TARGET) 31 | $(call ERROR_IF_EMPTY, ATPROGRAM_PROGRAMMER) 32 | $(call ERROR_IF_EMPTY, ATPROGRAM_INTERFACE) 33 | 34 | # Output Messages 35 | MSG_ATPROGRAM_CMD := ' [ATPRGRM] :' 36 | 37 | # Construct base atprogram command flags 38 | BASE_ATPROGRAM_FLAGS := --tool $(ATPROGRAM_PROGRAMMER) --interface $(ATPROGRAM_INTERFACE) --device $(MCU) 39 | ifneq ($(ATPROGRAM_PORT),) 40 | BASE_ATPROGRAM_FLAGS += --port $(ATPROGRAM_PORT) 41 | endif 42 | 43 | # Construct the flags to use for the various memory spaces 44 | ifeq ($(ARCH), AVR8) 45 | ATPROGRAM_FLASH_FLAGS := --chiperase --flash 46 | ATPROGRAM_EEPROM_FLAGS := --eeprom 47 | else ifeq ($(ARCH), XMEGA) 48 | ATPROGRAM_FLASH_FLAGS := --erase --flash 49 | ATPROGRAM_EEPROM_FLAGS := --eeprom 50 | else ifeq ($(ARCH), UC3) 51 | ATPROGRAM_FLASH_FLAGS := --erase 52 | ATPROGRAM_EEPROM_FLAGS := --eeprom 53 | else 54 | $(error Unsupported architecture "$(ARCH)") 55 | endif 56 | 57 | # Programs in the target FLASH memory using ATPROGRAM 58 | atprogram: $(TARGET).elf $(MAKEFILE_LIST) 59 | @echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" FLASH using \"$(ATPROGRAM_PROGRAMMER)\" 60 | atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_FLASH_FLAGS) --file $< 61 | 62 | # Programs in the target EEPROM memory using ATPROGRAM 63 | atprogram-ee: $(TARGET).elf $(MAKEFILE_LIST) 64 | @echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" EEPROM using \"$(ATPROGRAM_PROGRAMMER)\" 65 | atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_EEPROM_FLAGS) --file $< 66 | 67 | # Phony build targets for this module 68 | .PHONY: $(DMBS_BUILD_TARGETS) 69 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/avrdude.mk: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | DMBS_BUILD_MODULES += AVRDUDE 10 | DMBS_BUILD_TARGETS += avrdude avrdude-ee 11 | DMBS_BUILD_MANDATORY_VARS += MCU TARGET 12 | DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS AVRDUDE_MEMORY 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | # Conditionally import the CORE module of DMBS if it is not already imported 17 | DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 18 | ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) 19 | include $(DMBS_MODULE_PATH)/core.mk 20 | endif 21 | 22 | # Default values of optionally user-supplied variables 23 | AVRDUDE_PROGRAMMER ?= jtagicemkii 24 | AVRDUDE_PORT ?= usb 25 | AVRDUDE_FLAGS ?= 26 | AVRDUDE_MEMORY ?= flash 27 | 28 | # Sanity check user supplied values 29 | $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) 30 | $(call ERROR_IF_EMPTY, MCU) 31 | $(call ERROR_IF_EMPTY, TARGET) 32 | $(call ERROR_IF_EMPTY, AVRDUDE_PROGRAMMER) 33 | $(call ERROR_IF_EMPTY, AVRDUDE_PORT) 34 | 35 | # Output Messages 36 | MSG_AVRDUDE_CMD := ' [AVRDUDE] :' 37 | 38 | # Construct base avrdude command flags 39 | BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) 40 | 41 | # Programs in the target FLASH memory using AVRDUDE 42 | avrdude: $(TARGET).hex $(MAKEFILE_LIST) 43 | @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" FLASH using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" 44 | avrdude $(BASE_AVRDUDE_FLAGS) -U $(AVRDUDE_MEMORY):w:$< $(AVRDUDE_FLAGS) 45 | 46 | # Programs in the target EEPROM memory using AVRDUDE 47 | avrdude-ee: $(TARGET).eep $(MAKEFILE_LIST) 48 | @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" EEPROM using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" 49 | avrdude $(BASE_AVRDUDE_FLAGS) -U eeprom:w:$< $(AVRDUDE_FLAGS) 50 | 51 | # Phony build targets for this module 52 | .PHONY: $(DMBS_BUILD_TARGETS) 53 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/dfu.mk: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | DMBS_BUILD_MODULES += DFU 10 | DMBS_BUILD_TARGETS += flip flip-ee dfu dfu-ee 11 | DMBS_BUILD_MANDATORY_VARS += MCU TARGET 12 | DMBS_BUILD_OPTIONAL_VARS += 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | # Conditionally import the CORE module of DMBS if it is not already imported 17 | DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 18 | ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) 19 | include $(DMBS_MODULE_PATH)/core.mk 20 | endif 21 | 22 | # Sanity-check values of mandatory user-supplied variables 23 | $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) 24 | $(call ERROR_IF_EMPTY, MCU) 25 | $(call ERROR_IF_EMPTY, TARGET) 26 | 27 | # Output Messages 28 | MSG_COPY_CMD := ' [CP] :' 29 | MSG_REMOVE_CMD := ' [RM] :' 30 | MSG_DFU_CMD := ' [DFU] :' 31 | 32 | # Programs in the target FLASH memory using BATCHISP, the command line tool used by FLIP 33 | flip: $(TARGET).hex $(MAKEFILE_LIST) 34 | @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$<\" 35 | batchisp -hardware usb -device $(MCU) -operation erase f loadbuffer $< program 36 | batchisp -hardware usb -device $(MCU) -operation start reset 0 37 | 38 | # Programs in the target EEPROM memory using BATCHISP, the command line tool used by FLIP 39 | flip-ee: $(TARGET).eep $(MAKEFILE_LIST) 40 | @echo $(MSG_COPY_CMD) Copying EEP file to temporary file \"$<.hex\" 41 | cp $< $<.hex 42 | @echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$<.hex\" 43 | batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $<.hex program 44 | batchisp -hardware usb -device $(MCU) -operation start reset 0 45 | @echo $(MSG_REMOVE_CMD) Removing temporary file \"$<.hex\" 46 | rm $<.hex 47 | 48 | # Programs in the target FLASH memory using DFU-PROGRAMMER 49 | dfu: $(TARGET).hex $(MAKEFILE_LIST) 50 | @echo $(MSG_DFU_CMD) Programming FLASH with dfu-programmer using \"$<\" 51 | dfu-programmer $(MCU) erase 52 | dfu-programmer $(MCU) flash $< 53 | dfu-programmer $(MCU) reset 54 | 55 | # Programs in the target EEPROM memory using DFU-PROGRAMMER 56 | dfu-ee: $(TARGET).eep $(MAKEFILE_LIST) 57 | @echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$<\" 58 | dfu-programmer $(MCU) flash --eeprom $< 59 | dfu-programmer $(MCU) reset 60 | 61 | # Phony build targets for this module 62 | .PHONY: $(DMBS_BUILD_TARGETS) 63 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/doxygen.mk: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | DMBS_BUILD_MODULES += DOXYGEN 10 | DMBS_BUILD_TARGETS += doxygen doxygen-upgrade doxygen-create 11 | DMBS_BUILD_MANDATORY_VARS += 12 | DMBS_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | # Conditionally import the CORE module of DMBS if it is not already imported 17 | DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 18 | ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) 19 | include $(DMBS_MODULE_PATH)/core.mk 20 | endif 21 | 22 | # Default values of optionally user-supplied variables 23 | DOXYGEN_CONF ?= doxyfile 24 | DOXYGEN_FAIL_ON_WARNING ?= Y 25 | DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES 26 | 27 | # Sanity check user supplied values 28 | $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) 29 | $(call ERROR_IF_EMPTY, DOXYGEN_CONF) 30 | $(call ERROR_IF_NONBOOL, DOXYGEN_FAIL_ON_WARNING) 31 | 32 | # Output Messages 33 | MSG_DOXYGEN_CMD := ' [DOXYGEN] :' 34 | 35 | # Determine Doxygen invocation command 36 | BASE_DOXYGEN_CMD := ( cat $(DOXYGEN_CONF) $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen - 37 | ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y) 38 | DOXYGEN_CMD := if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi; 39 | else 40 | DOXYGEN_CMD := $(BASE_DOXYGEN_CMD) 41 | endif 42 | 43 | # Error if the specified Doxygen configuration file does not exist 44 | $(DOXYGEN_CONF): 45 | $(error Doxygen configuration file $@ does not exist) 46 | 47 | # Builds the project documentation using the specified configuration file and the DOXYGEN tool 48 | doxygen: $(DOXYGEN_CONF) $(MAKEFILE_LIST) 49 | @echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\" 50 | $(DOXYGEN_CMD) 51 | 52 | # Upgrades an existing Doxygen configuration file to the latest Doxygen template, preserving settings 53 | doxygen-upgrade: $(DOXYGEN_CONF) $(MAKEFILE_LIST) 54 | @echo $(MSG_DOXYGEN_CMD) Upgrading configuration file \"$(DOXYGEN_CONF)\" with latest template 55 | doxygen -u $(DOXYGEN_CONF) > /dev/null 56 | 57 | # Creates a new Doxygen configuration file with the set file name 58 | doxygen-create: $(MAKEFILE_LIST) 59 | @echo $(MSG_DOXYGEN_CMD) Creating new configuration file \"$(DOXYGEN_CONF)\" with latest template 60 | doxygen -g $(DOXYGEN_CONF) > /dev/null 61 | 62 | 63 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/DMBS/hid.mk: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | DMBS_BUILD_MODULES += HID 10 | DMBS_BUILD_TARGETS += hid hid-ee teensy teensy-ee 11 | DMBS_BUILD_MANDATORY_VARS += MCU TARGET 12 | DMBS_BUILD_OPTIONAL_VARS += 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | # Conditionally import the CORE module of DMBS if it is not already imported 17 | DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 18 | ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) 19 | include $(DMBS_MODULE_PATH)/core.mk 20 | endif 21 | 22 | # Sanity-check values of mandatory user-supplied variables 23 | $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) 24 | $(call ERROR_IF_EMPTY, MCU) 25 | $(call ERROR_IF_EMPTY, TARGET) 26 | 27 | # Output Messages 28 | MSG_HID_BOOTLOADER_CMD := ' [HID] :' 29 | MSG_OBJCPY_CMD := ' [OBJCPY] :' 30 | MSG_MAKE_CMD := ' [MAKE] :' 31 | 32 | # Programs in the target FLASH memory using the HID_BOOTLOADER_CLI tool 33 | hid: $(TARGET).hex $(MAKEFILE_LIST) 34 | @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\" 35 | hid_bootloader_cli -mmcu=$(MCU) -v $< 36 | 37 | # Programs in the target EEPROM memory using the HID_BOOTLOADER_CLI tool (note: clears target FLASH memory) 38 | hid-ee: $(TARGET).eep $(MAKEFILE_LIST) 39 | @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\" 40 | avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin 41 | @echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\" 42 | $(MAKE) -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean hid 43 | 44 | # Programs in the target FLASH memory using the TEENSY_BOOTLOADER_CLI tool 45 | teensy: $(TARGET).hex $(MAKEFILE_LIST) 46 | @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\" 47 | teensy_loader_cli -mmcu=$(MCU) -v $< 48 | 49 | # Programs in the target EEPROM memory using the TEENSY_BOOTLOADER_CLI tool (note: clears target FLASH memory) 50 | teensy-ee: $(TARGET).hex $(MAKEFILE_LIST) 51 | @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\" 52 | avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin 53 | @echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\" 54 | $(MAKE) -s -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean teensy 55 | 56 | # Phony build targets for this module 57 | .PHONY: $(DMBS_BUILD_TARGETS) 58 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/Template/Template.c: -------------------------------------------------------------------------------- 1 | /* 2 | DMBS Build System 3 | Released into the public domain. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | int main(void) 10 | { 11 | // Application code here. 12 | } 13 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/DMBS/Template/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DMBS Build System 3 | # Released into the public domain. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.fourwalledcubicle.com 7 | # 8 | 9 | # Run "make help" for target help. 10 | 11 | MCU = atmega128 12 | ARCH = AVR8 13 | F_CPU = 8000000 14 | OPTIMIZATION = s 15 | TARGET = Template 16 | SRC = $(TARGET).c 17 | CC_FLAGS = 18 | LD_FLAGS = 19 | 20 | # Default target 21 | all: 22 | 23 | # Include DMBS build script makefiles 24 | DMBS_PATH ?= ../DMBS 25 | include $(DMBS_PATH)/core.mk 26 | include $(DMBS_PATH)/gcc.mk 27 | include $(DMBS_PATH)/cppcheck.mk 28 | include $(DMBS_PATH)/doxygen.mk 29 | include $(DMBS_PATH)/dfu.mk 30 | include $(DMBS_PATH)/hid.mk 31 | include $(DMBS_PATH)/avrdude.mk 32 | include $(DMBS_PATH)/atprogram.mk 33 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/LUFA/lufa-gcc.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_BUILD_MODULES += LUFA_GCC 10 | DMBS_BUILD_TARGETS += 11 | DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH F_USB 12 | DMBS_BUILD_OPTIONAL_VARS += BOARD 13 | DMBS_BUILD_PROVIDED_VARS += 14 | DMBS_BUILD_PROVIDED_MACROS += 15 | 16 | SHELL = /bin/sh 17 | 18 | ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set)) 19 | ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank)) 20 | ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N)) 21 | 22 | # Sanity check user supplied values 23 | $(call ERROR_IF_EMPTY, LUFA_PATH) 24 | $(call ERROR_IF_EMPTY, ARCH) 25 | $(call ERROR_IF_EMPTY, F_USB) 26 | 27 | # Default values of optionally user-supplied variables 28 | BOARD ?= NONE 29 | 30 | # Determine the utility prefix to use for the selected architecture 31 | ifeq ($(ARCH), XMEGA) 32 | $(warning The XMEGA device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.) 33 | else ifeq ($(ARCH), UC3) 34 | $(warning The UC3 device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.) 35 | endif 36 | 37 | # Common LUFA C/C++ includes/definitions 38 | LUFA_CXX_INCLUDES = -I. -I$(patsubst %/,%,$(LUFA_PATH))/.. 39 | LUFA_CXX_DEFINES = -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL 40 | 41 | # LUFA specific standard build options 42 | C_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS) 43 | CPP_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS) 44 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_atprogram.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/atprogram.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_avrdude.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/avrdude.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_build.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS 10 | DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA 11 | include $(DMBS_PATH)/gcc.mk 12 | include $(DMBS_LUFA_PATH)/lufa-gcc.mk 13 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_core.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/core.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_cppcheck.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/cppcheck.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_dfu.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/dfu.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_doxygen.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/doxygen.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_hid.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS 10 | include $(DMBS_PATH)/hid.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Build/lufa_sources.mk: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2015. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA 10 | include $(DMBS_LUFA_PATH)/lufa-sources.mk 11 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Adafruit U4 Breakout board. 33 | * \copydetails Group_BoardInfo_ADAFRUITU4 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_ADAFRUITU4 ADAFRUITU4 41 | * \brief Board specific information header for the Adafruit U4 Breakout board. 42 | * 43 | * Board specific information header for the Adafruit U4 Breakout board (http://ladyada.net/products/atmega32u4breakout). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_ADAFRUITU4_H__ 49 | #define __BOARD_ADAFRUITU4_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Atmel ATAVRUSBRF01. 33 | * \copydetails Group_BoardInfo_ATAVRUSBRF01 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_ATAVRUSBRF01 ATAVRUSBRF01 41 | * \brief Board specific information header for the Atmel ATAVRUSBRF01. 42 | * 43 | * Board specific information header for the Atmel ATAVRUSBRF01. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_ATAVRUSBRF01_H__ 49 | #define __BOARD_ATAVRUSBRF01_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/BENITO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Tempusdictum Benito. 33 | * \copydetails Group_BoardInfo_BENITO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_BENITO BENITO 41 | * \brief Board specific information header for the Tempusdictum Benito. 42 | * 43 | * Board specific information header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_BENITO_H__ 49 | #define __BOARD_BENITO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Bitwizard Big-Multio. 33 | * \copydetails Group_BoardInfo_BIGMULTIO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_BIGMULTIO BIGMULTIO 41 | * \brief Board specific information header for the Bitwizard Big-Multio. 42 | * 43 | * Board specific information header for the Bitwizard Big-Multio (http://www.bitwizard.nl/wiki/index.php/Usbbigmultio). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_BIGMULTIO_H__ 49 | #define __BOARD_BIGMULTIO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the BLACKCAT USB JTAG. 33 | * \copydetails Group_BoardInfo_BLACKCAT 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_BLACKCAT BLACKCAT 41 | * \brief Board specific information header for the BLACKCAT USB JTAG. 42 | * 43 | * Board specific information header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_BLACKCAT_H__ 49 | #define __BOARD_BLACKCAT_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/BUI/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Busware BUI. 33 | * \copydetails Group_BoardInfo_BUI 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_BUI BUI 41 | * \brief Board specific information header for the Busware BUI. 42 | * 43 | * Board specific information header for the Busware BUI (http://www.busware.de/tiki-index.php?page=BUI). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_BUI_H__ 49 | #define __BOARD_BUI_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/CULV3/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Busware CUL V3. 33 | * \copydetails Group_BoardInfo_CULV3 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_CULV3 CULV3 41 | * \brief Board specific information header for the Busware CUL V3. 42 | * 43 | * Board specific information header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_CULV3_H__ 49 | #define __BOARD_CULV3_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/DUCE/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the DorkbotPDX Duce. 33 | * \copydetails Group_BoardInfo_DUCE 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_DUCE DUCE 41 | * \brief Board specific information header for the DorkbotPDX Duce. 42 | * 43 | * Board specific information header for the DorkbotPDX Duce (http://dorkbotpdx.org/wiki/duce). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_DUCE_H__ 49 | #define __BOARD_DUCE_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Mattairtech JM-DB-U2. 33 | * \copydetails Group_BoardInfo_JMDBU2 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_JMDBU2 JMDBU2 41 | * \brief Board specific information header for the Mattairtech JM-DB-U2. 42 | * 43 | * Board specific information header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_JMDBU2_H__ 49 | #define __BOARD_JMDBU2_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Arduino Leonardo board. 33 | * \copydetails Group_BoardInfo_LEONARDO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_LEONARDO LEONARDO 41 | * \brief Board specific information header for the Arduino Leonardo board. 42 | * 43 | * Board specific information header for the Arduino Leonardo board (http://arduino.cc/en/Main/arduinoBoardLeonardo). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_LEONARDO_H__ 49 | #define __BOARD_LEONARDO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Maximus board. 33 | * \copydetails Group_BoardInfo_MAXIMUS 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_MAXIMUS MAXIMUS 41 | * \brief Board specific information header for the Maximus board. 42 | * 43 | * Board specific information header for the Maximus (http://www.avrusb.com/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_MAXIMUS_H__ 49 | #define __BOARD_MAXIMUS_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/MICRO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Arduino Micro board. 33 | * \copydetails Group_BoardInfo_MICRO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_MICRO MICRO 41 | * \brief Board specific information header for the Arduino Micro board. 42 | * 43 | * Board specific information header for the Arduino Micro board (http://arduino.cc/en/Main/arduinoBoardMicro). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_MICRO_H__ 49 | #define __BOARD_MICRO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the MINIMUS. 33 | * \copydetails Group_BoardInfo_MINIMUS 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_MINIMUS MINIMUS 41 | * \brief Board specific information header for the MINIMUS. 42 | * 43 | * Board specific information header for the MINIMUS. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_MINIMUS_H__ 49 | #define __BOARD_MINIMUS_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/MULTIO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Bitwizard Multio. 33 | * \copydetails Group_BoardInfo_MULTIO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_MULTIO MULTIO 41 | * \brief Board specific information header for the Bitwizard Multio. 42 | * 43 | * Board specific information header for the Bitwizard Multio (http://www.bitwizard.nl/wiki/index.php/USB-multio). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_MULTIO_H__ 49 | #define __BOARD_MULTIO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the "Pololu A-Star Micro" board. 33 | * \copydetails Group_BoardInfo_POLOLUMICRO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_POLOLUMICRO POLOLUMICRO 41 | * \brief Board specific information header for the "Pololu A-Star Micro" board. 42 | * 43 | * Board specific information header: 44 | * https://www.pololu.com/docs/0J61 -> https://www.pololu.com/docs/0J61/3.1 45 | * 46 | * @{ 47 | */ 48 | 49 | #ifndef __BOARD_POLOLUMICRO_H__ 50 | #define __BOARD_POLOLUMICRO_H__ 51 | 52 | /* Includes: */ 53 | #include "../../../../Common/Common.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware LEDs mounted. */ 69 | #define BOARD_HAS_LEDS 70 | 71 | /* Disable C linkage for C++ Compilers: */ 72 | #if defined(__cplusplus) 73 | } 74 | #endif 75 | 76 | #endif 77 | 78 | /** @} */ 79 | 80 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Atmel RZUSBSTICK. 33 | * \copydetails Group_BoardInfo_RZUSBSTICK 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_RZUSBSTICK RZUSBSTICK 41 | * \brief Board specific information header for the Atmel RZUSBSTICK. 42 | * 43 | * Board specific information header for the Atmel RZUSBSTICK. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_RZUSBSTICK_H__ 49 | #define __BOARD_RZUSBSTICK_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Sparkfun ATMEGA8U2 breakout board. 33 | * \copydetails Group_BoardInfo_SPARKFUN8U2 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_SPARKFUN8U2 SPARKFUN8U2 41 | * \brief Board specific information header for the Sparkfun ATMEGA8U2 breakout board. 42 | * 43 | * Board specific information header for the Sparkfun ATMEGA8U2 breakout board (http://www.sparkfun.com/products/10277). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_SPARKFUN8U2_H__ 49 | #define __BOARD_SPARKFUN8U2_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/TUL/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the TUL. 33 | * \copydetails Group_BoardInfo_TUL 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_TUL TUL 41 | * \brief Board specific information header for the TUL. 42 | * 43 | * Board specific information header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_TUL_H__ 49 | #define __BOARD_TUL_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/U2S/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the U2S. 33 | * \copydetails Group_BoardInfo_U2S 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_U2S U2S 41 | * \brief Board specific information header for the U2S. 42 | * 43 | * Board specific information header for the U2S (http://sites.google.com/site/megau2s/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_U2S__ 49 | #define __BOARD_U2S__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has a hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has a hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/UDIP/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the UDIP. 33 | * \copydetails Group_BoardInfo_UDIP 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_UDIP UDIP 41 | * \brief Board specific information header for the UDIP. 42 | * 43 | * Board specific information header for the Linnix UDIP (http://linnix.com/udip/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_UDIP_H__ 49 | #define __BOARD_UDIP_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for Tom's USBTINY MKII. 33 | * \copydetails Group_BoardInfo_USBTINYMKII 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_USBTINYMKII USBTINYMKII 41 | * \brief Board specific information header for Tom's USBTINY MKII. 42 | * 43 | * Board specific information header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_USBTINYMKII_H__ 49 | #define __BOARD_USBTINYMKII_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Atmel Xplained-MINI series kits. 33 | * \copydetails Group_BoardInfo_XPLAINED_MINI 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_XPLAINED_MINI XPLAINED_MINI 41 | * \brief Board specific information header for the Atmel Xplained-MINI series kits. 42 | * 43 | * Board specific information header for the Atmel Xplained-MINI series kits. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_XPLAINED_MINI_H__ 49 | #define __BOARD_XPLAINED_MINI_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/AVR8/YUN/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Arduino Yun board. 33 | * \copydetails Group_BoardInfo_YUN 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_YUN YUN 41 | * \brief Board specific information header for the Arduino Yun board. 42 | * 43 | * Board specific information header for the Arduino Yun board (http://arduino.cc/en/Main/arduinoBoardYun). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_YUN_H__ 49 | #define __BOARD_YUN_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../LEDs.h" 54 | 55 | /* Enable C linkage for C++ Compilers: */ 56 | #if defined(__cplusplus) 57 | extern "C" { 58 | #endif 59 | 60 | /* Preprocessor Checks: */ 61 | #if !defined(__INCLUDE_FROM_BOARD_H) 62 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 63 | #endif 64 | 65 | /* Public Interface - May be used in end-application: */ 66 | /* Macros: */ 67 | /** Indicates the board has hardware LEDs mounted. */ 68 | #define BOARD_HAS_LEDS 69 | 70 | /* Disable C linkage for C++ Compilers: */ 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | 79 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/UC3/EVK1104/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Atmel EVK1104. 33 | * \copydetails Group_BoardInfo_EVK1104 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_EVK1104 EVK1104 41 | * \brief Board specific information header for the Atmel Atmel EVK1104. 42 | * 43 | * Board specific information header for the Atmel Atmel EVK1104. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_EVK1104_H__ 49 | #define __BOARD_EVK1104_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific information header for the Atmel UC3-A3 Xplained. 33 | * \copydetails Group_BoardInfo_UC3_A3_XPLAINED 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Board driver 36 | * dispatch header located in LUFA/Drivers/Board/Board.h. 37 | */ 38 | 39 | /** \ingroup Group_BoardInfo 40 | * \defgroup Group_BoardInfo_UC3_A3_XPLAINED UC3_A3_XPLAINED 41 | * \brief Board specific information header for the Atmel UC3-A3 Xplained. 42 | * 43 | * Board specific information header for the Atmel UC3-A3 Xplained. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BOARD_UC3_A3_XPLAINED_H__ 49 | #define __BOARD_UC3_A3_XPLAINED_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | #include "../../Buttons.h" 54 | #include "../../LEDs.h" 55 | 56 | /* Enable C linkage for C++ Compilers: */ 57 | #if defined(__cplusplus) 58 | extern "C" { 59 | #endif 60 | 61 | /* Preprocessor Checks: */ 62 | #if !defined(__INCLUDE_FROM_BOARD_H) 63 | #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. 64 | #endif 65 | 66 | /* Public Interface - May be used in end-application: */ 67 | /* Macros: */ 68 | /** Indicates the board has hardware Buttons mounted. */ 69 | #define BOARD_HAS_BUTTONS 70 | 71 | /** Indicates the board has hardware LEDs mounted. */ 72 | #define BOARD_HAS_LEDS 73 | 74 | /* Disable C linkage for C++ Compilers: */ 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | /** @} */ 82 | 83 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_AVR8) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | if (!(USB_Options & USB_OPT_MANUAL_PLL)) 44 | { 45 | USB_PLL_On(); 46 | while (!(USB_PLL_IsReady())); 47 | } 48 | 49 | USB_CLK_Unfreeze(); 50 | 51 | UDCON |= (1 << RMWKUP); 52 | while (UDCON & (1 << RMWKUP)); 53 | } 54 | 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | 38 | if (!(Length)) 39 | Endpoint_ClearOUT(); 40 | 41 | while (Length) 42 | { 43 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 44 | 45 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 46 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 47 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 48 | return ENDPOINT_RWCSTREAM_BusSuspended; 49 | else if (Endpoint_IsSETUPReceived()) 50 | return ENDPOINT_RWCSTREAM_HostAborted; 51 | 52 | if (Endpoint_IsOUTReceived()) 53 | { 54 | while (Length && Endpoint_BytesInEndpoint()) 55 | { 56 | TEMPLATE_TRANSFER_BYTE(DataStream); 57 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 58 | Length--; 59 | } 60 | 61 | Endpoint_ClearOUT(); 62 | } 63 | } 64 | 65 | while (!(Endpoint_IsINReady())) 66 | { 67 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 68 | 69 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 70 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 71 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 72 | return ENDPOINT_RWCSTREAM_BusSuspended; 73 | } 74 | 75 | return ENDPOINT_RWCSTREAM_NoError; 76 | } 77 | 78 | #undef TEMPLATE_BUFFER_OFFSET 79 | #undef TEMPLATE_BUFFER_MOVE 80 | #undef TEMPLATE_FUNC_NAME 81 | #undef TEMPLATE_TRANSFER_BYTE 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | Pipe_SetPipeToken(TEMPLATE_TOKEN); 42 | 43 | if ((ErrorCode = Pipe_WaitUntilReady())) 44 | return ErrorCode; 45 | 46 | if (BytesProcessed != NULL) 47 | { 48 | Length -= *BytesProcessed; 49 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 50 | } 51 | 52 | while (Length) 53 | { 54 | if (!(Pipe_IsReadWriteAllowed())) 55 | { 56 | TEMPLATE_CLEAR_PIPE(); 57 | 58 | if (BytesProcessed != NULL) 59 | { 60 | *BytesProcessed += BytesInTransfer; 61 | return PIPE_RWSTREAM_IncompleteTransfer; 62 | } 63 | 64 | if ((ErrorCode = Pipe_WaitUntilReady())) 65 | return ErrorCode; 66 | } 67 | else 68 | { 69 | TEMPLATE_TRANSFER_BYTE(DataStream); 70 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 71 | Length--; 72 | BytesInTransfer++; 73 | } 74 | } 75 | 76 | return PIPE_RWSTREAM_NoError; 77 | } 78 | 79 | #undef TEMPLATE_FUNC_NAME 80 | #undef TEMPLATE_BUFFER_TYPE 81 | #undef TEMPLATE_TOKEN 82 | #undef TEMPLATE_TRANSFER_BYTE 83 | #undef TEMPLATE_CLEAR_PIPE 84 | #undef TEMPLATE_BUFFER_OFFSET 85 | #undef TEMPLATE_BUFFER_MOVE 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/Events.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_EVENTS_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "Events.h" 34 | 35 | void USB_Event_Stub(void) 36 | { 37 | 38 | } 39 | 40 | void USB_Event_Stub_2(const uint8_t _1) 41 | { 42 | USB_Event_Stub(); 43 | } 44 | 45 | void USB_Event_Stub_3(const uint8_t _1, const uint8_t _2) 46 | { 47 | USB_Event_Stub(); 48 | } 49 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/OTG.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Common USB OTG definitions for all architectures. 33 | * \copydetails Group_OTG 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the USB driver 36 | * dispatch header located in LUFA/Drivers/USB/USB.h. 37 | */ 38 | 39 | /** \ingroup Group_USB 40 | * \defgroup Group_OTG USB On The Go (OTG) Management 41 | * \brief USB OTG management definitions. 42 | * 43 | * This module contains macros for embedded USB hosts with dual role On The Go capabilities, for managing role 44 | * exchange. OTG is a way for two USB dual role devices to talk to one another directly without fixed device/host 45 | * roles. 46 | * 47 | * @{ 48 | */ 49 | 50 | #ifndef __USBOTG_H__ 51 | #define __USBOTG_H__ 52 | 53 | /* Includes: */ 54 | #include "../../../Common/Common.h" 55 | #include "USBMode.h" 56 | 57 | /* Enable C linkage for C++ Compilers: */ 58 | #if defined(__cplusplus) 59 | extern "C" { 60 | #endif 61 | 62 | /* Preprocessor Checks: */ 63 | #if !defined(__INCLUDE_FROM_USB_DRIVER) 64 | #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 65 | #endif 66 | 67 | /* Architecture Includes: */ 68 | #if (ARCH == ARCH_AVR8) 69 | #include "AVR8/OTG_AVR8.h" 70 | #endif 71 | 72 | /* Disable C linkage for C++ Compilers: */ 73 | #if defined(__cplusplus) 74 | } 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/UC3/Device_UC3.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_UC3) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | USB_CLK_Unfreeze(); 44 | 45 | AVR32_USBB.UDCON.rmwkup = true; 46 | while (AVR32_USBB.UDCON.rmwkup); 47 | } 48 | 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | 38 | if (!(Length)) 39 | Endpoint_ClearOUT(); 40 | 41 | while (Length) 42 | { 43 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 44 | 45 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 46 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 47 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 48 | return ENDPOINT_RWCSTREAM_BusSuspended; 49 | else if (Endpoint_IsSETUPReceived()) 50 | return ENDPOINT_RWCSTREAM_HostAborted; 51 | 52 | if (Endpoint_IsOUTReceived()) 53 | { 54 | while (Length && Endpoint_BytesInEndpoint()) 55 | { 56 | TEMPLATE_TRANSFER_BYTE(DataStream); 57 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 58 | Length--; 59 | } 60 | 61 | Endpoint_ClearOUT(); 62 | } 63 | } 64 | 65 | while (!(Endpoint_IsINReady())) 66 | { 67 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 68 | 69 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 70 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 71 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 72 | return ENDPOINT_RWCSTREAM_BusSuspended; 73 | } 74 | 75 | return ENDPOINT_RWCSTREAM_NoError; 76 | } 77 | 78 | #undef TEMPLATE_BUFFER_OFFSET 79 | #undef TEMPLATE_BUFFER_MOVE 80 | #undef TEMPLATE_FUNC_NAME 81 | #undef TEMPLATE_TRANSFER_BYTE 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | Pipe_SetPipeToken(TEMPLATE_TOKEN); 42 | 43 | if ((ErrorCode = Pipe_WaitUntilReady())) 44 | return ErrorCode; 45 | 46 | if (BytesProcessed != NULL) 47 | { 48 | Length -= *BytesProcessed; 49 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 50 | } 51 | 52 | while (Length) 53 | { 54 | if (!(Pipe_IsReadWriteAllowed())) 55 | { 56 | TEMPLATE_CLEAR_PIPE(); 57 | 58 | if (BytesProcessed != NULL) 59 | { 60 | *BytesProcessed += BytesInTransfer; 61 | return PIPE_RWSTREAM_IncompleteTransfer; 62 | } 63 | 64 | if ((ErrorCode = Pipe_WaitUntilReady())) 65 | return ErrorCode; 66 | } 67 | else 68 | { 69 | TEMPLATE_TRANSFER_BYTE(DataStream); 70 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 71 | Length--; 72 | BytesInTransfer++; 73 | } 74 | } 75 | 76 | return PIPE_RWSTREAM_NoError; 77 | } 78 | 79 | #undef TEMPLATE_FUNC_NAME 80 | #undef TEMPLATE_BUFFER_TYPE 81 | #undef TEMPLATE_TOKEN 82 | #undef TEMPLATE_TRANSFER_BYTE 83 | #undef TEMPLATE_CLEAR_PIPE 84 | #undef TEMPLATE_BUFFER_OFFSET 85 | #undef TEMPLATE_BUFFER_MOVE 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/USBInterrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief USB controller interrupt service routine management. 33 | * 34 | * This file contains definitions required for the correct handling of low level USB service routine interrupts 35 | * from the USB controller. 36 | * 37 | * \note This file should not be included directly. It is automatically included as needed by the USB driver 38 | * dispatch header located in LUFA/Drivers/USB/USB.h. 39 | */ 40 | 41 | #ifndef __USBINTERRUPT_H__ 42 | #define __USBINTERRUPT_H__ 43 | 44 | /* Includes: */ 45 | #include "../../../Common/Common.h" 46 | #include "USBMode.h" 47 | 48 | /* Enable C linkage for C++ Compilers: */ 49 | #if defined(__cplusplus) 50 | extern "C" { 51 | #endif 52 | 53 | /* Preprocessor Checks: */ 54 | #if !defined(__INCLUDE_FROM_USB_DRIVER) 55 | #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 56 | #endif 57 | 58 | /* Architecture Includes: */ 59 | #if (ARCH == ARCH_AVR8) 60 | #include "AVR8/USBInterrupt_AVR8.h" 61 | #elif (ARCH == ARCH_UC3) 62 | #include "UC3/USBInterrupt_UC3.h" 63 | #elif (ARCH == ARCH_XMEGA) 64 | #include "XMEGA/USBInterrupt_XMEGA.h" 65 | #endif 66 | 67 | /* Disable C linkage for C++ Compilers: */ 68 | #if defined(__cplusplus) 69 | } 70 | #endif 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/USBTask.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USBTASK_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "USBTask.h" 34 | 35 | volatile bool USB_IsInitialized; 36 | USB_Request_Header_t USB_ControlRequest; 37 | 38 | #if defined(USB_CAN_BE_HOST) && !defined(HOST_STATE_AS_GPIOR) 39 | volatile uint8_t USB_HostState; 40 | #endif 41 | 42 | #if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) 43 | volatile uint8_t USB_DeviceState; 44 | #endif 45 | 46 | void USB_USBTask(void) 47 | { 48 | #if defined(USB_CAN_BE_BOTH) 49 | if (USB_CurrentMode == USB_MODE_Device) 50 | USB_DeviceTask(); 51 | else if (USB_CurrentMode == USB_MODE_Host) 52 | USB_HostTask(); 53 | #elif defined(USB_CAN_BE_HOST) 54 | USB_HostTask(); 55 | #elif defined(USB_CAN_BE_DEVICE) 56 | USB_DeviceTask(); 57 | #endif 58 | } 59 | 60 | #if defined(USB_CAN_BE_DEVICE) 61 | static void USB_DeviceTask(void) 62 | { 63 | if (USB_DeviceState == DEVICE_STATE_Unattached) 64 | return; 65 | 66 | uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); 67 | 68 | Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); 69 | 70 | if (Endpoint_IsSETUPReceived()) 71 | USB_Device_ProcessControlRequest(); 72 | 73 | Endpoint_SelectEndpoint(PrevEndpoint); 74 | } 75 | #endif 76 | 77 | #if defined(USB_CAN_BE_HOST) 78 | static void USB_HostTask(void) 79 | { 80 | uint8_t PrevPipe = Pipe_GetCurrentPipe(); 81 | 82 | Pipe_SelectPipe(PIPE_CONTROLPIPE); 83 | 84 | USB_Host_ProcessNextHostState(); 85 | 86 | Pipe_SelectPipe(PrevPipe); 87 | } 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | USB.CTRLB |= USB_RWAKEUP_bm; 44 | } 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_HOST) 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_HOST) 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_HOST) 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/License.txt: -------------------------------------------------------------------------------- 1 | LUFA Library 2 | Copyright (C) Dean Camera, 2017. 3 | 4 | dean [at] fourwalledcubicle [dot] com 5 | www.lufa-lib.org 6 | 7 | 8 | Permission to use, copy, modify, and distribute this software 9 | and its documentation for any purpose is hereby granted without 10 | fee, provided that the above copyright notice appear in all 11 | copies and that both that the copyright notice and this 12 | permission notice and warranty disclaimer appear in supporting 13 | documentation, and that the name of the author not be used in 14 | advertising or publicity pertaining to distribution of the 15 | software without specific, written prior permission. 16 | 17 | The author disclaims all warranties with regard to this 18 | software, including all implied warranties of merchantability 19 | and fitness. In no event shall the author be liable for any 20 | special, indirect or consequential damages or any damages 21 | whatsoever resulting from loss of use, data or profits, whether 22 | in an action of contract, negligence or other tortious action, 23 | arising out of or in connection with the use or performance of 24 | this software. 25 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Platform/UC3/InterruptManagement.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2017. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../Common/Common.h" 32 | #if (ARCH == ARCH_UC3) 33 | 34 | #define __INCLUDE_FROM_INTMANAGEMENT_C 35 | #include "InterruptManagement.h" 36 | 37 | /** Interrupt vector table, containing the ISR to call for each interrupt group */ 38 | InterruptHandlerPtr_t InterruptHandlers[AVR32_INTC_NUM_INT_GRPS]; 39 | 40 | /** ISR for unhandled interrupt groups */ 41 | ISR(Unhandled_Interrupt) 42 | { 43 | for (;;); 44 | } 45 | 46 | InterruptHandlerPtr_t INTC_GetInterruptHandler(const uint_reg_t InterruptLevel) 47 | { 48 | return InterruptHandlers[AVR32_INTC.icr[AVR32_INTC_INT3 - InterruptLevel]]; 49 | } 50 | 51 | void INTC_Init(void) 52 | { 53 | for (uint8_t InterruptGroup = 0; InterruptGroup < AVR32_INTC_NUM_INT_GRPS; InterruptGroup++) 54 | { 55 | InterruptHandlers[InterruptGroup] = Unhandled_Interrupt; 56 | AVR32_INTC.ipr[InterruptGroup] = Autovector_Table[AVR32_INTC_INT0]; 57 | } 58 | 59 | __builtin_mtsr(AVR32_EVBA, (uintptr_t)&EVBA_Table); 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Platform/UC3/UC3ExperimentalInfo.txt: -------------------------------------------------------------------------------- 1 | Please note that the UC3 architecture support is EXPERIMENTAL at this time, and may be non-functional/incomplete in some areas. Please refer to the Known Issues section of the LUFA manual. -------------------------------------------------------------------------------- /Firmware/ChameleonMini/LUFA/Platform/XMEGA/XMEGAExperimentalInfo.txt: -------------------------------------------------------------------------------- 1 | Please note that the XMEGA architecture support is EXPERIMENTAL at this time, and may be non-functional/incomplete in some areas. Please refer to the Known Issues section of the LUFA manual. -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Map.c: -------------------------------------------------------------------------------- 1 | #include "Map.h" 2 | 3 | bool MapIdToText(const MapEntryType* MapPtr, uint8_t MapSize, MapIdType Id, char* Text, uint16_t MaxBufferSize) 4 | { 5 | while (MapSize--) { 6 | if (pgm_read_byte(&MapPtr->Id) == Id) { 7 | strncpy_P(Text, MapPtr->Text, MaxBufferSize); 8 | return true; 9 | } 10 | 11 | MapPtr++; 12 | } 13 | 14 | return false; 15 | } 16 | 17 | bool MapTextToId(const MapEntryType* MapPtr, uint8_t MapSize, MapTextPtrType Text, MapIdType* IdPtr) 18 | { 19 | while (MapSize--) { 20 | if (strcmp_P(Text, MapPtr->Text) == 0) { 21 | if (sizeof(MapIdType) == 1) { 22 | *IdPtr = pgm_read_byte(&MapPtr->Id); 23 | } else if (sizeof(MapIdType) == 2) { 24 | *IdPtr = pgm_read_word(&MapPtr->Id); 25 | } 26 | return true; 27 | } 28 | 29 | MapPtr++; 30 | } 31 | 32 | return false; 33 | } 34 | 35 | void MapToString(MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize) 36 | { 37 | uint8_t EntriesLeft = MapSize; 38 | uint16_t BytesLeft = MaxBufferSize; 39 | 40 | while (EntriesLeft > 0) { 41 | const char* Text = MapPtr->Text; 42 | char c; 43 | 44 | while( (c = pgm_read_byte(Text)) != '\0') { 45 | if (BytesLeft == 0) { 46 | return; 47 | } 48 | 49 | *String++ = c; 50 | Text++; 51 | BytesLeft--; 52 | } 53 | 54 | if (EntriesLeft > 1) { 55 | /* More than one map entries left */ 56 | if (BytesLeft == 0) { 57 | return; 58 | } 59 | 60 | *String++ = ','; 61 | } 62 | 63 | MapPtr++; 64 | EntriesLeft--; 65 | } 66 | 67 | /* Terminate string */ 68 | if (BytesLeft > 0) { 69 | *String++ = '\0'; 70 | BytesLeft--; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Map.h 3 | * 4 | * Created on: 07.12.2014 5 | * Author: sk 6 | */ 7 | 8 | #ifndef MAP_H_ 9 | #define MAP_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define MAP_TEXT_BUF_SIZE 32 16 | #define MAP_MAX_TEXT_SIZE (MAP_TEXT_BUF_SIZE - 1) 17 | 18 | typedef uint8_t MapIdType; 19 | typedef const char* MapTextPtrType; 20 | 21 | const typedef struct { 22 | MapIdType Id; 23 | const char Text[MAP_TEXT_BUF_SIZE]; 24 | } MapEntryType; 25 | 26 | bool MapIdToText(const MapEntryType* MapPtr, uint8_t MapSize, MapIdType Id, char* Text, uint16_t MaxBufferSize); 27 | bool MapTextToId(const MapEntryType* MapPtr, uint8_t MapSize, MapTextPtrType Text, MapIdType* IdPtr); 28 | void MapToString(const MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize); 29 | 30 | #endif /* MAP_H_ */ 31 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Memory/EEPROM.c: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM.c 3 | * 4 | * 2019, @shinhub 5 | * 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include "EEPROM.h" 12 | #include "../Common.h" 13 | 14 | // Dummy init to prepare for future use 15 | bool EEPROMInit(void) { 16 | bool ret = false; 17 | // Enable EEPROM data memory mapping 18 | NVM.CTRLB |= NVM_EEMAPEN_bm; 19 | // Calculate available EEPROM size per setting 20 | if (EEPROM_BYTES_TOTAL > EEPROM_NO_MEMORY) { 21 | EEPROMInfo.bytesTotal = EEPROM_BYTES_TOTAL; 22 | ret = true; 23 | } 24 | return ret; 25 | } 26 | 27 | bool EEPROMClearAll(void) { 28 | uint16_t addr; 29 | uint8_t clear[8] = { EEPROM_ERASE_ARRAY }; 30 | uint8_t sreg; 31 | sreg = SREG; 32 | for( addr = EEPROM_START_ADDR; addr < EEPROM_BYTES_TOTAL; addr += EEPROM_ADDR_OFFSET ) { 33 | eeprom_update_block((const void*)&clear[0], (void*)addr, EEPROM_ADDR_OFFSET); 34 | } 35 | SREG = sreg; 36 | return true; 37 | } 38 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Memory/EEPROM.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM.h 3 | * 4 | * 2019, @shinhub 5 | * 6 | */ 7 | 8 | #ifndef _MEM_EEPROM_H_ 9 | #define _MEM_EEPROM_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define EEPROM_BYTES_TOTAL (E2END + 1) 16 | #define EEPROM_NO_MEMORY 0x00 17 | #define EEPROM_START_ADDR 0 18 | #define EEPROM_ERASE_ARRAY 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 19 | #define EEPROM_ERASE_BYTE 0xFF 20 | #define EEPROM_ADDR_OFFSET 8 // Bytes 21 | 22 | typedef struct { 23 | uint16_t bytesTotal; 24 | } EEPROMInfo_t; 25 | 26 | EEPROMInfo_t EEPROMInfo; 27 | 28 | bool EEPROMClearAll(void); 29 | bool EEPROMInit(void); 30 | 31 | #endif /* _MEM_EEPROM_H_ */ 32 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Random.c: -------------------------------------------------------------------------------- 1 | #include "Random.h" 2 | 3 | void RandomInit(void) { 4 | } 5 | 6 | uint8_t RandomGetByte(void) { 7 | return rand() & 0xFF; 8 | } 9 | 10 | void RandomGetBuffer(void* Buffer, uint8_t ByteCount) { 11 | uint8_t* BufferPtr = (uint8_t*) Buffer; 12 | 13 | while (ByteCount--) { 14 | *BufferPtr++ = RandomGetByte(); 15 | } 16 | } 17 | 18 | void RandomTick(void) { 19 | rand(); 20 | rand(); 21 | rand(); 22 | rand(); 23 | } 24 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Random.h 3 | * 4 | * Created on: 22.03.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef RANDOM_H_ 9 | #define RANDOM_H_ 10 | 11 | #include 12 | #include "Common.h" 13 | 14 | void RandomInit(void); 15 | uint8_t RandomGetByte(void); 16 | void RandomGetBuffer(void* Buffer, uint8_t ByteCount); 17 | void RandomTick(void); 18 | 19 | #endif /* RANDOM_H_ */ 20 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Settings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Settings.h 3 | * 4 | * Created on: 21.12.2013 5 | * Author: skuser 6 | */ 7 | /** @file */ 8 | #ifndef SETTINGS_H_ 9 | #define SETTINGS_H_ 10 | 11 | #include "Button.h" 12 | #include "Configuration.h" 13 | 14 | #define SETTINGS_COUNT 8 15 | #define SETTINGS_FIRST 0 16 | #define SETTINGS_LAST (SETTINGS_FIRST + SETTINGS_COUNT - 1) 17 | #ifdef DEFAULT_PENDING_TASK_TIMEOUT 18 | #define SETTINGS_TIMEOUT DEFAULT_PENDING_TASK_TIMEOUT 19 | #else 20 | #define SETTINGS_TIMEOUT 50 // *100ms 21 | #endif 22 | 23 | #define SETTING_TO_INDEX(S) (S - SETTINGS_FIRST) 24 | #define INDEX_TO_SETTING(I) (I + SETTINGS_FIRST) 25 | 26 | /** Defines one setting. 27 | * 28 | * \note Some properties may change globally if this is defined in the Makefile. 29 | */ 30 | typedef struct { 31 | ButtonActionEnum ButtonAction; /// Button action for this setting. 32 | ButtonActionEnum ButtonLongAction; /// Long button action for this setting. 33 | ConfigurationEnum Configuration; /// Active configuration for this setting. 34 | uint16_t PendingTaskTimeout; /// Timeout for timeout commands for this setting, in multiples of 100 ms. 35 | } SettingsEntryType; 36 | 37 | typedef struct { 38 | uint8_t ActiveSettingIdx; 39 | SettingsEntryType* ActiveSettingPtr; 40 | SettingsEntryType Settings[SETTINGS_COUNT]; 41 | bool UidMode; 42 | } SettingsType; 43 | 44 | extern SettingsType GlobalSettings; 45 | 46 | void SettingsLoad(void); 47 | void SettingsSave(void); 48 | void ActiveSettingNumberSave(void); 49 | 50 | void SettingsCycle(void); 51 | bool SettingsSetActiveById(uint8_t Setting); 52 | uint8_t SettingsGetActiveById(void); 53 | void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize); 54 | bool SettingsSetActiveByName(const char* Setting); 55 | 56 | void SettingsSetUidMode(bool isActive); 57 | 58 | #endif /* SETTINGS_H_ */ 59 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/System.c: -------------------------------------------------------------------------------- 1 | #include "System.h" 2 | 3 | ISR(BADISR_vect) 4 | { 5 | while(1); 6 | } 7 | 8 | void SystemInit(void) 9 | { 10 | if (RST.STATUS & RST_WDRF_bm) { 11 | /* On Watchdog reset clear WDRF bit, disable watchdog 12 | * and jump into bootloader */ 13 | RST.STATUS = RST_WDRF_bm; 14 | 15 | CCP = CCP_IOREG_gc; 16 | WDT.CTRL = WDT_CEN_bm; 17 | 18 | asm volatile ("jmp %0"::"i" (BOOT_SECTION_START + 0x1FC)); 19 | } 20 | 21 | /* 32MHz system clock using internal RC and 32K DFLL*/ 22 | OSC.CTRL |= OSC_RC32MEN_bm | OSC_RC32KEN_bm; 23 | while(!(OSC.STATUS & OSC_RC32MRDY_bm)) 24 | ; 25 | while(!(OSC.STATUS & OSC_RC32KRDY_bm)) 26 | ; 27 | 28 | OSC.DFLLCTRL = OSC_RC32MCREF_RC32K_gc; 29 | DFLLRC32M.CTRL = DFLL_ENABLE_bm; 30 | 31 | CCP = CCP_IOREG_gc; 32 | CLK.CTRL = CLK_SCLKSEL_RC32M_gc; 33 | 34 | /* Use TCE0 as system tick */ 35 | TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; 36 | TCE0.CTRLA = TC_CLKSEL_DIV256_gc; 37 | 38 | /* Enable RTC with roughly 1kHz clock */ 39 | CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; 40 | RTC.CTRL = RTC_PRESCALER_DIV1_gc; 41 | } 42 | 43 | void SystemReset(void) 44 | { 45 | CCP = CCP_IOREG_gc; 46 | RST.CTRL = RST_SWRST_bm; 47 | 48 | } 49 | 50 | void SystemEnterBootloader(void) 51 | { 52 | /* Use Watchdog timer to reset into bootloader. */ 53 | CCP = CCP_IOREG_gc; 54 | WDT.CTRL = WDT_PER_512CLK_gc | WDT_ENABLE_bm | WDT_CEN_bm; 55 | } 56 | 57 | 58 | void SystemStartUSBClock(void) 59 | { 60 | /* 48MHz USB Clock using 12MHz XTAL */ 61 | OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; 62 | OSC.CTRL |= OSC_XOSCEN_bm; 63 | while(!(OSC.STATUS & OSC_XOSCRDY_bm)) 64 | ; 65 | 66 | OSC.PLLCTRL = OSC_PLLSRC_XOSC_gc | (4 << OSC_PLLFAC_gp); 67 | 68 | OSC.CTRL |= OSC_PLLEN_bm; 69 | while(!(OSC.STATUS & OSC_PLLRDY_bm)) 70 | ; 71 | } 72 | 73 | void SystemStopUSBClock(void) 74 | { 75 | /* Disable USB Clock to minimize power consumption */ 76 | CLK.USBCTRL &= ~CLK_USBSEN_bm; 77 | OSC.CTRL &= ~OSC_PLLEN_bm; 78 | OSC.CTRL &= ~OSC_XOSCEN_bm; 79 | } 80 | 81 | void SystemInterruptInit(void) 82 | { 83 | /* Enable all interrupt levels */ 84 | PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; 85 | sei(); 86 | } 87 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/System.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Firmware/ChameleonMini/System.h -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Terminal/CommandLine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CommandLine.h 3 | * 4 | * Created on: 04.05.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef COMMANDLINE_H_ 9 | #define COMMANDLINE_H_ 10 | 11 | #include "Terminal.h" 12 | #include "Commands.h" 13 | 14 | void CommandLineInit(void); 15 | bool CommandLineProcessByte(uint8_t Byte); 16 | void CommandLineTick(void); 17 | 18 | void CommandLineAppendData(void const * const Buffer, uint16_t Bytes); 19 | 20 | /* Functions for timeout commands */ 21 | void CommandLinePendingTaskFinished(CommandStatusIdType ReturnStatusID, char const * const OutMessage); // must be called, when the intended task is finished 22 | extern void (*CommandLinePendingTaskTimeout) (void); // gets called on timeout to end the pending task 23 | void CommandLinePendingTaskBreak(void); // this manually triggers a timeout 24 | 25 | #endif /* COMMANDLINE_H_ */ 26 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Terminal/Terminal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CommandLine.h 3 | * 4 | * Created on: 10.02.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef TERMINAL_H_ 9 | #define TERMINAL_H_ 10 | 11 | #include "../Common.h" 12 | #include "../LUFA/Drivers/USB/USB.h" 13 | #include "XModem.h" 14 | #include "CommandLine.h" 15 | 16 | #define TERMINAL_VBUS_PORT PORTD 17 | #define TERMINAL_VBUS_MASK PIN5_bm 18 | 19 | #define TERMINAL_BUFFER_SIZE 256 20 | 21 | typedef enum { 22 | TERMINAL_UNINITIALIZED, 23 | TERMINAL_INITIALIZING, 24 | TERMINAL_INITIALIZED, 25 | TERMINAL_UNITIALIZING 26 | } TerminalStateEnum; 27 | 28 | extern uint8_t TerminalBuffer[TERMINAL_BUFFER_SIZE]; 29 | extern USB_ClassInfo_CDC_Device_t TerminalHandle; 30 | extern TerminalStateEnum TerminalState; 31 | 32 | void TerminalInit(void); 33 | void TerminalTask(void); 34 | void TerminalTick(void); 35 | 36 | /*void TerminalSendBuffer(void* Buffer, uint16_t ByteCount);*/ 37 | INLINE void TerminalSendByte(uint8_t Byte); 38 | void TerminalSendBlock(const void* Buffer, uint16_t ByteCount); 39 | 40 | INLINE void TerminalSendChar(char c); 41 | void TerminalSendString(const char* s); 42 | void TerminalSendStringP(const char* s); 43 | 44 | void EVENT_USB_Device_Connect(void); 45 | void EVENT_USB_Device_Disconnect(void); 46 | void EVENT_USB_Device_ConfigurationChanged(void); 47 | void EVENT_USB_Device_ControlRequest(void); 48 | 49 | INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); } 50 | INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } 51 | 52 | #endif /* TERMINAL_H_ */ 53 | -------------------------------------------------------------------------------- /Firmware/ChameleonMini/Terminal/XModem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TerminalXModem.h 3 | * 4 | * Created on: 22.03.2013 5 | * Author: skuser 6 | */ 7 | 8 | #ifndef XMODEM_H_ 9 | #define XMODEM_H_ 10 | 11 | #include "../Common.h" 12 | 13 | typedef bool (*XModemCallbackType) (void* ByteBuffer, uint32_t BlockAddress, uint32_t ByteCount); 14 | 15 | void XModemReceive(XModemCallbackType CallbackFunc); 16 | void XModemSend(XModemCallbackType CallbackFunc); 17 | 18 | bool XModemProcessByte(uint8_t Byte); 19 | void XModemTick(void); 20 | 21 | #endif /* TERMINALXMODEM_H_ */ 22 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2016 Timo Kasper, Simon Küppers, David Oswald 2 | ("ORIGINAL AUTHORS"). All rights reserved. 3 | 4 | DEFINITIONS: 5 | 6 | "WORK": The material covered by this license includes the schematic 7 | diagrams, designs, circuit or circuit board layouts, mechanical 8 | drawings, documentation (in electronic or printed form), source code, 9 | binary software, data files, assembled devices, and any additional 10 | material provided by the ORIGINAL AUTHORS in the ChameleonMini project 11 | (https://github.com/emsec/ChameleonMini). 12 | 13 | LICENSE TERMS: 14 | 15 | Redistributions and use of this WORK, with or without modification, or 16 | of substantial portions of this WORK are permitted provided that the 17 | following conditions are met: 18 | 19 | Redistributions and use of this WORK, with or without modification, or 20 | of substantial portions of this WORK must include the above copyright 21 | notice, this list of conditions, the below disclaimer, and the following 22 | attribution: 23 | 24 | "Based on the open-source NFC tool ChameleonMini: 25 | https://github.com/emsec/ChameleonMini" 26 | 27 | The attribution must be clearly visible to a user, for example, by being 28 | printed on the circuit board and an enclosure, and by being displayed by 29 | software (both in binary and source code form). 30 | 31 | At any time, the majority of the ORIGINAL AUTHORS may decide to give 32 | written permission to an entity to use or redistribute the WORK (with or 33 | without modification) WITHOUT having to include the above copyright 34 | notice, this list of conditions, the below disclaimer, and the above 35 | attribution. 36 | 37 | DISCLAIMER: 38 | 39 | THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS 40 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 41 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 42 | DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE 43 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 44 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 45 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 46 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 47 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 48 | ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF 49 | THE POSSIBILITY OF SUCH DAMAGE. 50 | 51 | The views and conclusions contained in the hardware, software, and 52 | documentation should not be interpreted as representing official 53 | policies, either expressed or implied, of the ORIGINAL AUTHORS. 54 | -------------------------------------------------------------------------------- /Schematics/Chameleon_mini_E_RDV20_REBOOTED.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Schematics/Chameleon_mini_E_RDV20_REBOOTED.pdf -------------------------------------------------------------------------------- /Software/Flashing-Windows/BOOT_LOADER_EXE.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Flashing-Windows/BOOT_LOADER_EXE.exe -------------------------------------------------------------------------------- /Software/Flashing-Windows/Createbin.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Flashing-Windows/Createbin.exe -------------------------------------------------------------------------------- /Software/Flashing-Windows/GenerateBootloader.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM This script generates the bootloader for the actual device by combining the modified Atmel 4 | REM bootloader located in BOOTDIR with the SPM helper that is being generated by make in BUILDDIR 5 | REM Uses srec_cat to append the hex files 6 | 7 | SET MCU=atxmega32a4u 8 | SET PIN=PA6 9 | SET VER=104 10 | SET BUILDDIR=..\ChameleonMini 11 | SET BUILDHEX=..\ChameleonMini.hex 12 | SET BOOTDIR=..\Atmel-DFU-Bootloader 13 | SET BOOTHEX=%MCU%_%VER%_%PIN%.hex 14 | SET OUTHEX=%BOOTDIR%\bootloader-%MCU%-%VER%-%PIN%-SPM.hex 15 | SET WORKDIR=%CD% 16 | 17 | REM Enter build directory and build SPM helper 18 | cd %BUILDDIR% 19 | make clean 20 | make spmhelper MCU='%MCU%' 21 | 22 | REM Return to working directory and combine generated HEX files into one 23 | cd %WORKDIR% 24 | 25 | ECHO Generating bootloader by combining %BOOTHEX% and %BUILDHEX% into %OUTHEX% 26 | ECHO. 27 | 28 | srec_cat %BOOTDIR%\%BOOTHEX% -intel %BUILDDIR%\%BUILDHEX% -intel -o %OUTHEX% -intel -line-length 44 29 | 30 | ECHO Done 31 | -------------------------------------------------------------------------------- /Software/Flashing-Windows/avr-objcopy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Flashing-Windows/avr-objcopy.exe -------------------------------------------------------------------------------- /Software/Flashing-Windows/dfu-programmer-win-0.7.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Flashing-Windows/dfu-programmer-win-0.7.2.zip -------------------------------------------------------------------------------- /Software/Flashing-Windows/flash.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | echo. 4 | echo .---------------------------------------------------. 5 | echo ^| ^| 6 | echo ^| ChameleonMini RevE Rebooted flasher utility ^| 7 | echo ^| Iceman fork ^| 8 | echo ^| ^| 9 | echo `---------------------------------------------------' 10 | echo. 11 | 12 | set dirpath=%~dp0 13 | set oldname=Chameleon-Mini 14 | set name=ChameleonMini 15 | 16 | if not exist "%dirpath%BOOT_LOADER_EXE.exe" ( 17 | echo Cannot find BOOT_LOADER_EXE.exe. Please run this .bat script in the same directory where it is saved. 18 | pause > nul 19 | exit 20 | ) 21 | 22 | if not exist "%dirpath%avr-objcopy.exe" ( 23 | echo Cannot find avr-objcopy.exe. Please run this .bat script in the same directory where it is saved. 24 | pause > nul 25 | exit 26 | ) 27 | 28 | if not exist "%dirpath%Createbin.exe" ( 29 | echo Cannot find Createbin.exe. Please run this .bat script in the same directory where it is saved. 30 | pause > nul 31 | exit 32 | ) 33 | 34 | if not exist "%dirpath%%name%.eep" ( 35 | if exist "%dirpath%%oldname%.eep" ( 36 | move /y "%dirpath%%oldname%.eep" "%dirpath%%name%.eep" 37 | ) else ( 38 | echo Cannot find eep file. Please run this .bat script in the same directory where it is saved. 39 | pause > nul 40 | exit 41 | ) 42 | ) 43 | 44 | if not exist "%dirpath%%name%.hex" ( 45 | if exist "%dirpath%%oldname%.hex" ( 46 | move /y "%dirpath%%oldname%.hex" "%dirpath%%name%.hex" 47 | ) else ( 48 | echo Cannot find hex file. Please run this .bat script in the same directory where it is saved. 49 | pause > nul 50 | exit 51 | ) 52 | ) 53 | 54 | echo Creating the EEPROM binary... 55 | "%dirpath%avr-objcopy.exe" -I ihex %name%.eep -O binary eeprom.bin 56 | 57 | "%dirpath%Createbin.exe" eeprom.bin bin 58 | 59 | del "%dirpath%eeprom.bin" 60 | 61 | echo. 62 | echo. 63 | 64 | move "%dirpath%myfile.bin" "%dirpath%myfilee.bin" >nul 65 | 66 | echo Creating the Flash binary... 67 | "%dirpath%avr-objcopy.exe" -I ihex %name%.hex -O binary flash.bin 68 | 69 | "%dirpath%Createbin.exe" flash.bin bin 70 | 71 | del "%dirpath%flash.bin" 72 | 73 | echo. 74 | echo. 75 | 76 | echo Flashing the files onto the "ChameleonMini RevE Rebooted"... 77 | "%dirpath%BOOT_LOADER_EXE.exe" 78 | 79 | echo. 80 | 81 | echo If there are no errors above, flashing the firmware should be finished now. Enjoy! 82 | 83 | -------------------------------------------------------------------------------- /Software/Flashing-Windows/msvcr120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Flashing-Windows/msvcr120d.dll -------------------------------------------------------------------------------- /Software/Original-Windows/BOOT_LOADER_EXE.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/BOOT_LOADER_EXE.exe -------------------------------------------------------------------------------- /Software/Original-Windows/Chameleon Mini RevE Rebooted.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/Chameleon Mini RevE Rebooted.exe -------------------------------------------------------------------------------- /Software/Original-Windows/Chameleon Mini RevE Rebooted_en.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/Chameleon Mini RevE Rebooted_en.exe -------------------------------------------------------------------------------- /Software/Original-Windows/Createbin.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/Createbin.exe -------------------------------------------------------------------------------- /Software/Original-Windows/GenerateBootloader.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM This script generates the bootloader for the actual device by combining the modified Atmel 4 | REM bootloader located in BOOTDIR with the SPM helper that is being generated by make in BUILDDIR 5 | REM Uses srec_cat to append the hex files 6 | 7 | SET MCU=atxmega32a4u 8 | SET PIN=PA6 9 | SET VER=104 10 | SET BUILDDIR=Chameleon-Mini 11 | SET BUILDHEX=Chameleon-Mini.hex 12 | SET BOOTDIR=Atmel-DFU-Bootloader 13 | SET BOOTHEX=%MCU%_%VER%_%PIN%.hex 14 | SET OUTHEX=bootloader-%MCU%-%VER%-%PIN%-SPM.hex 15 | SET WORKDIR=%CD% 16 | 17 | REM Enter build directory and build SPM helper 18 | cd %BUILDDIR% 19 | make clean 20 | make spmhelper MCU='%MCU%' 21 | 22 | REM Return to working directory and combine generated HEX files into one 23 | cd %WORKDIR% 24 | 25 | ECHO Generating bootloader by combining %BOOTHEX% and %BUILDHEX% into %OUTHEX% 26 | ECHO. 27 | 28 | srec_cat %BOOTDIR%\%BOOTHEX% -intel %BUILDDIR%\%BUILDHEX% -intel -o %OUTHEX% -intel -line-length 44 29 | 30 | ECHO Done -------------------------------------------------------------------------------- /Software/Original-Windows/avr-objcopy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/avr-objcopy.exe -------------------------------------------------------------------------------- /Software/Original-Windows/flash.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | echo. 4 | echo .---------------------------------------------------. 5 | echo ^| ^| 6 | echo ^| Chameleon-Mini Rev-E Rebooted flasher utility ^| 7 | echo ^| ^| 8 | echo `---------------------------------------------------' 9 | echo. 10 | 11 | if not exist "%~dp0BOOT_LOADER_EXE.exe" ( 12 | echo Cannot find BOOT_LOADER_EXE.exe. Please run this .bat script in the same directory where BOOT_LOADER_EXE.exe is saved. 13 | pause > nul 14 | exit 15 | ) 16 | 17 | if not exist "%~dp0avr-objcopy.exe" ( 18 | echo Cannot find avr-objcopy.exe. Please run this .bat script in the same directory where avr-objcopy.exe is saved. 19 | pause > nul 20 | exit 21 | ) 22 | 23 | if not exist "%~dp0Createbin.exe" ( 24 | echo Cannot find Createbin.exe. Please run this .bat script in the same directory where Createbin.exe is saved. 25 | pause > nul 26 | exit 27 | ) 28 | 29 | if not exist "%~dp0Chameleon-Mini.eep" ( 30 | echo Cannot find Chameleon-Mini.eep. Please run this .bat script in the same directory where Chameleon-Mini.eep and Chameleon-Mini.hex are saved. 31 | pause > nul 32 | exit 33 | ) 34 | 35 | if not exist "%~dp0Chameleon-Mini.hex" ( 36 | echo Cannot find Chameleon-Mini.hex. Please run this .bat script in the same directory where Chameleon-Mini.eep and Chameleon-Mini.hex are saved. 37 | pause > nul 38 | exit 39 | ) 40 | 41 | echo Creating the EEPROM binary... 42 | "%~dp0avr-objcopy.exe" -I ihex "%~dp0Chameleon-Mini.eep" -O binary eeprom.bin 43 | 44 | "%~dp0Createbin.exe" eeprom.bin bin 45 | 46 | del eeprom.bin 47 | 48 | echo. 49 | echo. 50 | 51 | move myfile.bin myfilee.bin >nul 52 | 53 | echo Creating the Flash binary... 54 | "%~dp0avr-objcopy.exe" -I ihex "%~dp0Chameleon-Mini.hex" -O binary flash.bin 55 | 56 | "%~dp0Createbin.exe" flash.bin bin 57 | 58 | del flash.bin 59 | 60 | echo. 61 | echo. 62 | 63 | echo Flashing the files onto the "Chameleon-Mini Rev-E Rebooted"... 64 | "%~dp0BOOT_LOADER_EXE.exe" 65 | 66 | echo. 67 | 68 | echo If there are no errors above, flashing the firmware to your "Chameleon-Mini Rev-E Rebooted" should be finished now. Enjoy! 69 | -------------------------------------------------------------------------------- /Software/Original-Windows/libusb0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/libusb0.dll -------------------------------------------------------------------------------- /Software/Original-Windows/msvcr120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman1001/ChameleonMini-rebooted/8c8ef70280b337cb0b400ed46981a4484cebc84d/Software/Original-Windows/msvcr120d.dll -------------------------------------------------------------------------------- /Software/Tools/pm3_eml2mfd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | # Andrei Costin , 2011 5 | # pm3_eml2mfd.py 6 | # Converts PM3 Mifare Classic emulator EML text file to MFD binary dump file 7 | ''' 8 | 9 | from __future__ import with_statement 10 | import sys 11 | import binascii 12 | 13 | def main(argv): 14 | argc = len(argv) 15 | if argc < 3: 16 | print 'Usage:', argv[0], 'input.eml output.mfd' 17 | sys.exit(1) 18 | 19 | with file(argv[1], "r") as file_inp, file(argv[2], "wb") as file_out: 20 | for line in file_inp: 21 | line = line.rstrip('\n').rstrip('\r') 22 | print line 23 | data = binascii.unhexlify(line) 24 | file_out.write(data) 25 | 26 | if __name__ == '__main__': 27 | main(sys.argv) 28 | -------------------------------------------------------------------------------- /Software/Tools/pm3_eml_mfd_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from __future__ import with_statement 4 | from tempfile import mkdtemp 5 | from shutil import rmtree 6 | from itertools import imap 7 | from string import hexdigits 8 | import unittest, os 9 | import pm3_eml2mfd, pm3_mfd2eml 10 | 11 | class TestEmlMfd(unittest.TestCase): 12 | def setUp(self): 13 | self.tmpdir = mkdtemp() 14 | 15 | def tearDown(self): 16 | rmtree(self.tmpdir) 17 | 18 | EML2MFD_TESTCASES = [ 19 | ('', ''), 20 | ("41424344\r\n45464748\n494A4B4C\n", "ABCDEFGHIJKL") 21 | ] 22 | def test_eml2mfd(self): 23 | self.three_argument_test(pm3_eml2mfd.main, self.EML2MFD_TESTCASES) 24 | 25 | def test_mfd2eml(self): 26 | self.three_argument_test(pm3_mfd2eml.main, 27 | imap(reversed, self.EML2MFD_TESTCASES), c14n=hex_c14n) 28 | 29 | def three_argument_test(self, operation, cases, c14n=str): 30 | for case_input, case_output in cases: 31 | try: 32 | inp_name = os.path.join(self.tmpdir, 'input') 33 | out_name = os.path.join(self.tmpdir, 'output') 34 | with file(inp_name, 'wb') as in_file: 35 | in_file.write(case_input) 36 | operation(['', inp_name, out_name]) 37 | with file(out_name, 'rb') as out_file: 38 | self.assertEquals(c14n(case_output), c14n(out_file.read())) 39 | finally: 40 | for file_name in inp_name, out_name: 41 | if os.path.exists(file_name): 42 | os.remove(file_name) 43 | 44 | 45 | def hex_c14n(inp): 46 | """ 47 | Canonicalizes the input string by removing non-hexadecimal 48 | characters and making everything uppercase 49 | """ 50 | return ''.join(c.upper() for c in inp if c in hexdigits) 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /Software/Tools/pm3_mfd2eml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | # Andrei Costin , 2011 5 | # pm3_eml2mfd.py 6 | # Converts PM3 Mifare Classic MFD binary dump file to emulator EML text file 7 | ''' 8 | 9 | from __future__ import with_statement 10 | import sys 11 | import binascii 12 | 13 | READ_BLOCKSIZE = 16 14 | 15 | def main(argv): 16 | argc = len(argv) 17 | if argc < 3: 18 | print 'Usage:', argv[0], 'input.mfd output.eml' 19 | sys.exit(1) 20 | 21 | with file(argv[1], "rb") as file_inp, file(argv[2], "w") as file_out: 22 | while True: 23 | byte_s = file_inp.read(READ_BLOCKSIZE) 24 | if not byte_s: 25 | break 26 | hex_char_repr = binascii.hexlify(byte_s) 27 | file_out.write(hex_char_repr) 28 | file_out.write("\n") 29 | 30 | if __name__ == '__main__': 31 | main(sys.argv) 32 | --------------------------------------------------------------------------------