summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/modules
diff options
context:
space:
mode:
authorNicolas Schodet2009-04-10 01:15:42 +0200
committerNicolas Schodet2009-04-10 01:15:42 +0200
commit74298f8ca11dc8d3b0359d1d4e124d6494c3eeac (patch)
tree4c3d2147b99686805d8654dd9552191eab080f1a /digital/avr/modules
parent1431438a2b0f3fafbafb61a4a15296164dadf5e1 (diff)
* digital/avr/modules/usb:
- imported LUFA.
Diffstat (limited to 'digital/avr/modules')
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.c570
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.h135
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.txt40
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.c247
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.h95
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/LUFA CDC Bootloader.inf55
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/CDC/makefile707
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.c692
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.h199
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.txt52
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.c181
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.h166
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/DFU/makefile710
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.c218
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.h91
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.c156
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.h73
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.txt41
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/makefile707
-rw-r--r--digital/avr/modules/usb/lufa/Bootloaders/makefile29
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.c231
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.h90
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.txt48
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.c314
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.h322
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioInput/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.c305
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.h127
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.txt50
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.c314
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.h322
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/AudioOutput/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/CDC.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/CDC.c318
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/CDC.h190
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/CDC.txt45
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.c263
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/LUFA CDC.inf55
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDC/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.c278
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.h89
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.txt42
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.c212
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.h86
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/CDCHost/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.c385
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.h118
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.c358
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.h126
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.txt57
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/LUFA DualCDC.inf56
-rw-r--r--digital/avr/modules/usb/lufa/Demos/DualCDC/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.c250
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.h93
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.c264
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Joystick/makefile700
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.c267
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.c429
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.h116
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.txt43
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Keyboard/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.c267
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.c462
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.h115
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/makefile701
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.c144
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.h74
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.c314
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.h95
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.txt46
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHost/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.c149
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.h74
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c321
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h95
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt47
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.c171
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.h81
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.c119
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.h80
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c345
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h80
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/makefile707
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.c354
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.h104
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.c372
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.h114
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.txt48
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardMouse/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.c267
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.c453
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.h112
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.c325
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.h189
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.c225
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.txt48
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MIDI/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.c316
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.h71
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.c223
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.h71
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.c396
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.h159
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.txt54
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.c350
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.h143
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI_Codes.h85
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorage/makefile704
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.c173
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.h77
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.c420
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.h85
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.txt43
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.c664
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.h176
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/SCSI_Codes.h85
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MassStorageHost/makefile706
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.c251
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.h93
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.c376
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.h115
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.txt43
-rw-r--r--digital/avr/modules/usb/lufa/Demos/Mouse/makefile703
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.c250
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.h93
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.c399
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.h114
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseFullInt/makefile703
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.c155
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.h74
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.c310
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.h95
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.txt47
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHost/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.c149
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.h74
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.c320
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.h96
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.txt48
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.c171
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.h82
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.c119
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.h89
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.c352
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.h80
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/makefile707
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.c250
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.h93
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.c389
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.h111
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.txt44
-rw-r--r--digital/avr/modules/usb/lufa/Demos/MouseViaInt/makefile703
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.c85
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.h76
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.c118
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.h125
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.c263
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.c136
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.h116
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/EthernetProtocols.h87
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.c79
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.h80
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.c111
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.h93
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/LUFA RNDIS.inf52
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.c280
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.h56
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.c386
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.h226
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISConstants.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.c357
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.h108
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.txt62
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.c614
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.h253
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.c80
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.h66
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.c162
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.h55
-rw-r--r--digital/avr/modules/usb/lufa/Demos/RNDISEthernet/makefile715
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.c191
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.h77
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/PIMACodes.h51
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.c273
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.h102
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.c436
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.h83
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.txt40
-rw-r--r--digital/avr/modules/usb/lufa/Demos/StillImageHost/makefile705
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.c187
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.h59
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.c198
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.h62
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.txt51
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.c226
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.h110
-rw-r--r--digital/avr/modules/usb/lufa/Demos/TestApp/makefile710
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.c263
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/LUFA USBtoSerial.inf55
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.c120
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.h116
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.c390
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.h192
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.txt45
-rw-r--r--digital/avr/modules/usb/lufa/Demos/USBtoSerial/makefile704
-rw-r--r--digital/avr/modules/usb/lufa/Demos/makefile121
-rw-r--r--digital/avr/modules/usb/lufa/LUFA.pnproj1
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/BuildingLinkableLibraries.txt22
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/ChangeLog.txt387
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Common/BoardTypes.h72
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Common/ButtLoadTag.h77
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Common/Common.h171
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Common/FunctionAttributes.h110
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/CompileTimeTokens.txt167
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/DirectorySummaries.txt119
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/DriverStubs/Dataflash.h81
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/DriverStubs/HWB.h84
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/DriverStubs/Joystick.h99
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/DriverStubs/LEDs.h121
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/ADC.h58
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/AT90USBXXX67/ADC.h177
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/SPI.h139
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.c65
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.h115
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.c45
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.h82
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h79
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h120
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Dataflash.h210
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/HWB.h87
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Joystick.h85
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/LEDs.h113
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h141
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/AT45DB321C.h84
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Dataflash.h75
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/HWB.h79
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Joystick.h104
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/LEDs.h117
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/AT45DB642D.h94
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Dataflash.h75
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/HWB.h79
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Joystick.h101
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/LEDs.h117
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.c60
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.h100
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/AT45DB642D.h94
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Dataflash.h78
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/HWB.h79
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Joystick.h104
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/LEDs.h117
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/Misc/TerminalCodes.h176
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.c135
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.h258
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.c326
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.h252
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDReportData.h128
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.c39
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.h440
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.c43
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.h523
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.c252
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.h224
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.c257
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.h198
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.c313
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.h135
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Device.h126
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.c387
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.h842
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.c115
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.h245
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.c175
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.h127
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.c260
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.h371
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/OTG.h102
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.c258
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.h788
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StdRequestType.h191
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h87
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/USBMode.h77
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Drivers/USB/USB.h83
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/GettingStarted.txt117
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/MainPage.txt75
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.c226
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.h182
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/MigrationInformation.txt227
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.c95
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.h262
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/SchedulerOverview.txt31
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/VIDAndPIDValues.txt224
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/Version.h49
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/WritingBoardDrivers.txt26
-rw-r--r--digital/avr/modules/usb/lufa/LUFA/makefile42
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Firmware_Design.txt176
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.c886
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.h194
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.txt89
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer_Picture.jpgbin0 -> 74610 bytes
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.c263
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.h98
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/LUFA AVRISP_Programmer.inf55
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.c120
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.h116
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Sample_Programming_Session.txt104
-rw-r--r--digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/makefile702
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.c113
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.h90
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.c247
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.h99
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Doxygen.conf1485
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.aps1
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.c436
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.h121
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.txt85
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/MagstripeHW.h100
-rw-r--r--digital/avr/modules/usb/lufa/Projects/Magstripe/makefile710
-rw-r--r--digital/avr/modules/usb/lufa/Projects/makefile25
-rw-r--r--digital/avr/modules/usb/lufa/makefile27
395 files changed, 119098 insertions, 0 deletions
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.aps b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.aps
new file mode 100644
index 00000000..a0f0e756
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>BootloaderCDC</ProjectName><Created>30-Sep-2008 14:20:09</Created><LastEdit>30-Sep-2008 14:20:30</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:20:09</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>BootloaderCDC.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\CDC\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>BootloaderCDC.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><HEADERFILE>BootloaderCDC.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>BootloaderCDC.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\CDC\BootloaderCDC.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\CDC\Descriptors.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\CDC\BootloaderCDC.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\CDC\Descriptors.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.c b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.c
new file mode 100644
index 00000000..654eabd2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.c
@@ -0,0 +1,570 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the CDC class bootloader. This file contains the complete bootloader logic.
+ */
+
+#define INCLUDE_FROM_BOOTLOADERCDC_C
+#include "BootloaderCDC.h"
+
+/* Globals: */
+/** Line coding options for the virtual serial port. Although the virtual serial port data is never
+ * sent through a physical serial port, the line encoding data must still be read and preserved from
+ * the host, or the host will detect a problem and fail to open the port. This structure contains the
+ * current encoding options, including baud rate, character format, parity mode and total number of
+ * bits in each data chunk.
+ */
+CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** Current address counter. This stores the current address of the FLASH or EEPROM as set by the host,
+ * and is used when reading or writing to the AVRs memory (either FLASH or EEPROM depending on the issued
+ * command.)
+ */
+uint16_t CurrAddress;
+
+/** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run
+ * via a soft reset. When cleared, the bootloader will abort, the USB interface will shut down and the application
+ * jumped to via an indirect jump to location 0x0000.
+ */
+bool RunBootloader = true;
+
+
+/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
+ * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start
+ * the loaded application code.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Relocate the interrupt vector table to the bootloader section */
+ MCUCR = (1 << IVCE);
+ MCUCR = (1 << IVSEL);
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ while (RunBootloader)
+ {
+ USB_USBTask();
+ CDC_Task();
+ }
+
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Wait until any pending transmissions have completed before shutting down */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Shut down the USB subsystem */
+ USB_ShutDown();
+
+ /* Relocate the interrupt vector table back to the application section */
+ MCUCR = (1 << IVCE);
+ MCUCR = 0;
+
+ /* Reset any used hardware ports back to their defaults */
+ PORTD = 0;
+ DDRD = 0;
+
+ #if defined(PORTE)
+ PORTE = 0;
+ DDRE = 0;
+ #endif
+
+ /* Re-enable RWW section */
+ boot_rww_enable();
+
+ /* Start the user application */
+ AppPtr_t AppStartPtr = (AppPtr_t)0x0000;
+ AppStartPtr();
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user
+ * application started.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Upon disconnection, run user application */
+ RunBootloader = false;
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
+ * to relay data to and from the attached USB host.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library, so that they can be handled appropriately
+ * for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* LineCodingData = (uint8_t*)&LineCoding;
+
+ Endpoint_Discard_Word();
+
+ /* Process CDC specific control requests */
+ switch (bRequest)
+ {
+ case REQ_GetLineEncoding:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ for (uint8_t i = 0; i < sizeof(LineCoding); i++)
+ Endpoint_Write_Byte(*(LineCodingData++));
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetLineEncoding:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ for (uint8_t i = 0; i < sizeof(LineCoding); i++)
+ *(LineCodingData++) = Endpoint_Read_Byte();
+
+ Endpoint_ClearSetupOUT();
+
+ while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetControlLineState:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Reads or writes a block of EEPROM or FLASH memory to or from the appropriate CDC data endpoint, depending
+ * on the AVR910 protocol command issued.
+ *
+ * \param Command Single character AVR910 protocol command indicating what memory operation to perform
+ */
+static void ProgramReadWriteMemoryBlock(const uint8_t Command)
+{
+ uint16_t BlockSize;
+ char MemoryType;
+
+ bool HighByte = false;
+ uint8_t LowByte = 0;
+
+ BlockSize = (FetchNextCommandByte() << 8);
+ BlockSize |= FetchNextCommandByte();
+
+ MemoryType = FetchNextCommandByte();
+
+ if ((MemoryType == 'E') || (MemoryType == 'F'))
+ {
+ /* Check if command is to read memory */
+ if (Command == 'g')
+ {
+ /* Re-enable RWW section */
+ boot_rww_enable();
+
+ while (BlockSize--)
+ {
+ if (MemoryType == 'E')
+ {
+ /* Read the next EEPROM byte into the endpoint */
+ WriteNextResponseByte(eeprom_read_byte((uint8_t*)CurrAddress));
+
+ /* Increment the address counter after use */
+ CurrAddress++;
+ }
+ else
+ {
+ /* Read the next FLASH byte from the current FLASH page */
+ #if defined(RAMPZ)
+ WriteNextResponseByte(pgm_read_byte_far(((uint32_t)CurrAddress << 1) + HighByte));
+ #else
+ WriteNextResponseByte(pgm_read_byte((CurrAddress << 1) + HighByte));
+ #endif
+
+ /* If both bytes in current word have been read, increment the address counter */
+ if (HighByte)
+ CurrAddress++;
+
+ HighByte ^= 1;
+ }
+ }
+ }
+ else
+ {
+ uint32_t PageStartAddress = ((uint32_t)CurrAddress << 1);
+
+ if (MemoryType == 'F')
+ {
+ boot_page_erase(PageStartAddress);
+ boot_spm_busy_wait();
+ }
+
+ while (BlockSize--)
+ {
+ if (MemoryType == 'E')
+ {
+ /* Write the next EEPROM byte from the endpoint */
+ eeprom_write_byte((uint8_t*)CurrAddress, FetchNextCommandByte());
+
+ /* Increment the address counter after use */
+ CurrAddress++;
+ }
+ else
+ {
+ /* If both bytes in current word have been written, increment the address counter */
+ if (HighByte)
+ {
+ /* Write the next FLASH word to the current FLASH page */
+ boot_page_fill(((uint32_t)CurrAddress << 1), ((FetchNextCommandByte() << 8) | LowByte));
+
+ HighByte = false;
+
+ /* Increment the address counter after use */
+ CurrAddress++;
+ }
+ else
+ {
+ LowByte = FetchNextCommandByte();
+
+ HighByte = true;
+ }
+ }
+ }
+
+ /* If in FLASH programming mode, commit the page after writing */
+ if (MemoryType == 'F')
+ {
+ /* Commit the flash page to memory */
+ boot_page_write(PageStartAddress);
+
+ /* Wait until write operation has completed */
+ boot_spm_busy_wait();
+ }
+
+ /* Send response byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ }
+ else
+ {
+ /* Send error byte back to the host */
+ WriteNextResponseByte('?');
+ }
+}
+
+/** Retrieves the next byte from the host in the CDC data OUT endpoint, and clears the endpoint bank if needed
+ * to allow reception of the next data packet from the host.
+ *
+ * \return Next received byte from the host in the CDC data OUT endpoint
+ */
+static uint8_t FetchNextCommandByte(void)
+{
+ /* Select the OUT endpoint so that the next data byte can be read */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ /* If OUT endpoint empty, clear it and wait for the next packet from the host */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+ while (!(Endpoint_ReadWriteAllowed()));
+ }
+
+ /* Fetch the next byte from the OUT endpoint */
+ return Endpoint_Read_Byte();
+}
+
+/** Writes the next response byte to the CDC data IN endpoint, and sends the endpoint back if needed to free up the
+ * bank when full ready for the next byte in the packet to the host.
+ *
+ * \param Response Next response byte to send to the host
+ */
+static void WriteNextResponseByte(const uint8_t Response)
+{
+ /* Select the IN endpoint so that the next data byte can be written */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* If OUT endpoint empty, clear it and wait for the next packet from the host */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+ while (!(Endpoint_ReadWriteAllowed()));
+ }
+
+ /* Write the next byte to the OUT endpoint */
+ Endpoint_Write_Byte(Response);
+}
+
+/** Task to read in AVR910 commands from the CDC data OUT endpoint, process them, perform the required actions
+ * and send the appropriate response back to the host.
+ */
+TASK(CDC_Task)
+{
+ /* Select the OUT endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ /* Check if endpoint has a command in it sent from the host */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Read in the bootloader command (first byte sent from host) */
+ uint8_t Command = FetchNextCommandByte();
+
+ if ((Command == 'L') || (Command == 'P') || (Command == 'T') || (Command == 'E'))
+ {
+ if (Command == 'E')
+ RunBootloader = false;
+ if (Command == 'T')
+ FetchNextCommandByte();
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 't')
+ {
+ /* Return ATMEGA128 part code - this is only to allow AVRProg to use the bootloader */
+ WriteNextResponseByte(0x44);
+
+ WriteNextResponseByte(0x00);
+ }
+ else if (Command == 'a')
+ {
+ /* Indicate auto-address increment is supported */
+ WriteNextResponseByte('Y');
+ }
+ else if (Command == 'A')
+ {
+ /* Set the current address to that given by the host */
+ CurrAddress = (FetchNextCommandByte() << 8);
+ CurrAddress |= FetchNextCommandByte();
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'p')
+ {
+ /* Indicate serial programmer back to the host */
+ WriteNextResponseByte('S');
+ }
+ else if (Command == 'S')
+ {
+ /* Write the 7-byte software identifier to the endpoint */
+ for (uint8_t CurrByte = 0; CurrByte < 7; CurrByte++)
+ WriteNextResponseByte(SOFTWARE_IDENTIFIER[CurrByte]);
+ }
+ else if (Command == 'V')
+ {
+ WriteNextResponseByte('0' + BOOTLOADER_VERSION_MAJOR);
+ WriteNextResponseByte('0' + BOOTLOADER_VERSION_MINOR);
+ }
+ else if (Command == 's')
+ {
+ WriteNextResponseByte(boot_signature_byte_get(4));
+ WriteNextResponseByte(boot_signature_byte_get(2));
+ WriteNextResponseByte(boot_signature_byte_get(0));
+ }
+ else if (Command == 'b')
+ {
+ WriteNextResponseByte('Y');
+
+ /* Send block size to the host */
+ WriteNextResponseByte(SPM_PAGESIZE >> 8);
+ WriteNextResponseByte(SPM_PAGESIZE & 0xFF);
+ }
+ else if (Command == 'e')
+ {
+ /* Clear the application section of flash */
+ for (uint32_t CurrFlashAddress = 0; CurrFlashAddress < BOOT_START_ADDR; CurrFlashAddress++)
+ {
+ boot_page_erase(CurrFlashAddress);
+ boot_spm_busy_wait();
+ boot_page_write(CurrFlashAddress);
+ boot_spm_busy_wait();
+
+ CurrFlashAddress += SPM_PAGESIZE;
+ }
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'l')
+ {
+ /* Set the lock bits to those given by the host */
+ boot_lock_bits_set(FetchNextCommandByte());
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'r')
+ {
+ WriteNextResponseByte(boot_lock_fuse_bits_get(GET_LOCK_BITS));
+ }
+ else if (Command == 'F')
+ {
+ WriteNextResponseByte(boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS));
+ }
+ else if (Command == 'N')
+ {
+ WriteNextResponseByte(boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS));
+ }
+ else if (Command == 'Q')
+ {
+ WriteNextResponseByte(boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS));
+ }
+ else if ((Command == 'C') || (Command == 'c'))
+ {
+ if (Command == 'c')
+ {
+ /* Increment the address if the second byte is being written */
+ CurrAddress++;
+ }
+
+ /* Write the high byte to the current flash page */
+ boot_page_fill(((uint32_t)CurrAddress << 1), FetchNextCommandByte());
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'm')
+ {
+ /* Commit the flash page to memory */
+ boot_page_write((uint32_t)CurrAddress << 1);
+
+ /* Wait until write operation has completed */
+ boot_spm_busy_wait();
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if ((Command == 'B') || (Command == 'g'))
+ {
+ /* Delegate the block write/read to a seperate function for clarity */
+ ProgramReadWriteMemoryBlock(Command);
+ }
+ else if (Command == 'R')
+ {
+ #if defined(RAMPZ)
+ uint16_t ProgramWord = pgm_read_word_far(((uint32_t)CurrAddress << 1));
+ #else
+ uint16_t ProgramWord = pgm_read_word(CurrAddress << 1);
+ #endif
+
+ WriteNextResponseByte(ProgramWord >> 8);
+ WriteNextResponseByte(ProgramWord & 0xFF);
+ }
+ else if (Command == 'D')
+ {
+ /* Read the byte from the endpoint and write it to the EEPROM */
+ eeprom_write_byte((uint8_t*)CurrAddress, FetchNextCommandByte());
+
+ /* Increment the address after use */
+ CurrAddress++;
+
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'd')
+ {
+ /* Read the EEPROM byte and write it to the endpoint */
+ WriteNextResponseByte(eeprom_read_byte((uint8_t*)CurrAddress));
+
+ /* Increment the address after use */
+ CurrAddress++;
+ }
+ else if (Command == 27)
+ {
+ /* Escape is sync, ignore */
+ }
+ else
+ {
+ /* Unknown command, return fail code */
+ WriteNextResponseByte('?');
+ }
+
+ /* Select the IN endpoint */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Remember if the endpoint is completely full before clearing it */
+ bool IsEndpointFull = !(Endpoint_ReadWriteAllowed());
+
+ /* Send the endpoint data to the host */
+ Endpoint_ClearCurrentBank();
+
+ /* If a full endpoint's worth of data was sent, we need to send an empty packet afterwards to signal end of transfer */
+ if (IsEndpointFull)
+ {
+ while (!(Endpoint_ReadWriteAllowed()));
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Select the OUT endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ /* Acknowledge the command from the host */
+ Endpoint_ClearCurrentBank();
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.h b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.h
new file mode 100644
index 00000000..0d8f1e3d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.h
@@ -0,0 +1,135 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for BootloaderCDC.c.
+ */
+
+#ifndef _CDC_H_
+#define _CDC_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/boot.h>
+ #include <avr/eeprom.h>
+ #include <stdbool.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+
+ /* Macros: */
+ /** CDC Class Specific request to get the line encoding on a CDC-ACM virtual serial port, including the
+ * baud rate, parity, stop bits and data bits.
+ */
+ #define REQ_GetLineEncoding 0x21
+
+ /** CDC Class Specific request to set the line encoding on a CDC-ACM virtual serial port, including the
+ * baud rate, parity, stop bits and data bits.
+ */
+ #define REQ_SetLineEncoding 0x20
+
+ /** CDC Class Specific request to set the state of the serial handshake lines (such as DCD and RTS) on
+ * a CDC-ACM virtual serial port.
+ */
+ #define REQ_SetControlLineState 0x22
+
+ /** Version major of the CDC bootloader. */
+ #define BOOTLOADER_VERSION_MAJOR 0x01
+
+ /** Version minor of the CDC bootloader. */
+ #define BOOTLOADER_VERSION_MINOR 0x00
+
+ /** Hardware version major of the CDC bootloader. */
+ #define BOOTLOADER_HWVERSION_MAJOR 0x01
+
+ /** Hardware version minor of the CDC bootloader. */
+ #define BOOTLOADER_HWVERSION_MINOR 0x00
+
+ /** Eight character bootloader firmware identifier reported to the host when requested */
+ #define SOFTWARE_IDENTIFIER "LUFA-CDC"
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */
+ typedef void (*AppPtr_t)(void) ATTR_NO_RETURN;
+
+ /** Type define for the CDC-ACM virtual serial port line encoding options, including baud rate, format, parity
+ * and size of each data chunk in bits.
+ */
+ typedef struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate in BPS */
+ uint8_t CharFormat; /**< Character format, an entry from the BootloaderCDC_CDC_LineCodingFormats_t enum */
+ uint8_t ParityType; /**< Parity mode, an entry from the BootloaderCDC_CDC_LineCodeingParity_t enum */
+ uint8_t DataBits; /**< Size of each data chunk, in bits */
+ } CDC_Line_Coding_t;
+
+ /* Enums: */
+ /** Enum for the possible line encoding formats on a CDC-ACM virtual serial port */
+ enum BootloaderCDC_CDC_LineCodingFormats_t
+ {
+ OneStopBit = 0, /**< Single stop bit */
+ OneAndAHalfStopBits = 1, /**< 1.5 stop bits */
+ TwoStopBits = 2, /**< Two stop bits */
+ };
+
+ /** Enum for the possible parity modes on a CDC-ACM virtual serial port */
+ enum BootloaderCDC_CDC_LineCodeingParity_t
+ {
+ Parity_None = 0, /**< No data parity checking */
+ Parity_Odd = 1, /**< Odd data parity checking */
+ Parity_Even = 2, /**< Even data parity checking */
+ Parity_Mark = 3, /**< Mark data parity checking */
+ Parity_Space = 4, /**< Space data parity checking */
+ };
+
+ /* Tasks: */
+ TASK(CDC_Task);
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__)
+ static void ProgramReadWriteMemoryBlock(const uint8_t Command);
+ static uint8_t FetchNextCommandByte(void);
+ static void WriteNextResponseByte(const uint8_t Response);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.txt b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.txt
new file mode 100644
index 00000000..cb6f9f01
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/BootloaderCDC.txt
@@ -0,0 +1,40 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage CDC Class USB AVR Bootloader
+ *
+ * This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109
+ * protocol compatible programming software to load firmware onto the AVR.
+ *
+ * Out of the box this bootloader builds for the USB1287, and will fit into 4KB of bootloader space. If
+ * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
+ * values in the accompanying makefile.
+ *
+ * This bootloader is compatible with the open source application AVRDUDE, or Atmel's AVRPROG.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Abstract Control Model (ACM)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.c b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.c
new file mode 100644
index 00000000..ee0e194d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.c
@@ -0,0 +1,247 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x02,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: FIXED_CONTROL_ENDPOINT_SIZE,
+
+ VendorID: 0x03EB,
+ ProductID: 0x204A,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: NO_DESCRIPTOR,
+ ProductStrIndex: 0x01,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in SRAM memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x10, 0x01}
+ },
+
+ CDC_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x01}
+ },
+
+ CDC_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in SRAM memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t ProductString =
+{
+ Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
+
+ UnicodeString: L"AVR CDC Bootloader"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ if (!(DescriptorNumber))
+ {
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = LanguageString.Header.Size;
+ }
+ else
+ {
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = ProductString.Header.Size;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.h b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.h
new file mode 100644
index 00000000..8bd6bdf8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Descriptors.h
@@ -0,0 +1,95 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ /* Macros: */
+ /** Structure for a CDC class Functional descriptor, with a given data size. This is used instead of a
+ * type define so that the same macro can be used for functional descriptors of varying data lengths,
+ * while allowing the sizeof() operator to return correct results.
+ *
+ * \param DataSize Size of the functional descriptor's data payload, in bytes
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number for the CDC control interface event notification endpoint. */
+ #define CDC_NOTIFICATION_EPNUM 3
+
+ /** Size of the CDC control interface notification endpoint bank, in bytes */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Endpoint number for the CDC data interface TX (data IN) endpoint */
+ #define CDC_TX_EPNUM 1
+
+ /** Endpoint number for the CDC data interface RX (data OUT) endpoint */
+ #define CDC_RX_EPNUM 2
+
+ /** Size of the CDC data interface TX and RX data endpoint banks, in bytes */
+ #define CDC_TXRX_EPSIZE 16
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t ManagementEndpoint;
+ USB_Descriptor_Interface_t DCI_Interface;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/Doxygen.conf b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Doxygen.conf
new file mode 100644
index 00000000..5ba226d2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - CDC Class Bootloader"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/LUFA CDC Bootloader.inf b/digital/avr/modules/usb/lufa/Bootloaders/CDC/LUFA CDC Bootloader.inf
new file mode 100644
index 00000000..6df089ab
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/LUFA CDC Bootloader.inf
@@ -0,0 +1,55 @@
+; Windows LUFA CDC Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%COMPANY%
+LayoutFile=layout.inf
+DriverVer=06/06/2006,1.0.0.0
+
+[Manufacturer]
+%MFGNAME% = ManufName
+
+[DestinationDirs]
+DefaultDestDir=12
+
+[ManufName]
+%Modem3% = Modem3, USB\VID_03EB&PID_204A
+
+;------------------------------------------------------------------------------
+; Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[Modem3.nt]
+CopyFiles=USBModemCopyFileSection
+AddReg=Modem3.nt.AddReg
+
+[USBModemCopyFileSection]
+usbser.sys,,,0x20
+
+[Modem3.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[Modem3.nt.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+;------------------------------------------------------------------------------
+; String Definitions
+;------------------------------------------------------------------------------
+
+[Strings]
+COMPANY="LUFA Library"
+MFGNAME="Dean Camera"
+Modem3="USB AVR109 Bootloader"
+SERVICE="USB Virtual Serial Port CDC Driver" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/CDC/makefile b/digital/avr/modules/usb/lufa/Bootloaders/CDC/makefile
new file mode 100644
index 00000000..532fc17a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/CDC/makefile
@@ -0,0 +1,707 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = BootloaderCDC
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Starting byte address of the bootloader
+BOOT_START = 0x1E000
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DSTATIC_ENDPOINT_CONFIGURATION
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -fno-inline-small-functions
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.aps b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.aps
new file mode 100644
index 00000000..4d0f40b7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>BootloaderDFU</ProjectName><Created>30-Sep-2008 14:20:47</Created><LastEdit>30-Sep-2008 14:21:00</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:20:47</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Bootloaders\DFU\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>BootloaderDFU.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><HEADERFILE>BootloaderDFU.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>BootloaderDFU.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.c b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.c
new file mode 100644
index 00000000..a997b207
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.c
@@ -0,0 +1,692 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the DFU class bootloader. This file contains the complete bootloader logic.
+ */
+
+/** Configuration define. Define this token to true to case the bootloader to reject all memory commands
+ * until a memory erase has been performed. When used in conjunction with the lockbits of the AVR, this
+ * can protect the AVR's firmware from being dumped from a secured AVR. When false, memory operations are
+ * allowed at any time.
+ */
+#define SECURE_MODE false
+
+#define INCLUDE_FROM_BOOTLOADER_C
+#include "BootloaderDFU.h"
+
+/** Flag to indicate if the bootloader is currently running in secure mode, disallowing memory operations
+ * other than erase. This is initially set to the value set by SECURE_MODE, and cleared by the bootloader
+ * once a memory erase has completed.
+ */
+bool IsSecure = SECURE_MODE;
+
+/** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run
+ * via a soft reset. When cleared, the bootloader will abort, the USB interface will shut down and the application
+ * jumped to via an indirect jump to location 0x0000 (or other location specified by the host).
+ */
+bool RunBootloader = true;
+
+/** Flag to indicate if the bootloader is waiting to exit. When the host requests the bootloader to exit and
+ * jump to the application address it specifies, it sends two sequential commands which must be properly
+ * acknowedged. Upon reception of the first the RunBootloader flag is cleared and the WaitForExit flag is set,
+ * causing the bootloader to wait for the final exit command before shutting down.
+ */
+bool WaitForExit = false;
+
+/** Current DFU state machine state, one of the values in the DFU_State_t enum. */
+uint8_t DFU_State = dfuIDLE;
+
+/** Status code of the last executed DFU command. This is set to one of the values in the DFU_Status_t enum after
+ * each operation, and returned to the host when a Get Status DFU request is issued.
+ */
+uint8_t DFU_Status = OK;
+
+/** Data containing the DFU command sent from the host. */
+DFU_Command_t SentCommand;
+
+/** Response to the last issued Read Data DFU command. Unlike other DFU commands, the read command
+ * requires a single byte response from the bootloader containing the read data when the next DFU_UPLOAD command
+ * is issued by the host.
+ */
+uint8_t ResponseByte;
+
+/** Pointer to the start of the user application. By default this is 0x0000 (the reset vector), however the host
+ * may specify an alternate address when issuing the application soft-start command.
+ */
+AppPtr_t AppStartPtr = (AppPtr_t)0x0000;
+
+/** 64-bit flash page number. This is concatenated with the current 16-bit address on USB AVRs containing more than
+ * 64KB of flash memory.
+ */
+uint8_t Flash64KBPage = 0;
+
+/** Memory start address, indicating the current address in the memory being addressed (either FLASH or EEPROM
+ * depending on the issued command from the host).
+ */
+uint16_t StartAddr = 0x0000;
+
+/** Memory end address, indicating the end address to read to/write from in the memory being addressed (either FLASH
+ * of EEPROM depending on the issued command from the host).
+ */
+uint16_t EndAddr = 0x0000;
+
+/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
+ * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start
+ * the loaded application code.
+ */
+int main (void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Relocate the interrupt vector table to the bootloader section */
+ MCUCR = (1 << IVCE);
+ MCUCR = (1 << IVSEL);
+
+ /* Initialize the USB subsystem */
+ USB_Init();
+
+ /* Run the USB management task while the bootloader is supposed to be running */
+ while (RunBootloader || WaitForExit)
+ USB_USBTask();
+
+ /* Shut down the USB subsystem */
+ USB_ShutDown();
+
+ /* Relocate the interrupt vector table back to the application section */
+ MCUCR = (1 << IVCE);
+ MCUCR = 0;
+
+ /* Reset any used hardware ports back to their defaults */
+ PORTD = 0;
+ DDRD = 0;
+
+ #if defined(PORTE)
+ PORTE = 0;
+ DDRE = 0;
+ #endif
+
+ /* Start the user application */
+ AppStartPtr();
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user
+ * application started.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Upon disconnection, run user application */
+ RunBootloader = false;
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the DFU commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Discard unused wIndex value */
+ Endpoint_Discard_Word();
+
+ /* Discard unused wValue value */
+ Endpoint_Discard_Word();
+
+ /* Get the size of the command and data from the wLength value */
+ SentCommand.DataSize = Endpoint_Read_Word_LE();
+
+ switch (bRequest)
+ {
+ case DFU_DNLOAD:
+ Endpoint_ClearSetupReceived();
+
+ /* Check if bootloader is waiting to terminate */
+ if (WaitForExit)
+ {
+ /* Bootloader is terminating - process last received command */
+ ProcessBootloaderCommand();
+
+ /* Indicate that the last command has now been processed - free to exit bootloader */
+ WaitForExit = false;
+ }
+
+ /* If the request has a data stage, load it into the command struct */
+ if (SentCommand.DataSize)
+ {
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* First byte of the data stage is the DNLOAD request's command */
+ SentCommand.Command = Endpoint_Read_Byte();
+
+ /* One byte of the data stage is the command, so subtract it from the total data bytes */
+ SentCommand.DataSize--;
+
+ /* Load in the rest of the data stage as command parameters */
+ for (uint8_t DataByte = 0; (DataByte < sizeof(SentCommand.Data)) &&
+ Endpoint_BytesInEndpoint(); DataByte++)
+ {
+ SentCommand.Data[DataByte] = Endpoint_Read_Byte();
+ SentCommand.DataSize--;
+ }
+
+ /* Process the command */
+ ProcessBootloaderCommand();
+ }
+
+ /* Check if currently downloading firmware */
+ if (DFU_State == dfuDNLOAD_IDLE)
+ {
+ if (!(SentCommand.DataSize))
+ {
+ DFU_State = dfuIDLE;
+ }
+ else
+ {
+ /* Throw away the filler bytes before the start of the firmware */
+ DiscardFillerBytes(DFU_FILLER_BYTES_SIZE);
+
+ /* Throw away the page alignment filler bytes before the start of the firmware */
+ DiscardFillerBytes(StartAddr % SPM_PAGESIZE);
+
+ /* Calculate the number of bytes remaining to be written */
+ uint16_t BytesRemaining = ((EndAddr - StartAddr) + 1);
+
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Write flash
+ {
+ /* Calculate the number of words to be written from the number of bytes to be written */
+ uint16_t WordsRemaining = (BytesRemaining >> 1);
+
+ union
+ {
+ uint16_t Words[2];
+ uint32_t Long;
+ } CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
+
+ uint32_t CurrFlashPageStartAddress = CurrFlashAddress.Long;
+ uint8_t WordsInFlashPage = 0;
+
+ while (WordsRemaining--)
+ {
+ /* Check if endpoint is empty - if so clear it and wait until ready for next packet */
+ if (!(Endpoint_BytesInEndpoint()))
+ {
+ Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsSetupOUTReceived()));
+ }
+
+ /* Write the next word into the current flash page */
+ boot_page_fill(CurrFlashAddress.Long, Endpoint_Read_Word_LE());
+
+ /* Adjust counters */
+ WordsInFlashPage += 1;
+ CurrFlashAddress.Long += 2;
+
+ /* See if an entire page has been written to the flash page buffer */
+ if ((WordsInFlashPage == (SPM_PAGESIZE >> 1)) || !(WordsRemaining))
+ {
+ /* Commit the flash page to memory */
+ boot_page_write(CurrFlashPageStartAddress);
+ boot_spm_busy_wait();
+
+ /* Check if programming incomplete */
+ if (WordsRemaining)
+ {
+ CurrFlashPageStartAddress = CurrFlashAddress.Long;
+ WordsInFlashPage = 0;
+
+ /* Erase next page's temp buffer */
+ boot_page_erase(CurrFlashAddress.Long);
+ boot_spm_busy_wait();
+ }
+ }
+ }
+
+ /* Once programming complete, start address equals the end address */
+ StartAddr = EndAddr;
+
+ /* Re-enable the RWW section of flash */
+ boot_rww_enable();
+ }
+ else // Write EEPROM
+ {
+ while (BytesRemaining--)
+ {
+ /* Check if endpoint is empty - if so clear it and wait until ready for next packet */
+ if (!(Endpoint_BytesInEndpoint()))
+ {
+ Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsSetupOUTReceived()));
+ }
+
+ /* Read the byte from the USB interface and write to to the EEPROM */
+ eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_Byte());
+
+ /* Adjust counters */
+ StartAddr++;
+ }
+ }
+
+ /* Throw away the currently unused DFU file suffix */
+ DiscardFillerBytes(DFU_FILE_SUFFIX_SIZE);
+ }
+ }
+
+ Endpoint_ClearSetupOUT();
+
+ /* Send ZLP to the host to acknowedge the request */
+ Endpoint_ClearSetupIN();
+
+ break;
+ case DFU_UPLOAD:
+ Endpoint_ClearSetupReceived();
+
+ while (!(Endpoint_IsSetupINReady()));
+
+ if (DFU_State != dfuUPLOAD_IDLE)
+ {
+ if ((DFU_State == dfuERROR) && IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Blank Check
+ {
+ /* Blank checking is performed in the DFU_DNLOAD request - if we get here we've told the host
+ that the memory isn't blank, and the host is requesting the first non-blank address */
+ Endpoint_Write_Word_LE(StartAddr);
+ }
+ else
+ {
+ /* Idle state upload - send response to last issued command */
+ Endpoint_Write_Byte(ResponseByte);
+ }
+ }
+ else
+ {
+ /* Determine the number of bytes remaining in the current block */
+ uint16_t BytesRemaining = ((EndAddr - StartAddr) + 1);
+
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Read FLASH
+ {
+ /* Calculate the number of words to be written from the number of bytes to be written */
+ uint16_t WordsRemaining = (BytesRemaining >> 1);
+
+ union
+ {
+ uint16_t Words[2];
+ uint32_t Long;
+ } CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
+
+ while (WordsRemaining--)
+ {
+ /* Check if endpoint is full - if so clear it and wait until ready for next packet */
+ if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)
+ {
+ Endpoint_ClearSetupIN();
+ while (!(Endpoint_IsSetupINReady()));
+ }
+
+ /* Read the flash word and send it via USB to the host */
+ #if defined(RAMPZ)
+ Endpoint_Write_Word_LE(pgm_read_word_far(CurrFlashAddress.Long));
+ #else
+ Endpoint_Write_Word_LE(pgm_read_word(CurrFlashAddress.Long));
+ #endif
+
+ /* Adjust counters */
+ CurrFlashAddress.Long += 2;
+ }
+
+ /* Once reading is complete, start address equals the end address */
+ StartAddr = EndAddr;
+ }
+ else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x02)) // Read EEPROM
+ {
+ while (BytesRemaining--)
+ {
+ /* Check if endpoint is full - if so clear it and wait until ready for next packet */
+ if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)
+ {
+ Endpoint_ClearSetupIN();
+ while (!(Endpoint_IsSetupINReady()));
+ }
+
+ /* Read the EEPROM byte and send it via USB to the host */
+ Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)StartAddr));
+
+ /* Adjust counters */
+ StartAddr++;
+ }
+ }
+
+ /* Return to idle state */
+ DFU_State = dfuIDLE;
+ }
+
+ Endpoint_ClearSetupIN();
+
+ /* Send ZLP to the host to acknowedge the request */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+
+ break;
+ case DFU_GETSTATUS:
+ Endpoint_ClearSetupReceived();
+
+ /* Write 8-bit status value */
+ Endpoint_Write_Byte(DFU_Status);
+
+ /* Write 24-bit poll timeout value */
+ Endpoint_Write_Byte(0);
+ Endpoint_Write_Word_LE(0);
+
+ /* Write 8-bit state value */
+ Endpoint_Write_Byte(DFU_State);
+
+ /* Write 8-bit state string ID number */
+ Endpoint_Write_Byte(0);
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+
+ break;
+ case DFU_CLRSTATUS:
+ Endpoint_ClearSetupReceived();
+
+ /* Reset the status value variable to the default OK status */
+ DFU_Status = OK;
+
+ Endpoint_ClearSetupIN();
+
+ break;
+ case DFU_GETSTATE:
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current device state to the endpoint */
+ Endpoint_Write_Byte(DFU_State);
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+
+ break;
+ case DFU_ABORT:
+ Endpoint_ClearSetupReceived();
+
+ /* Reset the current state variable to the default idle state */
+ DFU_State = dfuIDLE;
+
+ Endpoint_ClearSetupIN();
+
+ break;
+ }
+}
+
+/** Routine to discard the specified number of bytes from the control endpoint stream. This is used to
+ * discard unused bytes in the stream from the host, including the memory program block suffix.
+ *
+ * \param NumberOfBytes Number of bytes to discard from the host from the control endpoint
+ */
+static void DiscardFillerBytes(uint8_t NumberOfBytes)
+{
+ while (NumberOfBytes--)
+ {
+ if (!(Endpoint_BytesInEndpoint()))
+ {
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until next data packet received */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ }
+
+ Endpoint_Discard_Byte();
+ }
+}
+
+/** Routine to process an issued command from the host, via a DFU_DNLOAD request wrapper. This routine ensures
+ * that the command is allowed based on the current secure mode flag value, and passes the command off to the
+ * appropriate handler function.
+ */
+static void ProcessBootloaderCommand(void)
+{
+ /* Check if device is in secure mode */
+ if (IsSecure)
+ {
+ /* Don't process command unless it is a READ or chip erase command */
+ if (!(((SentCommand.Command == COMMAND_WRITE) &&
+ IS_TWOBYTE_COMMAND(SentCommand.Data, 0x00, 0xFF)) ||
+ (SentCommand.Command == COMMAND_READ)))
+ {
+ /* Set the state and status variables to indicate the error */
+ DFU_State = dfuERROR;
+ DFU_Status = errWRITE;
+
+ /* Stall command */
+ Endpoint_StallTransaction();
+
+ /* Don't process the command */
+ return;
+ }
+ }
+
+ /* Dispatch the required command processing routine based on the command type */
+ switch (SentCommand.Command)
+ {
+ case COMMAND_PROG_START:
+ ProcessMemProgCommand();
+ break;
+ case COMMAND_DISP_DATA:
+ ProcessMemReadCommand();
+ break;
+ case COMMAND_WRITE:
+ ProcessWriteCommand();
+ break;
+ case COMMAND_READ:
+ ProcessReadCommand();
+ break;
+ case COMMAND_CHANGE_BASE_ADDR:
+ if (IS_TWOBYTE_COMMAND(SentCommand.Data, 0x03, 0x00)) // Set 64KB flash page command
+ Flash64KBPage = SentCommand.Data[2];
+
+ break;
+ }
+}
+
+/** Routine to concatenate the given pair of 16-bit memory start and end addresses from the host, and store them
+ * in the StartAddr and EndAddr global variables.
+ */
+static void LoadStartEndAddresses(void)
+{
+ union
+ {
+ uint8_t Bytes[2];
+ uint16_t Word;
+ } Address[2] = {{Bytes: {SentCommand.Data[2], SentCommand.Data[1]}},
+ {Bytes: {SentCommand.Data[4], SentCommand.Data[3]}}};
+
+ /* Load in the start and ending read addresses from the sent data packet */
+ StartAddr = Address[0].Word;
+ EndAddr = Address[1].Word;
+}
+
+/** Handler for a Memory Program command issued by the host. This routine handles the preperations needed
+ * to write subsequent data from the host into the specified memory.
+ */
+static void ProcessMemProgCommand(void)
+{
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00) || // Write FLASH command
+ IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Write EEPROM command
+ {
+ /* Load in the start and ending read addresses */
+ LoadStartEndAddresses();
+
+ /* If FLASH is being written to, we need to pre-erase the first page to write to */
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00))
+ {
+ union
+ {
+ uint16_t Words[2];
+ uint32_t Long;
+ } CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
+
+ /* Erase the current page's temp buffer */
+ boot_page_erase(CurrFlashAddress.Long);
+ boot_spm_busy_wait();
+ }
+
+ /* Set the state so that the next DNLOAD requests reads in the firmware */
+ DFU_State = dfuDNLOAD_IDLE;
+ }
+}
+
+/** Handler for a Memory Read command issued by the host. This routine handles the preperations needed
+ * to read subsequent data from the specified memory out to the host, as well as implementing the memory
+ * blank check command.
+ */
+static void ProcessMemReadCommand(void)
+{
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00) || // Read FLASH command
+ IS_ONEBYTE_COMMAND(SentCommand.Data, 0x02)) // Read EEPROM command
+ {
+ /* Load in the start and ending read addresses */
+ LoadStartEndAddresses();
+
+ /* Set the state so that the next UPLOAD requests read out the firmware */
+ DFU_State = dfuUPLOAD_IDLE;
+ }
+ else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Blank check FLASH command
+ {
+ uint32_t CurrFlashAddress = 0;
+
+ while (CurrFlashAddress < BOOT_START_ADDR)
+ {
+ /* Check if the current byte is not blank */
+ #if defined(RAMPZ)
+ if (pgm_read_byte_far(CurrFlashAddress) != 0xFF)
+ #else
+ if (pgm_read_byte(CurrFlashAddress) != 0xFF)
+ #endif
+ {
+ /* Save the location of the first non-blank byte for response back to the host */
+ Flash64KBPage = (CurrFlashAddress >> 16);
+ StartAddr = CurrFlashAddress;
+
+ /* Set state and status variables to the appropriate error values */
+ DFU_State = dfuERROR;
+ DFU_Status = errCHECK_ERASED;
+
+ break;
+ }
+
+ CurrFlashAddress++;
+ }
+ }
+}
+
+/** Handler for a Data Write command issued by the host. This routine handles non-programming commands such as
+ * bootloader exit (both via software jumps and hardware watchdog resets) and flash memory erasure.
+ */
+static void ProcessWriteCommand(void)
+{
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x03)) // Start application
+ {
+ /* Indicate that the bootloader is terminating */
+ WaitForExit = true;
+
+ /* Check if empty request data array - an empty request after a filled request retains the
+ previous valid request data, but initializes the reset */
+ if (!(SentCommand.DataSize))
+ {
+ if (SentCommand.Data[1] == 0x00) // Start via watchdog
+ {
+ /* Start the watchdog to reset the AVR once the communications are finalized */
+ wdt_enable(WDTO_250MS);
+ }
+ else // Start via jump
+ {
+ /* Load in the jump address into the application start address pointer */
+ union
+ {
+ uint8_t Bytes[2];
+ AppPtr_t FuncPtr;
+ } Address = {Bytes: {SentCommand.Data[4], SentCommand.Data[3]}};
+
+ AppStartPtr = Address.FuncPtr;
+
+ /* Set the flag to terminate the bootloader at next opportunity */
+ RunBootloader = false;
+ }
+ }
+ }
+ else if (IS_TWOBYTE_COMMAND(SentCommand.Data, 0x00, 0xFF)) // Erase flash
+ {
+ uint32_t CurrFlashAddress = 0;
+
+ /* Clear the application section of flash */
+ while (CurrFlashAddress < BOOT_START_ADDR)
+ {
+ boot_page_erase(CurrFlashAddress);
+ boot_spm_busy_wait();
+ boot_page_write(CurrFlashAddress);
+ boot_spm_busy_wait();
+
+ CurrFlashAddress += SPM_PAGESIZE;
+ }
+
+ /* Re-enable the RWW section of flash as writing to the flash locks it out */
+ boot_rww_enable();
+
+ /* Memory has been erased, reset the security bit so that programming/reading is allowed */
+ IsSecure = false;
+ }
+}
+
+/** Handler for a Data Read command issued by the host. This routine handles bootloader information retrieval
+ * commands such as device signature and bootloader version retrieval.
+ */
+static void ProcessReadCommand(void)
+{
+ const uint8_t BootloaderInfo[3] = {BOOTLOADER_VERSION, BOOTLOADER_ID_BYTE1, BOOTLOADER_ID_BYTE2};
+ const uint8_t SignatureInfo[3] = {SIGNATURE_BYTE_1, SIGNATURE_BYTE_2, SIGNATURE_BYTE_3};
+
+ uint8_t DataIndexToRead = SentCommand.Data[1];
+
+ if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Read bootloader info
+ {
+ ResponseByte = BootloaderInfo[DataIndexToRead];
+ }
+ else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Read signature byte
+ {
+ ResponseByte = SignatureInfo[DataIndexToRead - 0x30];
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.h b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.h
new file mode 100644
index 00000000..e5c680d2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.h
@@ -0,0 +1,199 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for BootloaderDFU.c.
+ */
+
+#ifndef _BOOTLOADER_H_
+#define _BOOTLOADER_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/boot.h>
+ #include <avr/eeprom.h>
+ #include <stdbool.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+
+ /* Macros: */
+ /** Major bootloader version number. */
+ #define BOOTLOADER_VERSION_MINOR 2
+
+ /** Minor bootloader version number. */
+ #define BOOTLOADER_VERSION_REV 0
+
+ /** Complete bootloder version number expressed as a packed byte, constructed from the
+ * two individual bootloader version macros.
+ */
+ #define BOOTLOADER_VERSION ((BOOTLOADER_VERSION_MINOR << 4) | BOOTLOADER_VERSION_REV)
+
+ /** First byte of the bootloader identification bytes, used to identify a device's bootloader. */
+ #define BOOTLOADER_ID_BYTE1 0xDC
+
+ /** Second byte of the bootloader identification bytes, used to identify a device's bootloader. */
+ #define BOOTLOADER_ID_BYTE2 0xFB
+
+ /** Convenience macro, used to determine if the issued command is the given one-byte long command.
+ *
+ * \param dataarr Command byte array to check against
+ * \param cb1 First command byte to check
+ */
+ #define IS_ONEBYTE_COMMAND(dataarr, cb1) (dataarr[0] == cb1)
+
+ /** Convenience macro, used to determine if the issued command is the given two-byte long command.
+ *
+ * \param dataarr Command byte array to check against
+ * \param cb1 First command byte to check
+ * \param cb2 Second command byte to check
+ */
+ #define IS_TWOBYTE_COMMAND(dataarr, cb1, cb2) ((dataarr[0] == cb1) && (dataarr[1] == cb2))
+
+ /** Length of the DFU file suffix block, appended to the end of each complete memory write command.
+ * The DFU file suffix is currently unused (but is designed to give extra file information, such as
+ * a CRC of the complete firmware for error checking) and so is discarded.
+ */
+ #define DFU_FILE_SUFFIX_SIZE 16
+
+ /** Length of the DFU file filler block, appended to the start of each complete memory write command.
+ * Filler bytes are added to the start of each complete memory write command, and must be discarded.
+ */
+ #define DFU_FILLER_BYTES_SIZE 26
+
+ /** DFU class command request to detatch from the host. */
+ #define DFU_DETATCH 0x00
+
+ /** DFU class command request to send data from the host to the bootloader. */
+ #define DFU_DNLOAD 0x01
+
+ /** DFU class command request to send data from the bootloader to the host. */
+ #define DFU_UPLOAD 0x02
+
+ /** DFU class command request to get the current DFU status and state from the bootloader. */
+ #define DFU_GETSTATUS 0x03
+
+ /** DFU class command request to reset the current DFU status and state variables to their defaults. */
+ #define DFU_CLRSTATUS 0x04
+
+ /** DFU class command request to get the current DFU state of the bootloader. */
+ #define DFU_GETSTATE 0x05
+
+ /** DFU class command request to abort the current multi-request transfer and return to the dfuIDLE state. */
+ #define DFU_ABORT 0x06
+
+ /** DFU command to begin programming the device's memory. */
+ #define COMMAND_PROG_START 0x01
+
+ /** DFU command to begin reading the device's memory. */
+ #define COMMAND_DISP_DATA 0x03
+
+ /** DFU command to issue a write command. */
+ #define COMMAND_WRITE 0x04
+
+ /** DFU command to issue a read command. */
+ #define COMMAND_READ 0x05
+
+ /** DFU command to issue a memory base address change command, to set the current 64KB flash page
+ * that subsequent flash operations should use. */
+ #define COMMAND_CHANGE_BASE_ADDR 0x06
+
+ /* Type Defines: */
+ /** Type define for a non-returning function pointer to the loaded application. */
+ typedef void (*AppPtr_t)(void) ATTR_NO_RETURN;
+
+ /** Type define for a strucuture containing a complete DFU command issued by the host. */
+ typedef struct
+ {
+ uint8_t Command; /**< Single byte command to perform, one of the COMMAND_* macro values */
+ uint8_t Data[5]; /**< Command parameters */
+ uint16_t DataSize; /**< Size of the command parameters */
+ } DFU_Command_t;
+
+ /* Enums: */
+ /** DFU bootloader states. Refer to the DFU class specification for information on each state. */
+ enum DFU_State_t
+ {
+ appIDLE = 0,
+ appDETACH = 1,
+ dfuIDLE = 2,
+ dfuDNLOAD_SYNC = 3,
+ dfuDNBUSY = 4,
+ dfuDNLOAD_IDLE = 5,
+ dfuMANIFEST_SYNC = 6,
+ dfuMANIFEST = 7,
+ dfuMANIFEST_WAIT_RESET = 8,
+ dfuUPLOAD_IDLE = 9,
+ dfuERROR = 10
+ };
+
+ /** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
+ enum DFU_Status_t
+ {
+ OK = 0,
+ errTARGET = 1,
+ errFILE = 2,
+ errWRITE = 3,
+ errERASE = 4,
+ errCHECK_ERASED = 5,
+ errPROG = 6,
+ errVERIFY = 7,
+ errADDRESS = 8,
+ errNOTDONE = 9,
+ errFIRMWARE = 10,
+ errVENDOR = 11,
+ errUSBR = 12,
+ errPOR = 13,
+ errUNKNOWN = 14,
+ errSTALLEDPKT = 15
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_BOOTLOADER_C)
+ static void DiscardFillerBytes(uint8_t NumberOfBytes);
+ static void ProcessBootloaderCommand(void);
+ static void LoadStartEndAddresses(void);
+ static void ProcessMemProgCommand(void);
+ static void ProcessMemReadCommand(void);
+ static void ProcessWriteCommand(void);
+ static void ProcessReadCommand(void);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.txt b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.txt
new file mode 100644
index 00000000..091ce408
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/BootloaderDFU.txt
@@ -0,0 +1,52 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage DFU Class USB AVR Bootloader
+ *
+ * This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming
+ * software to load firmware onto the AVR.
+ *
+ * This bootloader is compatible with Atmel's FLIP application. However, it requires the use of Atmel's
+ * DFU drivers. You will need to install Atmel's DFU drivers prior to using this bootloader.
+ *
+ * As an open-source option, this bootloader is also compatible with the Linux Atmel USB DFU Programmer
+ * software, available for download at http://sourceforge.net/projects/dfu-programmer/.
+ *
+ * If SECURE_MODE is defined as true, upon startup the bootloader will be locked, with only the chip erase
+ * function available (similar to Atmel's DFU bootloader). If SECURE_MODE is defined as false, all functions
+ * are usable on startup without the prerequisite firmware erase.
+ *
+ * Out of the box this bootloader builds for the USB1287, and should fit into 4KB of bootloader space. If
+ * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
+ * values in the accompanying makefile.
+ *
+ * <b>NOTE:</b> This device spoofs Atmel's DFU Bootloader USB VID and PID so that the Atmel DFU bootloader
+ * drivers included with FLIP will work. If you do not wish to use Atmel's ID codes, please
+ * manually change them in Descriptors.c and alter your driver's INF file accordingly.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Device Firmware Update Class (DFU)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>None</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF DFU Class Standard, Atmel USB Bootloader Datasheet</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.c b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.c
new file mode 100644
index 00000000..3a1c69c7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.c
@@ -0,0 +1,181 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: FIXED_CONTROL_ENDPOINT_SIZE,
+
+ VendorID: 0x03EB,
+ ProductID: PRODUCT_ID_CODE,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: NO_DESCRIPTOR,
+ ProductStrIndex: 0x01,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ DFUInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0xFE,
+ SubClass: 0x01,
+ Protocol: 0x02,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DFUFunctional:
+ {
+ Header: {Size: sizeof(USB_DFU_Functional_Descriptor_t), Type: DTYPE_DFUFunctional},
+
+ Attributes: (ATTR_CAN_UPLOAD | ATTR_CAN_DOWNLOAD),
+
+ DetatchTimeout: 0x0000,
+ TransferSize: 0x0c00,
+
+ DFUSpecification: VERSION_BCD(01.01)
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"AVR DFU Bootloader"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ if (!(DescriptorNumber))
+ {
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = LanguageString.Header.Size;
+ }
+ else
+ {
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = ProductString.Header.Size;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.h b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.h
new file mode 100644
index 00000000..b6d1a2af
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Descriptors.h
@@ -0,0 +1,166 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ /* Macros: */
+ /** Descriptor type value for a DFU class functional descriptor. */
+ #define DTYPE_DFUFunctional 0x21
+
+ /** DFU attribute mask, indicating that the DFU device will detach and re-attach when a DFU_DETACH
+ * command is issued, rather than the host issing a USB Reset.
+ */
+ #define ATTR_WILL_DETATCH (1 << 3)
+
+ /** DFU attribute mask, indicating that the DFU device can communicate during the manefestation phase
+ * (memory programming phase).
+ */
+ #define ATTR_MANEFESTATION_TOLLERANT (1 << 2)
+
+ /** DFU attribute mask, indicating that the DFU device can accept DFU_UPLOAD requests to send data from
+ * the device to the host.
+ */
+ #define ATTR_CAN_UPLOAD (1 << 1)
+
+ /** DFU attribute mask, indicating that the DFU device can accept DFU_DNLOAD requests to send data from
+ * the host to the device.
+ */
+ #define ATTR_CAN_DOWNLOAD (1 << 0)
+
+ #if defined(__AVR_AT90USB1286__)
+ #define PRODUCT_ID_CODE 0x2FFB
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x97
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_AT90USB1287__)
+ #define PRODUCT_ID_CODE 0x2FFB
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x97
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_AT90USB646__)
+ #define PRODUCT_ID_CODE 0x2FF9
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x96
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_AT90USB647__)
+ #define PRODUCT_ID_CODE 0x2FF9
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x96
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_AT90USB162__)
+ #define PRODUCT_ID_CODE 0x2FFA
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x94
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_AT90USB82__)
+ #define PRODUCT_ID_CODE 0x2FF7
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x94
+ #define SIGNATURE_BYTE_3 0x82
+ #elif defined(__AVR_ATmega32U6__)
+ #define PRODUCT_ID_CODE 0x2FFB
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x95
+ #define SIGNATURE_BYTE_3 0x88
+ #elif defined(__AVR_ATmega32U4__)
+ #define PRODUCT_ID_CODE 0x2FF4
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x95
+ #define SIGNATURE_BYTE_3 0x87
+ #elif defined(__AVR_ATmega16U4__)
+ #define PRODUCT_ID_CODE 0x2FF3
+
+ #define SIGNATURE_BYTE_1 0x1E
+ #define SIGNATURE_BYTE_2 0x94
+ #define SIGNATURE_BYTE_3 0x88
+ #else
+ #error The selected AVR part is not currently supported by this bootloader.
+ #endif
+
+ #if !defined(PRODUCT_ID_CODE)
+ #error Current AVR model is not supported by this bootloader.
+ #endif
+
+ /* Type Defines: */
+ /** Type define for a DFU class function descriptor. This descriptor gives DFU class information
+ * to the host when read, indicating the DFU device's capabilities.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Standard descriptor header structure */
+
+ uint8_t Attributes; /**< DFU device attributes, a mask comprising of the
+ * ATTR_* macros listed in this source file
+ */
+ uint16_t DetatchTimeout; /**< Timeout in milliseconds between a USB_DETACH
+ * command being issued and the device detaching
+ * from the USB bus
+ */
+ uint16_t TransferSize; /**< Maximum number of bytes the DFU device can accept
+ * from the host in a transaction
+ */
+ uint16_t DFUSpecification; /**< BCD packed DFU specification number this DFU
+ * device complies with
+ */
+ } USB_DFU_Functional_Descriptor_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t DFUInterface;
+ USB_DFU_Functional_Descriptor_t DFUFunctional;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/Doxygen.conf b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Doxygen.conf
new file mode 100644
index 00000000..f78e5fde
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - DFU Class Bootloader"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/DFU/makefile b/digital/avr/modules/usb/lufa/Bootloaders/DFU/makefile
new file mode 100644
index 00000000..d7801745
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/DFU/makefile
@@ -0,0 +1,710 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = BootloaderDFU
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Starting byte address of the bootloader
+BOOT_START = 0x1E000
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DSTATIC_ENDPOINT_CONFIGURATION
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DFIXED_CONTROL_ENDPOINT_SIZE=32 -DUSE_SINGLE_DEVICE_CONFIGURATION
+CDEFS += -DNO_CLEARSET_FEATURE_REQUEST
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fdata-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -fno-inline-small-functions
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(ASRC:%.S=$(OBJDIR)/%.o)
+ $(REMOVE) $(ASRC:%.S=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen clean_doxygen
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.c b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.c
new file mode 100644
index 00000000..adfbe6c2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.c
@@ -0,0 +1,218 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t HIDReport[] =
+{
+ 0x06, 0x9c, 0xff, /* Usage Page (Vendor Defined) */
+ 0x09, 0x19, /* Usage (Vendor Defined) */
+ 0xa1, 0x01, /* Collection (Vendor Defined) */
+ 0x0a, 0x19, 0x00, /* Usage (Vendor Defined) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x82, /* Report Count (130) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0xff, /* Logical Maximum (255) */
+ 0x91, 0x02, /* Output (Data, Variable, Absolute) */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x16C0,
+ ProductID: 0x0478,
+ ReleaseNumber: 0x0010,
+
+ ManufacturerStrIndex: NO_DESCRIPTOR,
+ ProductStrIndex: 0x01,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ HIDDescriptor:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(HIDReport)
+ },
+
+ HIDEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | HID_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: HID_EPSIZE,
+ PollingIntervalMS: 0x40
+ },
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t ProductString =
+{
+ Header: {Size: USB_STRING_LEN(21), Type: DTYPE_String},
+
+ UnicodeString: L"AVR Teensy Bootloader"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ if (!(DescriptorNumber))
+ {
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = LanguageString.Header.Size;
+ }
+ else
+ {
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = ProductString.Header.Size;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.HIDDescriptor);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(HIDReport);
+ Size = sizeof(HIDReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.h b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.h
new file mode 100644
index 00000000..24a0cdaa
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Descriptors.h
@@ -0,0 +1,91 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t HIDDescriptor;
+ USB_Descriptor_Endpoint_t HIDEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the HID data IN endpoint. */
+ #define HID_EPNUM 1
+
+ /** Size in bytes of the HID reporting IN endpoint. */
+ #define HID_EPSIZE 64
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Doxygen.conf b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Doxygen.conf
new file mode 100644
index 00000000..0df2320a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Teensy HID Bootloader"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.c b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.c
new file mode 100644
index 00000000..4f09ac50
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.c
@@ -0,0 +1,156 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the TeensyHID bootloader. This file contains the complete bootloader logic.
+ */
+
+#define INCLUDE_FROM_TEENSYHID_C
+#include "TeensyHID.h"
+
+/* Global Variables: */
+/** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run
+ * via a soft reset. When cleared, the bootloader will abort, the USB interface will shut down and the application
+ * started via a forced watchdog reset.
+ */
+bool RunBootloader = true;
+
+
+/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
+ * runs the bootloader processing routine until instructed to soft-exit.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Relocate the interrupt vector table to the bootloader section */
+ MCUCR = (1 << IVCE);
+ MCUCR = (1 << IVSEL);
+
+ /* Initialize USB subsystem */
+ USB_Init();
+
+ while (RunBootloader)
+ USB_USBTask();
+
+ /* Shut down the USB interface, so that the host will register the disconnection */
+ USB_ShutDown();
+
+ /* Wait 100ms to give the host time to register the disconnection */
+ _delay_ms(100);
+
+ /* Enable the watchdog and force a timeout to reset the AVR */
+ wdt_enable(WDTO_250MS);
+
+ for (;;);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
+ * to relay data to and from the attached USB host.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup HID Report Endpoint */
+ Endpoint_ConfigureEndpoint(HID_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, HID_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_SetReport:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Wait until the command (report) has been sent by the host */
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* Read in the write destination address */
+ uint16_t PageAddress = Endpoint_Read_Word_LE();
+
+ /* Check if the command is a program page command, or a start application command */
+ if (PageAddress == TEENSY_STARTAPPLICATION)
+ {
+ RunBootloader = false;
+ }
+ else
+ {
+ /* Erase the given FLASH page, ready to be programmed */
+ boot_page_erase(PageAddress);
+ boot_spm_busy_wait();
+
+ /* Write each of the FLASH page's bytes in sequence */
+ for (uint8_t PageByte = 0; PageByte < 128; PageByte += 2)
+ {
+ /* Check if endpoint is empty - if so clear it and wait until ready for next packet */
+ if (!(Endpoint_BytesInEndpoint()))
+ {
+ Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsSetupOUTReceived()));
+ }
+
+ /* Write the next data word to the FLASH page */
+ boot_page_fill(PageAddress + PageByte, Endpoint_Read_Word_LE());
+ }
+
+ /* Write the filled FLASH page to memory */
+ boot_page_write(PageAddress);
+ boot_spm_busy_wait();
+
+ /* Re-enable RWW section */
+ boot_rww_enable();
+ }
+
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until the host is ready to receive the request confirmation */
+ while (!(Endpoint_IsSetupINReady()));
+
+ /* Handshake the request by sending an empty IN packet */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.h b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.h
new file mode 100644
index 00000000..a53fca30
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.h
@@ -0,0 +1,73 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for TeensyHID.c.
+ */
+
+#ifndef _TEENSYHID_H_
+#define _TEENSYHID_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/boot.h>
+ #include <avr/wdt.h>
+ #include <util/delay.h>
+ #include <stdbool.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+
+ /* Preprocessor Checks: */
+ #if !defined(__AVR_AT90USB162__)
+ #error This bootloader is not compatible with the selected AVR model.
+ #endif
+
+ /* Macros: */
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ #define TEENSY_STARTAPPLICATION 0xFFFF
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.txt b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.txt
new file mode 100644
index 00000000..973819cf
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/TeensyHID.txt
@@ -0,0 +1,41 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Teensy HID Class USB AVR Bootloader
+ *
+ * This bootloader enumerates to the host as a HID Class device, allowing for Teensy compatible programming
+ * software to load firmware onto the AVR, such as the official software at http://www.pjrc.com/teensy/.
+ *
+ * Out of the box this bootloader builds for the USB162, and will fit into 2KB of bootloader space.
+ *
+ * This spoofs (with permission) the offical Teensy bootloader's VID and PID, so that the software remains
+ * compatible with no changes.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device Class (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Class Standard</td>
+ * <td>Teensy Programming Protocol Details</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode</td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/makefile b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/makefile
new file mode 100644
index 00000000..5d40a0f4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/TeensyHID/makefile
@@ -0,0 +1,707 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb162
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = TeensyHID
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Starting byte address of the bootloader
+BOOT_START = 0xC000
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DSTATIC_ENDPOINT_CONFIGURATION
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION
+CDEFS += -DNO_CLEARSET_FEATURE_REQUEST
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen
diff --git a/digital/avr/modules/usb/lufa/Bootloaders/makefile b/digital/avr/modules/usb/lufa/Bootloaders/makefile
new file mode 100644
index 00000000..78af34d6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Bootloaders/makefile
@@ -0,0 +1,29 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2009.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Makefile to build all the LUFA USB Bootloaders. Call with "make all" to
+# rebuild all bootloaders.
+
+# Bootloaders are pre-cleaned before each one is built, to ensure any
+# custom LUFA library build options are reflected in the compiled
+# code.
+
+all:
+ make -C 'DFU/' clean
+ make -C 'DFU/' all
+
+ make -C 'CDC/' clean
+ make -C 'CDC/' all
+
+ make -C 'TeensyHID/' clean
+ make -C 'TeensyHID/' all
+
+%:
+ make -C 'DFU/' $@
+ make -C 'CDC/' $@
+ make -C 'TeensyHID/' $@
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.aps b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.aps
new file mode 100644
index 00000000..aed850ae
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>AudioInput</ProjectName><Created>30-Sep-2008 14:03:00</Created><LastEdit>30-Sep-2008 14:03:28</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:03:00</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>AudioInput.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioInput\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>AudioInput.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><HEADERFILE>AudioInput.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>AudioInput.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioInput\AudioInput.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioInput\Descriptors.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioInput\AudioInput.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioInput\Descriptors.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.c b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.c
new file mode 100644
index 00000000..f5474b49
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.c
@@ -0,0 +1,231 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Audio Input demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+/* --- Project Configuration --- */
+//#define MICROPHONE_BIASED_TO_HALF_RAIL
+/* --- --- --- --- --- --- --- --- */
+
+#include "AudioInput.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA AudioIn App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Audio_Task , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+ ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_32);
+ ADC_SetupChannel(MIC_IN_ADC_CHANNEL);
+
+ /* Start the ADC conversion in free running mode */
+ ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | MIC_IN_ADC_CHANNEL);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
+ * configures the sample update and PWM timers.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Sample reload timer initialization */
+ OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY);
+ TCCR0A = (1 << WGM01); // CTC mode
+ TCCR0B = (1 << CS00); // Fcpu speed
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop the sample reload timer */
+ TCCR0B = 0;
+
+ /* Stop running audio and USB management tasks */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup audio stream endpoint */
+ Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS,
+ ENDPOINT_DIR_IN, AUDIO_STREAM_EPSIZE,
+ ENDPOINT_BANK_DOUBLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the Audio class-specific
+ * requests) so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Process General and Audio specific control requests */
+ switch (bRequest)
+ {
+ case REQ_SetInterface:
+ /* Set Interface is not handled by the library, as its function is application-specific */
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE))
+ {
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */
+ if (wValue)
+ {
+ /* Start audio task */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_RUN);
+ }
+ else
+ {
+ /* Stop audio task */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
+ }
+
+ /* Handshake the request */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the AudioInput_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to manage the Audio interface, reading in ADC samples from the microphone, and them to the host. */
+TASK(USB_Audio_Task)
+{
+ /* Select the audio stream endpoint */
+ Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM);
+
+ /* Check if the current endpoint can be read from (contains a packet) and that the next sample should be stored */
+ if (Endpoint_ReadWriteAllowed() && (TIFR0 & (1 << OCF0A)))
+ {
+ /* Clear the sample reload timer */
+ TIFR0 |= (1 << OCF0A);
+
+ /* Audio sample is ADC value scaled to fit the entire range */
+ int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());
+
+#if defined(MICROPHONE_BIASED_TO_HALF_RAIL)
+ /* Microphone is biased to half rail voltage, subtract the bias from the sample value */
+ AudioSample -= (SAMPLE_MAX_RANGE / 2));
+#endif
+
+ /* Write the sample to the buffer */
+ Endpoint_Write_Word_LE(AudioSample);
+
+ /* Check to see if the bank is now full */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ /* Send the full packet to the host */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.h b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.h
new file mode 100644
index 00000000..97978fde
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.h
@@ -0,0 +1,90 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for AudioOutput.c.
+ */
+
+#ifndef _AUDIO_OUTPUT_H_
+#define _AUDIO_OUTPUT_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/AT90USBXXX/ADC.h> // ADC driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** ADC channel number for the microphone input. */
+ #define MIC_IN_ADC_CHANNEL 2
+
+ /** Maximum ADC sample value for the microphone input. */
+ #define SAMPLE_MAX_RANGE 0xFFFF
+
+ /** Maximum ADC range for the microphone input. */
+ #define ADC_MAX_RANGE 0x3FF
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum AudioInput_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Audio_Task);
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.txt b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.txt
new file mode 100644
index 00000000..09b77f7e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/AudioInput.txt
@@ -0,0 +1,48 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Audio Input Device Demo
+ *
+ * Audio demonstration application. This gives a simple reference
+ * application for implementing a USB Audio Input device using the
+ * basic USB Audio drivers in all modern OSes (i.e. no special drivers
+ * required).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a USB microphone. Incomming audio from the ADC channel 1 will
+ * be sampled and sent to the host computer.
+ *
+ * To use, connect a microphone to the ADC channel 2.
+ *
+ * Under Windows, if a driver request dialogue pops up, select the option
+ * to automatically install the appropriate drivers.
+ *
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Audio Class</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Standard Audio Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Audio Class Specification</td>
+ * <td>USBIF Audio Class Terminal Types Specification</td>
+ * <td>USBIF Audio Data Formats Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.c
new file mode 100644
index 00000000..7a3e4288
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.c
@@ -0,0 +1,314 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(02.00),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2047,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ AudioControlInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0x01,
+ SubClass: 0x01,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioControlInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_Header,
+
+ ACSpecification: VERSION_BCD(01.00),
+ TotalLength: (sizeof(USB_AudioInterface_AC_t) +
+ sizeof(USB_AudioInputTerminal_t) +
+ sizeof(USB_AudioOutputTerminal_t)),
+
+ InCollection: 1,
+ InterfaceNumbers: {1},
+ },
+
+ InputTerminal:
+ {
+ Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_InputTerminal,
+
+ TerminalID: 0x01,
+ TerminalType: TERMINAL_IN_MIC,
+ AssociatedOutputTerminal: 0x00,
+
+ TotalChannels: 1,
+ ChannelConfig: 0,
+
+ ChannelStrIndex: NO_DESCRIPTOR,
+ TerminalStrIndex: NO_DESCRIPTOR
+ },
+
+ OutputTerminal:
+ {
+ Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_OutputTerminal,
+
+ TerminalID: 0x02,
+ TerminalType: TERMINAL_STREAMING,
+ AssociatedInputTerminal: 0x00,
+
+ SourceID: 0x01,
+
+ TerminalStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_Alt0:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0x01,
+ SubClass: 0x02,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_Alt1:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 1,
+
+ TotalEndpoints: 1,
+
+ Class: 0x01,
+ SubClass: 0x02,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_General,
+
+ TerminalLink: 0x02,
+
+ FrameDelay: 1,
+ AudioFormat: 0x0001
+ },
+
+ AudioFormat:
+ {
+ Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_Format,
+
+ FormatType: 0x01,
+ Channels: 0x01,
+
+ SubFrameSize: 0x02,
+ BitResolution: 16,
+ SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
+
+ SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
+ },
+
+ AudioEndpoint:
+ {
+ Endpoint:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
+ Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
+ EndpointSize: AUDIO_STREAM_EPSIZE,
+ PollingIntervalMS: 1
+ },
+
+ Refresh: 0,
+ SyncEndpointNumber: 0
+ },
+
+ AudioEndpoint_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
+ Subtype: DSUBTYPE_General,
+
+ Attributes: 0x00,
+
+ LockDelayUnits: 0x00,
+ LockDelay: 0x0000
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Audio In Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.h
new file mode 100644
index 00000000..cc007498
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/Descriptors.h
@@ -0,0 +1,322 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Descriptor header constant to indicate a Audio class interface descriptor. */
+ #define DTYPE_AudioInterface 0x24
+
+ /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
+ #define DTYPE_AudioEndpoint 0x25
+
+ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
+ #define DSUBTYPE_Header 0x01
+
+ /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
+ #define DSUBTYPE_InputTerminal 0x02
+
+ /** Audio class descriptor subtype value for an Input Terminal Audio class specific descriptor. */
+ #define DSUBTYPE_OutputTerminal 0x03
+
+ /** Audio class descriptor subtype value for a Feature Unit Audio class specific descriptor. */
+ #define DSUBTYPE_FeatureUnit 0x06
+
+ /** Audio class descriptor subtype value for a general Audio class specific descriptor. */
+ #define DSUBTYPE_General 0x01
+
+ /** Audio class descriptor subtype value for an Audio class specific descriptor indicating the format of an audio stream. */
+ #define DSUBTYPE_Format 0x02
+
+ //@{
+ /** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
+
+ #define CHANNEL_LEFT_FRONT (1 << 0)
+ #define CHANNEL_RIGHT_FRONT (1 << 1)
+ #define CHANNEL_CENTER_FRONT (1 << 2)
+ #define CHANNEL_LOW_FREQ_ENHANCE (1 << 3)
+ #define CHANNEL_LEFT_SURROUND (1 << 4)
+ #define CHANNEL_RIGHT_SURROUND (1 << 5)
+ #define CHANNEL_LEFT_OF_CENTER (1 << 6)
+ #define CHANNEL_RIGHT_OF_CENTER (1 << 7)
+ #define CHANNEL_SURROUND (1 << 8)
+ #define CHANNEL_SIDE_LEFT (1 << 9)
+ #define CHANNEL_SIDE_RIGHT (1 << 10)
+ #define CHANNEL_TOP (1 << 11)
+ //@}
+
+ //@{
+ /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
+
+ #define FEATURE_MUTE (1 << 0)
+ #define FEATURE_VOLUME (1 << 1)
+ #define FEATURE_BASS (1 << 2)
+ #define FEATURE_MID (1 << 3)
+ #define FEATURE_TREBLE (1 << 4)
+ #define FEATURE_GRAPHIC_EQUALIZER (1 << 5)
+ #define FEATURE_AUTOMATIC_GAIN (1 << 6)
+ #define FEATURE_DELAY (1 << 7)
+ #define FEATURE_BASS_BOOST (1 << 8)
+ #define FEATURE_BASS_LOUDNESS (1 << 9)
+ //@}
+
+ //@{
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+
+ #define TERMINAL_UNDEFINED 0x0100
+ #define TERMINAL_STREAMING 0x0101
+ #define TERMINAL_VENDOR 0x01FF
+ #define TERMINAL_IN_UNDEFINED 0x0200
+ #define TERMINAL_IN_MIC 0x0201
+ #define TERMINAL_IN_DESKTOP_MIC 0x0202
+ #define TERMINAL_IN_PERSONAL_MIC 0x0203
+ #define TERMINAL_IN_OMNIDIR_MIC 0x0204
+ #define TERMINAL_IN_MIC_ARRAY 0x0205
+ #define TERMINAL_IN_PROCESSING_MIC 0x0206
+ #define TERMINAL_IN_OUT_UNDEFINED 0x0300
+ #define TERMINAL_OUT_SPEAKER 0x0301
+ #define TERMINAL_OUT_HEADPHONES 0x0302
+ #define TERMINAL_OUT_HEAD_MOUNTED 0x0303
+ #define TERMINAL_OUT_DESKTOP 0x0304
+ #define TERMINAL_OUT_ROOM 0x0305
+ #define TERMINAL_OUT_COMMUNICATION 0x0306
+ #define TERMINAL_OUT_LOWFREQ 0x0307
+ //@}
+
+ /** Convenience macro, to fill a 24-bit AudioSampleFreq_t structure with the given sample rate as a 24-bit number.
+ *
+ * \param freq Required audio sampling frequency in HZ
+ */
+ #define SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
+
+ /** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
+ * accepts only filled endpoint packets of audio samples.
+ */
+ #define EP_ACCEPTS_ONLY_FULL_PACKETS (1 << 7)
+
+ /** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
+ * will accept partially filled endpoint packets of audio samples.
+ */
+ #define EP_ACCEPTS_SMALL_PACKETS (0 << 7)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** Endpoint number of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPNUM 1
+ #else
+ #define AUDIO_STREAM_EPNUM 3
+ #endif
+
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
+ * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
+ * USB AVR models will result in unavoidable distorted output.
+ */
+ #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+
+ /** Sample frequency of the data being transmitted through the streaming endpoint. */
+ #define AUDIO_SAMPLE_FREQUENCY 48000
+
+ /* Type Defines: */
+ /** Type define for an Audio class specific interface descriptor. This follows a regular interface descriptor to
+ * supply extra information about the audio device's layout to the host. See the USB Audio specification for more
+ * details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
+ uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
+
+ uint8_t InCollection; /**< Total number of audio class interfaces within this device */
+ uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
+ } USB_AudioInterface_AC_t;
+
+ /** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
+ * are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
+ * specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device */
+ uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit */
+
+ uint8_t ControlSize; /**< Size of each element in the ChanelControlls array */
+ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each seperate audio channel */
+
+ uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioFeatureUnit_t;
+
+ /** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
+ * contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
+ * a USB endpoint). See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
+ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
+ uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
+ * such as the speaker and microphone of a phone handset
+ */
+ uint8_t TotalChannels; /**< Total number of seperate audio channels within this interface (right, left, etc.) */
+ uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal */
+
+ uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
+ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioInputTerminal_t;
+
+ /** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
+ * contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
+ * a USB endpoint). See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
+ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
+ uint8_t AssociatedInputTerminal; /**< ID of associated input terminal, for physically grouped terminals
+ * such as the speaker and microphone of a phone handset
+ */
+ uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
+
+ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioOutputTerminal_t;
+
+ /** Type define for an Audio class specific streaming interface descriptor. This indicates to the host
+ * how audio streams within the device are formatted. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing */
+
+ uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
+ uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
+ } USB_AudioInterface_AS_t;
+
+ /** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
+ * this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
+ */
+ typedef struct
+ {
+ uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
+ uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
+ } AudioSampleFreq_t;
+
+ /** Type define for an Audio class specific audio format descriptor. This is used to give the host full details
+ * about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
+ * in the device's audio streams. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification */
+ uint8_t Channels; /**< Total number of discrete channels in the stream */
+
+ uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream */
+ uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
+
+ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
+ AudioSampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */
+ } USB_AudioFormat_t;
+
+ /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
+ * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint */
+
+ uint8_t Refresh; /**< Always set to zero */
+ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
+ } USB_AudioStreamEndpoint_Std_t;
+
+ /** Type define for an Audio class specific extended endpoint descriptor. This contains extra information
+ * on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
+ * class specific extended endpoint descriptor. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t Attributes; /**< Audio class specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS */
+
+ uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
+ uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
+ } USB_AudioStreamEndpoint_Spc_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t AudioControlInterface;
+ USB_AudioInterface_AC_t AudioControlInterface_SPC;
+ USB_AudioInputTerminal_t InputTerminal;
+ USB_AudioOutputTerminal_t OutputTerminal;
+ USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
+ USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
+ USB_AudioInterface_AS_t AudioStreamInterface_SPC;
+ USB_AudioFormat_t AudioFormat;
+ USB_AudioStreamEndpoint_Std_t AudioEndpoint;
+ USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/AudioInput/Doxygen.conf
new file mode 100644
index 00000000..f84efb7b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Audio Input Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioInput/makefile b/digital/avr/modules/usb/lufa/Demos/AudioInput/makefile
new file mode 100644
index 00000000..7569ea24
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioInput/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = AudioInput
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.aps b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.aps
new file mode 100644
index 00000000..a01ba8f1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>AudioOutput</ProjectName><Created>30-Sep-2008 14:03:51</Created><LastEdit>30-Sep-2008 14:04:06</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:03:51</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AudioOutput\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>AudioOutput.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><HEADERFILE>AudioOutput.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>AudioOutput.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.c b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.c
new file mode 100644
index 00000000..184910e8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.c
@@ -0,0 +1,305 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Audio Output demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+/* --- Project Configuration (Choose ONE) --- */
+//#define AUDIO_OUT_MONO
+#define AUDIO_OUT_STEREO
+//#define AUDIO_OUT_LEDS
+//#define AUDIO_OUT_PORTC
+/* --- --- --- --- --- --- --- --- --- --- --- */
+
+#include "AudioOutput.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA AudioOut App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Audio_Task , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
+ * configures the sample update and PWM timers.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Sample reload timer initialization */
+ OCR0A = (F_CPU / AUDIO_SAMPLE_FREQUENCY);
+ TCCR0A = (1 << WGM01); // CTC mode
+ TCCR0B = (1 << CS00); // Fcpu speed
+
+#if defined(AUDIO_OUT_MONO)
+ /* Set speaker as output */
+ DDRC |= (1 << 6);
+#elif defined(AUDIO_OUT_STEREO)
+ /* Set speakers as outputs */
+ DDRC |= ((1 << 6) | (1 << 5));
+#elif defined(AUDIO_OUT_PORTC)
+ /* Set PORTC as outputs */
+ DDRC |= 0xFF;
+#endif
+
+#if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
+ /* PWM speaker timer initialization */
+ TCCRxA = ((1 << WGMx0) | (1 << COMxA1) | (1 << COMxA0)
+ | (1 << COMxB1) | (1 << COMxB0)); // Set on match, clear on TOP
+ TCCRxB = ((1 << WGMx2) | (1 << CSx0)); // Fast 8-Bit PWM, Fcpu speed
+#endif
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop the timers */
+ TCCR0B = 0;
+#if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
+ TCCRxB = 0;
+#endif
+
+#if defined(AUDIO_OUT_MONO)
+ /* Set speaker as input to reduce current draw */
+ DDRC &= ~(1 << 6);
+#elif defined(AUDIO_OUT_STEREO)
+ /* Set speakers as inputs to reduce current draw */
+ DDRC &= ~((1 << 6) | (1 << 5));
+#elif defined(AUDIO_OUT_PORTC)
+ /* Set PORTC low */
+ PORTC = 0x00;
+#endif
+
+ /* Stop running audio and USB management tasks */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup audio stream endpoint */
+ Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS,
+ ENDPOINT_DIR_OUT, AUDIO_STREAM_EPSIZE,
+ ENDPOINT_BANK_DOUBLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the Audio class-specific
+ * requests) so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Process General and Audio specific control requests */
+ switch (bRequest)
+ {
+ case REQ_SetInterface:
+ /* Set Interface is not handled by the library, as its function is application-specific */
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE))
+ {
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */
+ if (wValue)
+ {
+ /* Start audio task */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_RUN);
+ }
+ else
+ {
+ /* Stop audio task */
+ Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
+ }
+
+ /* Handshake the request */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the AudioOutput_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to manage the Audio interface, reading in audio samples from the host, and outputting them to the speakers/LEDs as
+ * desired.
+ */
+TASK(USB_Audio_Task)
+{
+ /* Select the audio stream endpoint */
+ Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM);
+
+ /* Check if the current endpoint can be read from (contains a packet) and that the next sample should be read */
+ if (Endpoint_ReadWriteAllowed() && (TIFR0 & (1 << OCF0A)))
+ {
+ /* Clear the sample reload timer */
+ TIFR0 |= (1 << OCF0A);
+
+ /* Retreive the signed 16-bit left and right audio samples */
+ int16_t LeftSample_16Bit = (int16_t)Endpoint_Read_Word_LE();
+ int16_t RightSample_16Bit = (int16_t)Endpoint_Read_Word_LE();
+
+ /* Check to see if the bank is now empty */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ /* Acknowedge the packet, clear the bank ready for the next packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Massage signed 16-bit left and right audio samples into signed 8-bit */
+ int8_t LeftSample_8Bit = (LeftSample_16Bit >> 8);
+ int8_t RightSample_8Bit = (RightSample_16Bit >> 8);
+
+#if defined(AUDIO_OUT_MONO)
+ /* Mix the two channels together to produce a mono, 8-bit sample */
+ int8_t MixedSample_8Bit = (((int16_t)LeftSample_8Bit + (int16_t)RightSample_8Bit) >> 1);
+
+ /* Load the sample into the PWM timer channel */
+ OCRxA = ((uint8_t)MixedSample_8Bit ^ (1 << 7));
+#elif defined(AUDIO_OUT_STEREO)
+ /* Load the dual 8-bit samples into the PWM timer channels */
+ OCRxA = ((uint8_t)LeftSample_8Bit ^ (1 << 7));
+ OCRxB = ((uint8_t)RightSample_8Bit ^ (1 << 7));
+#elif defined(AUDIO_OUT_PORTC)
+ /* Mix the two channels together to produce a mono, 8-bit sample */
+ int8_t MixedSample_8Bit = (((int16_t)LeftSample_8Bit + (int16_t)RightSample_8Bit) >> 1);
+
+ PORTC = MixedSample_8Bit;
+#else
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Make left channel positive (absolute) */
+ if (LeftSample_8Bit < 0)
+ LeftSample_8Bit = -LeftSample_8Bit;
+
+ /* Make right channel positive (absolute) */
+ if (RightSample_8Bit < 0)
+ RightSample_8Bit = -RightSample_8Bit;
+
+ /* Set first LED based on sample value */
+ if (LeftSample_8Bit < ((128 / 8) * 1))
+ LEDMask |= LEDS_LED2;
+ else if (LeftSample_8Bit < ((128 / 8) * 3))
+ LEDMask |= (LEDS_LED1 | LEDS_LED2);
+ else
+ LEDMask |= LEDS_LED1;
+
+ /* Set second LED based on sample value */
+ if (RightSample_8Bit < ((128 / 8) * 1))
+ LEDMask |= LEDS_LED4;
+ else if (RightSample_8Bit < ((128 / 8) * 3))
+ LEDMask |= (LEDS_LED3 | LEDS_LED4);
+ else
+ LEDMask |= LEDS_LED3;
+
+ LEDs_SetAllLEDs(LEDMask);
+#endif
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.h b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.h
new file mode 100644
index 00000000..3b992317
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.h
@@ -0,0 +1,127 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for AudioOutput.c.
+ */
+
+#ifndef _AUDIO_OUTPUT_H_
+#define _AUDIO_OUTPUT_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ #define TCCRxA TCCR3A
+ #define TCCRxB TCCR3B
+ #define OCRxA OCR3A
+ #define OCRxB OCR3B
+ #define WGMx0 WGM30
+ #define WGMx2 WGM32
+ #define COMxA1 COM3A1
+ #define COMxA0 COM3A0
+ #define COMxB1 COM3B1
+ #define COMxB0 COM3B0
+ #define CSx0 CS30
+ #else
+ /** Timer count register used for left channel PWM audio output (or mixed output in mono output mode) */
+ #define TCCRxA TCCR1A
+
+ /** Timer count register used for right channel PWM audio output */
+ #define TCCRxB TCCR1B
+
+ /** Timer compare register used for left channel PWM audio output (or mixed output in mono output mode) */
+ #define OCRxA OCR1A
+
+ /** Timer compare register used for right channel PWM audio output */
+ #define OCRxB OCR1B
+
+ /** Timer control register mask used to select PWM mode */
+ #define WGMx0 WGM10
+
+ /** Timer control register mask used to select PWM mode */
+ #define WGMx2 WGM12
+
+ /** Timer control register mask used to set, clear or toggle channel output pin on match */
+ #define COMxA1 COM1A1
+
+ /** Timer control register mask used to set, clear or toggle channel output pin on match */
+ #define COMxA0 COM1A0
+
+ /** Timer control register mask used to set, clear or toggle channel output pin on match */
+ #define COMxB1 COM1B1
+
+ /** Timer control register mask used to set, clear or toggle channel output pin on match */
+ #define COMxB0 COM1B0
+
+ /** Timer control register mask used to start the timer at Fcpu clock rate */
+ #define CSx0 CS10
+ #endif
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum AudioOutput_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Audio_Task);
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.txt b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.txt
new file mode 100644
index 00000000..ce7d4ed9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/AudioOutput.txt
@@ -0,0 +1,50 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Audio Output Device Demo
+ *
+ * Audio demonstration application. This gives a simple reference
+ * application for implementing a USB Audio Output device using the
+ * basic USB Audio drivers in all modern OSes (i.e. no special drivers
+ * required).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a USB speaker. Incomming audio will output in 8-bit PWM onto
+ * the timer output (timer 3 for the AT90USBXXX6/7 USB AVRs, timer 1 for
+ * the AT90USBXXX2 controller AVRs) compare channel A for AUDIO_OUT_MONO
+ * mode, on channels A and B for AUDIO_OUT_STEREO and on the board LEDs
+ * for AUDIO_OUT_LEDS mode. Decouple audio outputs with a capacitor and
+ * attach to a speaker to hear the audio.
+ *
+ * Under Windows, if a driver request dialogue pops up, select the option
+ * to automatically install the appropriate drivers.
+ *
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Audio Class</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Standard Audio Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Audio Class Specification</td>
+ * <td>USBIF Audio Class Terminal Types Specification</td>
+ * <td>USBIF Audio Data Formats Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.c
new file mode 100644
index 00000000..169e534b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.c
@@ -0,0 +1,314 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(02.00),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2046,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ AudioControlInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0x01,
+ SubClass: 0x01,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioControlInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_Header,
+
+ ACSpecification: VERSION_BCD(01.00),
+ TotalLength: (sizeof(USB_AudioInterface_AC_t) +
+ sizeof(USB_AudioInputTerminal_t) +
+ sizeof(USB_AudioOutputTerminal_t)),
+
+ InCollection: 1,
+ InterfaceNumbers: {1},
+ },
+
+ InputTerminal:
+ {
+ Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_InputTerminal,
+
+ TerminalID: 0x01,
+ TerminalType: TERMINAL_STREAMING,
+ AssociatedOutputTerminal: 0x00,
+
+ TotalChannels: 2,
+ ChannelConfig: (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
+
+ ChannelStrIndex: NO_DESCRIPTOR,
+ TerminalStrIndex: NO_DESCRIPTOR
+ },
+
+ OutputTerminal:
+ {
+ Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_OutputTerminal,
+
+ TerminalID: 0x02,
+ TerminalType: TERMINAL_OUT_SPEAKER,
+ AssociatedInputTerminal: 0x00,
+
+ SourceID: 0x01,
+
+ TerminalStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_Alt0:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0x01,
+ SubClass: 0x02,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_Alt1:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 1,
+
+ TotalEndpoints: 1,
+
+ Class: 0x01,
+ SubClass: 0x02,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_General,
+
+ TerminalLink: 0x01,
+
+ FrameDelay: 1,
+ AudioFormat: 0x0001
+ },
+
+ AudioFormat:
+ {
+ Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_Format,
+
+ FormatType: 0x01,
+ Channels: 0x02,
+
+ SubFrameSize: 0x02,
+ BitResolution: 16,
+
+ SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
+ SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
+ },
+
+ AudioEndpoint:
+ {
+ Endpoint:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
+ Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
+ EndpointSize: AUDIO_STREAM_EPSIZE,
+ PollingIntervalMS: 1
+ },
+
+ Refresh: 0,
+ SyncEndpointNumber: 0
+ },
+
+ AudioEndpoint_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
+ Subtype: DSUBTYPE_General,
+
+ Attributes: EP_ACCEPTS_SMALL_PACKETS,
+
+ LockDelayUnits: 0x00,
+ LockDelay: 0x0000
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Audio Out Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.h
new file mode 100644
index 00000000..99f10d64
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Descriptors.h
@@ -0,0 +1,322 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Descriptor header constant to indicate a Audio class interface descriptor. */
+ #define DTYPE_AudioInterface 0x24
+
+ /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
+ #define DTYPE_AudioEndpoint 0x25
+
+ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
+ #define DSUBTYPE_Header 0x01
+
+ /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
+ #define DSUBTYPE_InputTerminal 0x02
+
+ /** Audio class descriptor subtype value for an Input Terminal Audio class specific descriptor. */
+ #define DSUBTYPE_OutputTerminal 0x03
+
+ /** Audio class descriptor subtype value for a Feature Unit Audio class specific descriptor. */
+ #define DSUBTYPE_FeatureUnit 0x06
+
+ /** Audio class descriptor subtype value for a general Audio class specific descriptor. */
+ #define DSUBTYPE_General 0x01
+
+ /** Audio class descriptor subtype value for an Audio class specific descriptor indicating the format of an audio stream. */
+ #define DSUBTYPE_Format 0x02
+
+ //@{
+ /** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
+
+ #define CHANNEL_LEFT_FRONT (1 << 0)
+ #define CHANNEL_RIGHT_FRONT (1 << 1)
+ #define CHANNEL_CENTER_FRONT (1 << 2)
+ #define CHANNEL_LOW_FREQ_ENHANCE (1 << 3)
+ #define CHANNEL_LEFT_SURROUND (1 << 4)
+ #define CHANNEL_RIGHT_SURROUND (1 << 5)
+ #define CHANNEL_LEFT_OF_CENTER (1 << 6)
+ #define CHANNEL_RIGHT_OF_CENTER (1 << 7)
+ #define CHANNEL_SURROUND (1 << 8)
+ #define CHANNEL_SIDE_LEFT (1 << 9)
+ #define CHANNEL_SIDE_RIGHT (1 << 10)
+ #define CHANNEL_TOP (1 << 11)
+ //@}
+
+ //@{
+ /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
+
+ #define FEATURE_MUTE (1 << 0)
+ #define FEATURE_VOLUME (1 << 1)
+ #define FEATURE_BASS (1 << 2)
+ #define FEATURE_MID (1 << 3)
+ #define FEATURE_TREBLE (1 << 4)
+ #define FEATURE_GRAPHIC_EQUALIZER (1 << 5)
+ #define FEATURE_AUTOMATIC_GAIN (1 << 6)
+ #define FEATURE_DELAY (1 << 7)
+ #define FEATURE_BASS_BOOST (1 << 8)
+ #define FEATURE_BASS_LOUDNESS (1 << 9)
+ //@}
+
+ //@{
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+
+ #define TERMINAL_UNDEFINED 0x0100
+ #define TERMINAL_STREAMING 0x0101
+ #define TERMINAL_VENDOR 0x01FF
+ #define TERMINAL_IN_UNDEFINED 0x0200
+ #define TERMINAL_IN_MIC 0x0201
+ #define TERMINAL_IN_DESKTOP_MIC 0x0202
+ #define TERMINAL_IN_PERSONAL_MIC 0x0203
+ #define TERMINAL_IN_OMNIDIR_MIC 0x0204
+ #define TERMINAL_IN_MIC_ARRAY 0x0205
+ #define TERMINAL_IN_PROCESSING_MIC 0x0206
+ #define TERMINAL_IN_OUT_UNDEFINED 0x0300
+ #define TERMINAL_OUT_SPEAKER 0x0301
+ #define TERMINAL_OUT_HEADPHONES 0x0302
+ #define TERMINAL_OUT_HEAD_MOUNTED 0x0303
+ #define TERMINAL_OUT_DESKTOP 0x0304
+ #define TERMINAL_OUT_ROOM 0x0305
+ #define TERMINAL_OUT_COMMUNICATION 0x0306
+ #define TERMINAL_OUT_LOWFREQ 0x0307
+ //@}
+
+ /** Convenience macro, to fill a 24-bit AudioSampleFreq_t structure with the given sample rate as a 24-bit number.
+ *
+ * \param freq Required audio sampling frequency in HZ
+ */
+ #define SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
+
+ /** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
+ * accepts only filled endpoint packets of audio samples.
+ */
+ #define EP_ACCEPTS_ONLY_FULL_PACKETS (1 << 7)
+
+ /** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
+ * will accept partially filled endpoint packets of audio samples.
+ */
+ #define EP_ACCEPTS_SMALL_PACKETS (0 << 7)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** Endpoint number of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPNUM 1
+ #else
+ #define AUDIO_STREAM_EPNUM 3
+ #endif
+
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
+ * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
+ * USB AVR models will result in unavoidable distorted output.
+ */
+ #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+
+ /** Sample frequency of the data being transmitted through the streaming endpoint. */
+ #define AUDIO_SAMPLE_FREQUENCY 48000
+
+ /* Type Defines: */
+ /** Type define for an Audio class specific interface descriptor. This follows a regular interface descriptor to
+ * supply extra information about the audio device's layout to the host. See the USB Audio specification for more
+ * details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
+ uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
+
+ uint8_t InCollection; /**< Total number of audio class interfaces within this device */
+ uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
+ } USB_AudioInterface_AC_t;
+
+ /** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
+ * are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
+ * specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device */
+ uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit */
+
+ uint8_t ControlSize; /**< Size of each element in the ChanelControlls array */
+ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each seperate audio channel */
+
+ uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioFeatureUnit_t;
+
+ /** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
+ * contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
+ * a USB endpoint). See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
+ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
+ uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
+ * such as the speaker and microphone of a phone handset
+ */
+ uint8_t TotalChannels; /**< Total number of seperate audio channels within this interface (right, left, etc.) */
+ uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal */
+
+ uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
+ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioInputTerminal_t;
+
+ /** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
+ * contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
+ * a USB endpoint). See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
+ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
+ uint8_t AssociatedInputTerminal; /**< ID of associated input terminal, for physically grouped terminals
+ * such as the speaker and microphone of a phone handset
+ */
+ uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
+
+ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_AudioOutputTerminal_t;
+
+ /** Type define for an Audio class specific streaming interface descriptor. This indicates to the host
+ * how audio streams within the device are formatted. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing */
+
+ uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
+ uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
+ } USB_AudioInterface_AS_t;
+
+ /** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
+ * this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
+ */
+ typedef struct
+ {
+ uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
+ uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
+ } AudioSampleFreq_t;
+
+ /** Type define for an Audio class specific audio format descriptor. This is used to give the host full details
+ * about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
+ * in the device's audio streams. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification */
+ uint8_t Channels; /**< Total number of discrete channels in the stream */
+
+ uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream */
+ uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
+
+ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
+ AudioSampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */
+ } USB_AudioFormat_t;
+
+ /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
+ * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint */
+
+ uint8_t Refresh; /**< Always set to zero */
+ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
+ } USB_AudioStreamEndpoint_Std_t;
+
+ /** Type define for an Audio class specific extended endpoint descriptor. This contains extra information
+ * on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
+ * class specific extended endpoint descriptor. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t Attributes; /**< Audio class specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS */
+
+ uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
+ uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
+ } USB_AudioStreamEndpoint_Spc_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t AudioControlInterface;
+ USB_AudioInterface_AC_t AudioControlInterface_SPC;
+ USB_AudioInputTerminal_t InputTerminal;
+ USB_AudioOutputTerminal_t OutputTerminal;
+ USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
+ USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
+ USB_AudioInterface_AS_t AudioStreamInterface_SPC;
+ USB_AudioFormat_t AudioFormat;
+ USB_AudioStreamEndpoint_Std_t AudioEndpoint;
+ USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Doxygen.conf
new file mode 100644
index 00000000..114137e1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Audio Output Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = YES
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/AudioOutput/makefile b/digital/avr/modules/usb/lufa/Demos/AudioOutput/makefile
new file mode 100644
index 00000000..4c8e7fa0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/AudioOutput/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = AudioOutput
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/CDC.aps b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.aps
new file mode 100644
index 00000000..83dde595
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>CDC</ProjectName><Created>30-Sep-2008 14:04:34</Created><LastEdit>30-Sep-2008 14:04:56</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:04:34</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\CDC\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>CDC.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><HEADERFILE>CDC.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>CDC.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/CDC.c b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.c
new file mode 100644
index 00000000..6e232a48
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.c
@@ -0,0 +1,318 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the CDC demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "CDC.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA CDC App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: CDC_Task , TaskStatus: TASK_STOP },
+};
+
+/* Globals: */
+/** Contains the current baud rate and other settings of the virtual serial port. While this demo does not use
+ * the physical USART and thus does not use these settings, they must still be retained and returned to the host
+ * upon request or the host will assume the device is non-functional.
+ *
+ * These values are set by the host via a class-specific request, however they are not required to be used accurately.
+ * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
+ * serial link characteristics and instead sends and recieves data in endpoint streams.
+ */
+CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** String to print through the virtual serial port when the joystick is pressed upwards. */
+char JoystickUpString[] = "Joystick Up\r\n";
+
+/** String to print through the virtual serial port when the joystick is pressed downwards. */
+char JoystickDownString[] = "Joystick Down\r\n";
+
+/** String to print through the virtual serial port when the joystick is pressed left. */
+char JoystickLeftString[] = "Joystick Left\r\n";
+
+/** String to print through the virtual serial port when the joystick is pressed right. */
+char JoystickRightString[] = "Joystick Right\r\n";
+
+/** String to print through the virtual serial port when the joystick is pressed inwards. */
+char JoystickPressedString[] = "Joystick Pressed\r\n";
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and CDC management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running CDC and USB management tasks */
+ Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start CDC task */
+ Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the CDC control commands,
+ * which are all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* LineCodingData = (uint8_t*)&LineCoding;
+
+ /* Process CDC specific control requests */
+ switch (bRequest)
+ {
+ case REQ_GetLineEncoding:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Write the line coding data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetLineEncoding:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Read the line coding data in from the host into the global struct */
+ Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
+
+ /* Finalize the stream transfer to clear the last packet from the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetControlLineState:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+#if 0
+ /* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake
+ lines. The mask is read in from the wValue parameter, and can be masked against the CONTROL_LINE_OUT_* masks
+ to determine the RTS and DTR line states using the following code:
+ */
+
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ // Do something with the given line states in wIndex
+#endif
+
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the CDC_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage CDC data transmission and reception to and from the host. */
+TASK(CDC_Task)
+{
+ char* ReportString = NULL;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ static bool ActionSent = false;
+
+#if 0
+ /* NOTE: Here you can use the notification endpoint to send back line state changes to the host, for the special RS-232
+ handshake signal lines (and some error states), via the CONTROL_LINE_IN_* masks and the following code:
+ */
+ USB_Notification_Header_t Notification = (USB_Notification_Header_t)
+ {
+ NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+ Notification: NOTIF_SerialState,
+ wValue: 0,
+ wIndex: 0,
+ wLength: sizeof(uint16_t),
+ };
+
+ uint16_t LineStateMask;
+
+ // Set LineStateMask here to a mask of CONTROL_LINE_IN_* masks to set the input handshake line states to send to the host
+
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+ Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
+ Endpoint_Write_Stream_LE(&LineStateMask, sizeof(LineStateMask));
+ Endpoint_ClearCurrentBank();
+#endif
+
+ /* Determine if a joystick action has occurred */
+ if (JoyStatus_LCL & JOY_UP)
+ ReportString = JoystickUpString;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportString = JoystickDownString;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportString = JoystickLeftString;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportString = JoystickRightString;
+ else if (JoyStatus_LCL & JOY_PRESS)
+ ReportString = JoystickPressedString;
+
+ /* Flag management - Only allow one string to be sent per action */
+ if (ReportString == NULL)
+ {
+ ActionSent = false;
+ }
+ else if (ActionSent == false)
+ {
+ ActionSent = true;
+
+ /* Select the Serial Tx Endpoint */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Write the String to the Endpoint */
+ Endpoint_Write_Stream_LE(ReportString, strlen(ReportString));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Select the Serial Rx Endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ /* Throw away any received data from the host */
+ if (Endpoint_ReadWriteAllowed())
+ Endpoint_ClearCurrentBank();
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/CDC.h b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.h
new file mode 100644
index 00000000..98f30b52
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.h
@@ -0,0 +1,190 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for CDC.c.
+ */
+
+#ifndef _CDC_H_
+#define _CDC_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** CDC Class specific request to get the current virtual serial port configuration settings. */
+ #define REQ_GetLineEncoding 0x21
+
+ /** CDC Class specific request to set the current virtual serial port configuration settings. */
+ #define REQ_SetLineEncoding 0x20
+
+ /** CDC Class specific request to set the current virtual serial port handshake line states. */
+ #define REQ_SetControlLineState 0x22
+
+ /** Notification type constant for a change in the virtual serial port handshake line states, for
+ * use with a USB_Notification_Header_t notification structure when sent to the host via the CDC
+ * notification endpoint.
+ */
+ #define NOTIF_SerialState 0x20
+
+ /** Mask for the DTR handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that the DTR line state should be high.
+ */
+ #define CONTROL_LINE_OUT_DTR (1 << 0)
+
+ /** Mask for the RTS handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that theRTS line state should be high.
+ */
+ #define CONTROL_LINE_OUT_RTS (1 << 1)
+
+ /** Mask for the DCD handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DCD line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DCD (1 << 0)
+
+ /** Mask for the DSR handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DSR line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DSR (1 << 1)
+
+ /** Mask for the BREAK handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the BREAK line state is currently high.
+ */
+ #define CONTROL_LINE_IN_BREAK (1 << 2)
+
+ /** Mask for the RING handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the RING line state is currently high.
+ */
+ #define CONTROL_LINE_IN_RING (1 << 3)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a framing error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_FRAMEERROR (1 << 4)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a parity error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_PARITYERROR (1 << 5)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a data overrun error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration
+ * as set by the host via a class specific request.
+ */
+ typedef struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
+ uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
+ * CDCDevice_CDC_LineCodingFormats_t enum
+ */
+ uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
+ * CDCDevice_LineCodingParity_t enum
+ */
+ uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */
+ } CDC_Line_Coding_t;
+
+ /** Type define for a CDC notification, sent to the host via the CDC notification endpoint to indicate a
+ * change in the device state asynchronously.
+ */
+ typedef struct
+ {
+ uint8_t NotificationType; /**< Notification type, a mask of REQDIR_*, REQTYPE_* and REQREC_* constants
+ * from the library StdRequestType.h header
+ */
+ uint8_t Notification; /**< Notification value, a NOTIF_* constant */
+ uint16_t wValue; /**< Notification wValue, notification-specific */
+ uint16_t wIndex; /**< Notification wIndex, notification-specific */
+ uint16_t wLength; /**< Notification wLength, notification-specific */
+ } USB_Notification_Header_t;
+
+ /* Enums: */
+ /** Enum for the possible line encoding formats of a virtual serial port. */
+ enum CDCDevice_CDC_LineCodingFormats_t
+ {
+ OneStopBit = 0, /**< Each frame contains one stop bit */
+ OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits */
+ TwoStopBits = 2, /**< Each frame contains two stop bits */
+ };
+
+ /** Enum for the possible line encoding parity settings of a virtual serial port. */
+ enum CDCDevice_LineCodingParity_t
+ {
+ Parity_None = 0, /**< No parity bit mode on each frame */
+ Parity_Odd = 1, /**< Odd parity bit mode on each frame */
+ Parity_Even = 2, /**< Even parity bit mode on each frame */
+ Parity_Mark = 3, /**< Mark parity bit mode on each frame */
+ Parity_Space = 4, /**< Space parity bit mode on each frame */
+ };
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum CDC_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Tasks: */
+ TASK(CDC_Task);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/CDC.txt b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.txt
new file mode 100644
index 00000000..34e1c82a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/CDC.txt
@@ -0,0 +1,45 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Communications Device Class Device (Virtual Serial Port)
+ *
+ * Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a CDC device acting as a virtual serial port. Joystick
+ * actions are transmitted to the host as strings. The device
+ * does not respond to serial data sent from the host.
+ *
+ * After running this demo for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Abstract Control Model (ACM)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.c
new file mode 100644
index 00000000..fa0c79da
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.c
@@ -0,0 +1,263 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x02,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2044,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x01}
+ },
+
+ CDC_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0xFF
+ },
+
+ DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA CDC Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.h
new file mode 100644
index 00000000..bec5e40d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
+ * uniform structure but variable sized data payloads, thus cannot be represented accurately by
+ * a single typedef struct. A macro is used instead so that functional descriptors can be created
+ * easily by specifying the size of the payload. This allows sizeof() to work correctly.
+ *
+ * \param DataSize Size in bytes of the CDC functional descriptor's data payload
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPNUM 2
+
+ /** Endpoint number of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPNUM 3
+
+ /** Endpoint number of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPNUM 4
+
+ /** Size in bytes of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Size in bytes of the CDC data IN and OUT endpoints. */
+ #define CDC_TXRX_EPSIZE 16
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t ManagementEndpoint;
+ USB_Descriptor_Interface_t DCI_Interface;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/CDC/Doxygen.conf
new file mode 100644
index 00000000..3493347c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - CDC Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/LUFA CDC.inf b/digital/avr/modules/usb/lufa/Demos/CDC/LUFA CDC.inf
new file mode 100644
index 00000000..d9d9ed63
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/LUFA CDC.inf
@@ -0,0 +1,55 @@
+; Windows LUFA CDC Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%COMPANY%
+LayoutFile=layout.inf
+DriverVer=06/06/2006,1.0.0.0
+
+[Manufacturer]
+%MFGNAME% = ManufName
+
+[DestinationDirs]
+DefaultDestDir=12
+
+[ManufName]
+%Modem3% = Modem3, USB\VID_03EB&PID_2044
+
+;------------------------------------------------------------------------------
+; Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[Modem3.nt]
+CopyFiles=USBModemCopyFileSection
+AddReg=Modem3.nt.AddReg
+
+[USBModemCopyFileSection]
+usbser.sys,,,0x20
+
+[Modem3.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[Modem3.nt.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+;------------------------------------------------------------------------------
+; String Definitions
+;------------------------------------------------------------------------------
+
+[Strings]
+COMPANY="LUFA Library"
+MFGNAME="Dean Camera"
+Modem3="USB Virtual Serial Port"
+SERVICE="USB Virtual Serial Port CDC Driver" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/CDC/makefile b/digital/avr/modules/usb/lufa/Demos/CDC/makefile
new file mode 100644
index 00000000..e42d173e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDC/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = CDC
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.aps b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.aps
new file mode 100644
index 00000000..b68991ca
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>CDCHost</ProjectName><Created>30-Sep-2008 14:05:20</Created><LastEdit>30-Sep-2008 14:05:44</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:05:20</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\CDCHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>CDCHost.c</SOURCEFILE><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><HEADERFILE>CDCHost.h</HEADERFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>CDCHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.c b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.c
new file mode 100644
index 00000000..ac6d89ad
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.c
@@ -0,0 +1,278 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the CDCHost demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "CDCHost.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA CDC Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_CDC_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "CDC Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop keyboard and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_CDC_Host, TASK_STOP);
+
+ puts_P(PSTR("\r\nDevice Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start CDC Host task */
+ Scheduler_SetTaskMode(USB_CDC_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the CDCHost_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read in
+ * data received from the attached CDC device and print it to the serial port.
+ */
+TASK(USB_CDC_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("CDC Device Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Select and the data IN pipe */
+ Pipe_SelectPipe(CDC_DATAPIPE_IN);
+
+ /* Check if data is in the pipe */
+ if (Pipe_ReadWriteAllowed())
+ {
+ /* Get the length of the pipe data, and create a new buffer to hold it */
+ uint16_t BufferLength = Pipe_BytesInPipe();
+ uint8_t Buffer[BufferLength];
+
+ /* Read in the pipe data to the tempoary buffer */
+ Pipe_Read_Stream_LE(Buffer, BufferLength);
+
+ /* Clear the pipe after it is read, ready for the next packet */
+ Pipe_ClearCurrentBank();
+
+ /* Print out the buffer contents to the USART */
+ for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)
+ putchar(Buffer[BufferByte]);
+ }
+
+ /* Select and unfreeze the notification pipe */
+ Pipe_SelectPipe(CDC_NOTIFICATIONPIPE);
+ Pipe_Unfreeze();
+
+ /* Check if data is in the pipe */
+ if (Pipe_ReadWriteAllowed())
+ {
+ /* Discard the event notification */
+ Pipe_ClearCurrentBank();
+ }
+
+ /* Freeze notification IN pipe after use */
+ Pipe_Freeze();
+
+ break;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.h b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.h
new file mode 100644
index 00000000..2adbefd3
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.h
@@ -0,0 +1,89 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for CDCHost.c.
+ */
+
+#ifndef _CDC_HOST_H_
+#define _CDC_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+
+ /* Macros: */
+ /** Pipe number for the CDC data IN pipe */
+ #define CDC_DATAPIPE_IN 1
+
+ /** Pipe number for the CDC data OUT pipe */
+ #define CDC_DATAPIPE_OUT 2
+
+ /** Pipe number for the CDC notification pipe */
+ #define CDC_NOTIFICATIONPIPE 3
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum CDCHost_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_CDC_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.txt b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.txt
new file mode 100644
index 00000000..5f8dc8cc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/CDCHost.txt
@@ -0,0 +1,42 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage CDC Host Demo
+ *
+ * CDC host demonstration application. This gives a simple reference application
+ * for implementing a USB CDC host, for CDC devices using the standard ACM profile.
+ *
+ * This demo prints out received CDC data through the serial port.
+ *
+ * Not that this demo is only compatible with devices which report the correct CDC
+ * and ACM class, subclass and protocol values. Most USB-Serial cables have vendor
+ * specific features, thus use vendor-specfic class/subclass/protocol codes to force
+ * the user to use specialized drivers. This demo is not compaible with such devices.
+ *
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Abstract Control Model (ACM)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.c
new file mode 100644
index 00000000..eb80ec3e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.c
@@ -0,0 +1,212 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a CDC interface descriptor containing bulk data IN and OUT endpoints, and an interrupt event endpoint.
+ *
+ * \return An error code from the CDCHost_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+ uint8_t FoundEndpoints = 0;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the CDC interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoCDCInterfaceFound;
+ }
+
+ /* Get the IN and OUT data endpoints for the CDC interface */
+ while (FoundEndpoints != ((1 << CDC_NOTIFICATIONPIPE) | (1 << CDC_DATAPIPE_IN) | (1 << CDC_DATAPIPE_OUT)))
+ {
+ /* Fetch the next bulk or interrupt endpoint from the current CDC interface */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceCDCDataEndpoint))
+ {
+ /* Get the next CDC interface from the configuration descriptor (CDC class has two CDC interfaces) */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoCDCInterfaceFound;
+ }
+
+ /* Fetch the next bulk or interrupt endpoint from the current CDC interface */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceCDCDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+ }
+
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Check if the found endpoint is a interrupt or bulk type descriptor */
+ if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)
+ {
+ /* If the endpoint is a IN type interrupt endpoint */
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Configure the notification pipe */
+ Pipe_ConfigurePipe(CDC_NOTIFICATIONPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
+
+ /* Set the flag indicating that the notification pipe has been found */
+ FoundEndpoints |= (1 << CDC_NOTIFICATIONPIPE);
+ }
+ }
+ else
+ {
+ /* Check if the endpoint is a bulk IN or bulk OUT endpoint */
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Configure the data IN pipe */
+ Pipe_ConfigurePipe(CDC_DATAPIPE_IN, EP_TYPE_BULK, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_Unfreeze();
+
+ /* Set the flag indicating that the data IN pipe has been found */
+ FoundEndpoints |= (1 << CDC_DATAPIPE_IN);
+ }
+ else
+ {
+ /* Configure the data OUT pipe */
+ Pipe_ConfigurePipe(CDC_DATAPIPE_OUT, EP_TYPE_BULK, PIPE_TOKEN_OUT,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_Unfreeze();
+
+ /* Set the flag indicating that the data OUT pipe has been found */
+ FoundEndpoints |= (1 << CDC_DATAPIPE_OUT);
+ }
+ }
+ }
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct CDC Class, Subclass and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextCDCInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the CDC descriptor class, subclass and protocol, break out if correct control interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CONTROL_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+
+ /* Check the CDC descriptor class, subclass and protocol, break out if correct data interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_DATA_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next bulk IN or OUT endpoint, or interrupt IN endpoint within the current interface,
+ * aborting the search if another interface descriptor is found before the required endpoint (so that it may be compared
+ * using a different comparator to determine if it is another CDC class interface).
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,
+ USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);
+
+ if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.h
new file mode 100644
index 00000000..04d71aad
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/ConfigDescriptor.h
@@ -0,0 +1,86 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "CDCHost.h"
+
+ /* Macros: */
+ /** Interface Class value for the CDC class */
+ #define CDC_CONTROL_CLASS 0x02
+
+ /** Interface Class value for the CDC Communication Interface subclass */
+ #define CDC_CONTROL_SUBCLASS 0x02
+
+ /** Interface Class value for the CDC protocol */
+ #define CDC_CONTROL_PROTOCOL 0x01
+
+ /** Interface Class value for the CDC data class */
+ #define CDC_DATA_CLASS 0x0A
+
+ /** Interface Class value for the CDC data subclass (unused) */
+ #define CDC_DATA_SUBCLASS 0x00
+
+ /** Interface Class value for the CDC data protocol */
+ #define CDC_DATA_PROTOCOL 0x00
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum CDCHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoCDCInterfaceFound = 4, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< Cmpatible CDC endpoints were not found in the device's CDC interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextCDCInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/CDCHost/Doxygen.conf
new file mode 100644
index 00000000..320951a5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - CDC Host Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/CDCHost/makefile b/digital/avr/modules/usb/lufa/Demos/CDCHost/makefile
new file mode 100644
index 00000000..5cd54dd5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/CDCHost/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = CDCHost
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.c
new file mode 100644
index 00000000..4f74b138
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.c
@@ -0,0 +1,385 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0xEF,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x204E,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 4,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ IAD1:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
+
+ FirstInterfaceIndex: 0,
+ TotalInterfaces: 2,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ IADStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC1_CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC1_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC1_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x01}
+ },
+
+ CDC1_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC1_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ CDC1_ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0xFF
+ },
+
+ CDC1_DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC1_DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ CDC1_DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ IAD2:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
+
+ FirstInterfaceIndex: 2,
+ TotalInterfaces: 2,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ IADStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC2_CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 2,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC2_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC2_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x03}
+ },
+
+ CDC2_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC2_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x02, 0x03}
+ },
+
+ CDC2_ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0xFF
+ },
+
+ CDC2_DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 3,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC2_DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ CDC2_DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Dual CDC Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.h
new file mode 100644
index 00000000..7bbe52fe
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/Descriptors.h
@@ -0,0 +1,118 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
+ * uniform structure but variable sized data payloads, thus cannot be represented accurately by
+ * a single typedef struct. A macro is used instead so that functional descriptors can be created
+ * easily by specifying the size of the payload. This allows sizeof() to work correctly.
+ *
+ * \param DataSize Size in bytes of the CDC functional descriptor's data payload
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */
+ #define CDC1_NOTIFICATION_EPNUM 3
+
+ /** Endpoint number of the first CDC interface's device-to-host data IN endpoint. */
+ #define CDC1_TX_EPNUM 1
+
+ /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */
+ #define CDC1_RX_EPNUM 2
+
+ /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */
+ #define CDC2_NOTIFICATION_EPNUM 4
+
+ /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */
+ #define CDC2_TX_EPNUM 5
+
+ /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */
+ #define CDC2_RX_EPNUM 6
+
+ /** Size in bytes of the CDC device-to-host notification IN endpoints. */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Size in bytes of the CDC data IN and OUT endpoints. */
+ #define CDC_TXRX_EPSIZE 16
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_Association_t IAD1;
+ USB_Descriptor_Interface_t CDC1_CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC1_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_Union;
+ USB_Descriptor_Endpoint_t CDC1_ManagementEndpoint;
+ USB_Descriptor_Interface_t CDC1_DCI_Interface;
+ USB_Descriptor_Endpoint_t CDC1_DataOutEndpoint;
+ USB_Descriptor_Endpoint_t CDC1_DataInEndpoint;
+ USB_Descriptor_Interface_Association_t IAD2;
+ USB_Descriptor_Interface_t CDC2_CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC2_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_Union;
+ USB_Descriptor_Endpoint_t CDC2_ManagementEndpoint;
+ USB_Descriptor_Interface_t CDC2_DCI_Interface;
+ USB_Descriptor_Endpoint_t CDC2_DataOutEndpoint;
+ USB_Descriptor_Endpoint_t CDC2_DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/DualCDC/Doxygen.conf
new file mode 100644
index 00000000..7b3b7417
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Dual CDC Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.aps b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.aps
new file mode 100644
index 00000000..276e7435
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>DualCDC</ProjectName><Created>30-Sep-2008 14:06:03</Created><LastEdit>30-Sep-2008 14:06:18</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:06:03</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\DualCDC\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>DualCDC.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>DualCDC.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>DualCDC.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.c b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.c
new file mode 100644
index 00000000..90f00997
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.c
@@ -0,0 +1,358 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the DualCDC demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "DualCDC.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA DualCDC App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: CDC1_Task , TaskStatus: TASK_STOP },
+ { Task: CDC2_Task , TaskStatus: TASK_STOP },
+};
+
+/* Globals: */
+/** Contains the current baud rate and other settings of the first virtual serial port. While this demo does not use
+ * the physical USART and thus does not use these settings, they must still be retained and returned to the host
+ * upon request or the host will assume the device is non-functional.
+ *
+ * These values are set by the host via a class-specific request, however they are not required to be used accurately.
+ * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
+ * serial link characteristics and instead sends and recieves data in endpoint streams.
+ */
+CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use
+ * the physical USART and thus does not use these settings, they must still be retained and returned to the host
+ * upon request or the host will assume the device is non-functional.
+ *
+ * These values are set by the host via a class-specific request, however they are not required to be used accurately.
+ * It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
+ * serial link characteristics and instead sends and recieves data in endpoint streams.
+ */
+CDC_Line_Coding_t LineCoding2 = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** String to print through the first virtual serial port when the joystick is pressed upwards. */
+char JoystickUpString[] = "Joystick Up\r\n";
+
+/** String to print through the first virtual serial port when the joystick is pressed downwards. */
+char JoystickDownString[] = "Joystick Down\r\n";
+
+/** String to print through the first virtual serial port when the joystick is pressed left. */
+char JoystickLeftString[] = "Joystick Left\r\n";
+
+/** String to print through the first virtual serial port when the joystick is pressed right. */
+char JoystickRightString[] = "Joystick Right\r\n";
+
+/** String to print through the first virtual serial port when the joystick is pressed inwards. */
+char JoystickPressedString[] = "Joystick Pressed\r\n";
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and CDC management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running CDC and USB management tasks */
+ Scheduler_SetTaskMode(CDC1_Task, TASK_STOP);
+ Scheduler_SetTaskMode(CDC2_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints for the first CDC */
+ Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC1_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC1_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Setup CDC Notification, Rx and Tx Endpoints for the second CDC */
+ Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC2_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC2_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start CDC tasks */
+ Scheduler_SetTaskMode(CDC1_Task, TASK_RUN);
+ Scheduler_SetTaskMode(CDC2_Task, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the CDC control commands,
+ * which are all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* LineCodingData;
+
+ /* Discard the unused wValue parameter */
+ Endpoint_Ignore_Word();
+
+ /* wIndex indicates the interface being controlled */
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ /* Determine which interface's Line Coding data is being set from the wIndex parameter */
+ LineCodingData = (wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2;
+
+ /* Process CDC specific control requests */
+ switch (bRequest)
+ {
+ case REQ_GetLineEncoding:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Write the line coding data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetLineEncoding:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Read the line coding data in from the host into the global struct */
+ Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
+
+ /* Finalize the stream transfer to clear the last packet from the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetControlLineState:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Send an empty packet to acknowedge the command (currently unused) */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the DualCDC_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage CDC data transmission and reception to and from the host for the first CDC interface, which sends joystick
+ * movements to the host as ASCII strings.
+ */
+TASK(CDC1_Task)
+{
+ char* ReportString = NULL;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ static bool ActionSent = false;
+
+ /* Determine if a joystick action has occurred */
+ if (JoyStatus_LCL & JOY_UP)
+ ReportString = JoystickUpString;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportString = JoystickDownString;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportString = JoystickLeftString;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportString = JoystickRightString;
+ else if (JoyStatus_LCL & JOY_PRESS)
+ ReportString = JoystickPressedString;
+
+ /* Flag management - Only allow one string to be sent per action */
+ if (ReportString == NULL)
+ {
+ ActionSent = false;
+ }
+ else if (ActionSent == false)
+ {
+ ActionSent = true;
+
+ /* Select the Serial Tx Endpoint */
+ Endpoint_SelectEndpoint(CDC1_TX_EPNUM);
+
+ /* Write the String to the Endpoint */
+ Endpoint_Write_Stream_LE(ReportString, strlen(ReportString));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Select the Serial Rx Endpoint */
+ Endpoint_SelectEndpoint(CDC1_RX_EPNUM);
+
+ /* Throw away any received data from the host */
+ if (Endpoint_ReadWriteAllowed())
+ Endpoint_ClearCurrentBank();
+}
+
+/** Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echos back
+ * all data sent to it from the host.
+ */
+TASK(CDC2_Task)
+{
+ /* Select the Serial Rx Endpoint */
+ Endpoint_SelectEndpoint(CDC2_RX_EPNUM);
+
+ /* Check to see if any data has been received */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Create a temp buffer big enough to hold the incomming endpoint packet */
+ uint8_t Buffer[Endpoint_BytesInEndpoint()];
+
+ /* Remember how large the incomming packet is */
+ uint16_t DataLength = Endpoint_BytesInEndpoint();
+
+ /* Read in the incomming packet into the buffer */
+ Endpoint_Read_Stream_LE(&Buffer, DataLength);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Select the Serial Tx Endpoint */
+ Endpoint_SelectEndpoint(CDC2_TX_EPNUM);
+
+ /* Write the received data to the endpoint */
+ Endpoint_Write_Stream_LE(&Buffer, DataLength);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.h b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.h
new file mode 100644
index 00000000..5a01e07f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.h
@@ -0,0 +1,126 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for DualCDC.c.
+ */
+
+#ifndef _DUAL_CDC_H_
+#define _DUAL_CDC_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** CDC Class specific request to get the current virtual serial port configuration settings. */
+ #define REQ_GetLineEncoding 0x21
+
+ /** CDC Class specific request to set the current virtual serial port configuration settings. */
+ #define REQ_SetLineEncoding 0x20
+
+ /** CDC Class specific request to set the current virtual serial port handshake line states. */
+ #define REQ_SetControlLineState 0x22
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration
+ * as set by the host via a class specific request.
+ */
+ typedef struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
+ uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
+ * CDCDevice_CDC_LineCodingFormats_t enum
+ */
+ uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
+ * CDCDevice_LineCodingParity_t enum
+ */
+ uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */
+ } CDC_Line_Coding_t;
+
+ /* Enums: */
+ /** Enum for the possible line encoding formats of a virtual serial port. */
+ enum CDCDevice_CDC_LineCodingFormats_t
+ {
+ OneStopBit = 0, /**< Each frame contains one stop bit */
+ OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits */
+ TwoStopBits = 2, /**< Each frame contains two stop bits */
+ };
+
+ /** Enum for the possible line encoding parity settings of a virtual serial port. */
+ enum CDCDevice_LineCodingParity_t
+ {
+ Parity_None = 0, /**< No parity bit mode on each frame */
+ Parity_Odd = 1, /**< Odd parity bit mode on each frame */
+ Parity_Even = 2, /**< Even parity bit mode on each frame */
+ Parity_Mark = 3, /**< Mark parity bit mode on each frame */
+ Parity_Space = 4, /**< Space parity bit mode on each frame */
+ };
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum DualCDC_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Tasks: */
+ TASK(CDC1_Task);
+ TASK(CDC2_Task);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.txt b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.txt
new file mode 100644
index 00000000..aebbec35
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/DualCDC.txt
@@ -0,0 +1,57 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Dual Communications Device Class Device (Dual Virtual Serial Port)
+ *
+ * Dual Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a compound device with dual CDC functions acting as a pair
+ * of virtual serial ports. This demo uses Interface Association
+ * Descriptors to link together the pair of related CDC
+ * descriptors for each virtual serial port, which may not be
+ * supported in all OSes - Windows Vista is supported, as is
+ * XP (although the latter may need a hotfix to function).
+ *
+ * Joystick actions are transmitted to the host as strings
+ * through the first serial port. The device does not respond to
+ * serial data sent from the host in the first serial port.
+ *
+ * The second serial port echoes back data sent from the host.
+ *
+ * After running this demo for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Miscellaneous Device Class</td>
+ * <td>( Sub-Interface: Communications Device Class (CDC) )</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Common Class</td>
+ * <td>( Sub-Interface: Abstract Control Model (ACM) )</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Interface Association Descriptor ECN</td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/LUFA DualCDC.inf b/digital/avr/modules/usb/lufa/Demos/DualCDC/LUFA DualCDC.inf
new file mode 100644
index 00000000..10ba560f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/LUFA DualCDC.inf
@@ -0,0 +1,56 @@
+; Windows LUFA Dual CDC Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%COMPANY%
+LayoutFile=layout.inf
+DriverVer=06/06/2006,1.0.0.0
+
+[Manufacturer]
+%MFGNAME% = ManufName
+
+[DestinationDirs]
+DefaultDestDir=12
+
+[ManufName]
+%Modem3% = Modem3, USB\VID_03EB&PID_204E&MI_00
+%Modem3% = Modem3, USB\VID_03EB&PID_204E&MI_02
+
+;------------------------------------------------------------------------------
+; Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[Modem3.nt]
+CopyFiles=USBModemCopyFileSection
+AddReg=Modem3.nt.AddReg
+
+[USBModemCopyFileSection]
+usbser.sys,,,0x20
+
+[Modem3.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[Modem3.nt.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+;------------------------------------------------------------------------------
+; String Definitions
+;------------------------------------------------------------------------------
+
+[Strings]
+COMPANY="LUFA Library"
+MFGNAME="Dean Camera"
+Modem3="USB Virtual Serial Port"
+SERVICE="USB Virtual Serial Port CDC Driver" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/DualCDC/makefile b/digital/avr/modules/usb/lufa/Demos/DualCDC/makefile
new file mode 100644
index 00000000..103cd7d8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/DualCDC/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = DualCDC
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.c
new file mode 100644
index 00000000..36e644c2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.c
@@ -0,0 +1,250 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x04, /* Usage (Joystick) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xa1, 0x00, /* Collection (Physical) */
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x30, /* Usage (X) */
+ 0x09, 0x31, /* Usage (Y) */
+ 0x15, 0x9c, /* Logical Minimum (-100) */
+ 0x25, 0x64, /* Logical Maximum (100) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x81, 0x82, /* Input (Data, Variable, Absolute, Volatile) */
+ 0x05, 0x09, /* Usage Page (Button) */
+ 0x09, 0x02, /* Usage (Button 2) */
+ 0x09, 0x01, /* Usage (Button 1) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x75, 0x06, /* Report Size (6) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x81, 0x01, /* Input (Constant) */
+ 0xc0, /* End Collection */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2043,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ JoystickHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(JoystickReport)
+ },
+
+ JoystickEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: JOYSTICK_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Joystick Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.JoystickHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(JoystickReport);
+ Size = sizeof(JoystickReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.h
new file mode 100644
index 00000000..3463d962
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Descriptors.h
@@ -0,0 +1,93 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t JoystickHID;
+ USB_Descriptor_Endpoint_t JoystickEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Joystick HID reporting IN endpoint. */
+ #define JOYSTICK_EPNUM 1
+
+ /** Size in bytes of the Joystick HID reporting IN endpoint. */
+ #define JOYSTICK_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/Joystick/Doxygen.conf
new file mode 100644
index 00000000..2af5ce68
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Joystick Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.aps b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.aps
new file mode 100644
index 00000000..245245da
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>Joystick</ProjectName><Created>30-Sep-2008 14:06:38</Created><LastEdit>30-Sep-2008 14:07:27</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:06:38</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\Joystick\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>Joystick.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>Joystick.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>Joystick.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.c b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.c
new file mode 100644
index 00000000..88d41584
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.c
@@ -0,0 +1,264 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Joystick demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "Joystick.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Joystick App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Joystick_Report , TaskStatus: TASK_STOP },
+};
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and joystick reporting tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running joystick reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_Joystick_Report, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the joystick reporting task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Joystick Report Endpoint */
+ Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, JOYSTICK_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start joystick reporting task */
+ Scheduler_SetTaskMode(USB_Joystick_Report, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_JoystickReport_Data_t JoystickReportData;
+
+ /* Create the next HID report to send to the host */
+ GetNextReport(&JoystickReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(JoystickReportData))
+ wLength = sizeof(JoystickReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&JoystickReportData, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ }
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_JoystickReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->Y = -100;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->Y = 100;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 100;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->X = -100;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->Button = (1 << 1);
+
+ if (HWB_GetStatus())
+ ReportData->Button |= (1 << 0);
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = (uint8_t)(PrevJoyStatus ^ JoyStatus_LCL);
+
+ /* Save the current joystick status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the Joystick_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage HID report generation and transmission to the host. */
+TASK(USB_Joystick_Report)
+{
+ /* Check if the USB System is connected to a Host */
+ if (USB_IsConnected)
+ {
+ /* Select the Joystick Report Endpoint */
+ Endpoint_SelectEndpoint(JOYSTICK_EPNUM);
+
+ /* Check if Joystick Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ USB_JoystickReport_Data_t JoystickReportData;
+
+ /* Create the next HID report to send to the host */
+ GetNextReport(&JoystickReportData);
+
+ /* Write Joystick Report Data */
+ Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Clear the report data afterwards */
+ JoystickReportData.X = 0;
+ JoystickReportData.Y = 0;
+ JoystickReportData.Button = 0;
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.h b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.h
new file mode 100644
index 00000000..966fa7e1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Joystick.c.
+ */
+
+#ifndef _JOYSTICK_H_
+#define _JOYSTICK_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Task Definitions: */
+ TASK(USB_Joystick_Report);
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /* Type Defines: */
+ /** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ int8_t X; /**< Current absolute joystick X position, as a signed 8-bit integer */
+ int8_t Y; /**< Current absolute joystick Y position, as a signed 8-bit integer */
+ uint8_t Button; /**< Bit mask of the currently pressed joystick buttons */
+ } USB_JoystickReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum Joystick_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_JoystickReport_Data_t* ReportData);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.txt b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.txt
new file mode 100644
index 00000000..6229aa04
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/Joystick.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Joystick Device Demo
+ *
+ * Joystick demonstration application. This gives a simple reference
+ * application for implementing a USB Keyboard device, for USB Joysticks
+ * using the standard Keyboard HID profile.
+ *
+ * This device will show up as a generic joystick device, with two buttons.
+ * Pressing the joystick inwards is the first button, and the HWB button
+ * is the second.
+ *
+ * Moving the joystick on the selected board moves the joystick location on
+ * the host computer.
+ *
+ * Currently only single interface joysticks are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/Joystick/makefile b/digital/avr/modules/usb/lufa/Demos/Joystick/makefile
new file mode 100644
index 00000000..abd98972
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Joystick/makefile
@@ -0,0 +1,700 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = Joystick
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.c
new file mode 100644
index 00000000..e11ef662
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.c
@@ -0,0 +1,267 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x06, /* Usage (Keyboard) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x08, /* Report Count (8) */
+ 0x05, 0x07, /* Usage Page (Key Codes) */
+ 0x19, 0xe0, /* Usage Minimum (Keyboard LeftControl) */
+ 0x29, 0xe7, /* Usage Maximum (Keyboard Right GUI) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x81, 0x03, /* Input (Const, Variable, Absolute) */
+ 0x95, 0x05, /* Report Count (5) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x08, /* Usage Page (LEDs) */
+ 0x19, 0x01, /* Usage Minimum (Num Lock) */
+ 0x29, 0x05, /* Usage Maximum (Kana) */
+ 0x91, 0x02, /* Output (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x03, /* Report Size (3) */
+ 0x91, 0x03, /* Output (Const, Variable, Absolute) */
+ 0x95, 0x06, /* Report Count (6) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x65, /* Logical Maximum (101) */
+ 0x05, 0x07, /* Usage Page (Keyboard) */
+ 0x19, 0x00, /* Usage Minimum (Reserved (no event indicated)) */
+ 0x29, 0x65, /* Usage Maximum (Keyboard Application) */
+ 0x81, 0x00, /* Input (Data, Array, Absolute) */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2042,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 2,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ KeyboardHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(KeyboardReport)
+ },
+
+ KeyboardEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ KeyboardLEDsEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Keyboard Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(KeyboardReport);
+ Size = sizeof(KeyboardReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.h
new file mode 100644
index 00000000..aa1bf05b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t KeyboardHID;
+ USB_Descriptor_Endpoint_t KeyboardEndpoint;
+ USB_Descriptor_Endpoint_t KeyboardLEDsEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_EPNUM 1
+
+ /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_LEDS_EPNUM 2
+
+ /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */
+ #define KEYBOARD_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/Keyboard/Doxygen.conf
new file mode 100644
index 00000000..79a300ae
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.aps b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.aps
new file mode 100644
index 00000000..541c1750
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>Keyboard</ProjectName><Created>30-Sep-2008 13:59:29</Created><LastEdit>30-Sep-2008 14:00:25</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 13:59:29</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Keyboard.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\Keyboard\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>Keyboard.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>Keyboard.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>Keyboard.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>makefile</FileName><Status>1</Status></File00000></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.c b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.c
new file mode 100644
index 00000000..92f4ae94
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.c
@@ -0,0 +1,429 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Keyboard demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "Keyboard.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Keyboard App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Keyboard_Report , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and Keyboard reporting tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running keyboard reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the keyboard reporting task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Keyboard Keycode Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Setup Keyboard LED Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_LEDS_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_OUT, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+
+ /* Start Keyboard reporting task */
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+
+ /* Create the next keyboard report for transmission to the host */
+ GetNextReport(&KeyboardReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(KeyboardReportData))
+ wLength = sizeof(KeyboardReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetReport:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Wait until the LED report has been sent by the host */
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Clear the endpoint data */
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until the host is ready to receive the request confirmation */
+ while (!(Endpoint_IsSetupINReady()));
+
+ /* Handshake the request by sending an empty IN packet */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_KeyboardReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->KeyCode[0] = 0x04; // A
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->KeyCode[0] = 0x05; // B
+
+ if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->KeyCode[0] = 0x06; // C
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->KeyCode[0] = 0x07; // D
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->KeyCode[0] = 0x08; // E
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = (uint8_t)(PrevJoyStatus ^ JoyStatus_LCL);
+
+ /* Save the current joystick status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Processes a given LED report mask from the host and sets the board LEDs to match.
+ *
+ * \param LEDReport LED mask from the host, containing a mask of what LEDs are set
+ */
+void ProcessLEDReport(uint8_t LEDReport)
+{
+ uint8_t LEDMask = LEDS_LED2;
+
+ if (LEDReport & 0x01) // NUM Lock
+ LEDMask |= LEDS_LED1;
+
+ if (LEDReport & 0x02) // CAPS Lock
+ LEDMask |= LEDS_LED3;
+
+ if (LEDReport & 0x04) // SCROLL Lock
+ LEDMask |= LEDS_LED4;
+
+ /* Set the status LEDs to the current Keyboard LED status */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the Keyboard_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage HID report generation and transmission to the host, when in report mode. */
+TASK(USB_Keyboard_Report)
+{
+ USB_KeyboardReport_Data_t KeyboardReportData;
+ bool SendReport;
+
+ /* Create the next keyboard report for transmission to the host */
+ SendReport = GetNextReport(&KeyboardReportData);
+
+ /* Check if the idle period is set and has elapsed */
+ if (IdleCount && !(IdleMSRemaining))
+ {
+ /* Idle period elapsed, indicate that a report must be sent */
+ SendReport = true;
+
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+
+ /* Check if the USB system is connected to a host */
+ if (USB_IsConnected)
+ {
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
+
+ /* Check if Keyboard Endpoint Ready for Read/Write, and if we should send a report */
+ if (Endpoint_ReadWriteAllowed() && SendReport)
+ {
+ /* Write Keyboard Report Data */
+ Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Select the Keyboard LED Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_LEDS_EPNUM);
+
+ /* Check if Keyboard LED Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Handshake the OUT Endpoint - clear endpoint and ready for next report */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.h b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.h
new file mode 100644
index 00000000..e1aed1ec
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.h
@@ -0,0 +1,116 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Keyboard.c.
+ */
+
+#ifndef _KEYBOARD_H_
+#define _KEYBOARD_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Task Definitions: */
+ TASK(USB_Keyboard_Report);
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Modifier mask byte, containing a mask of modifier keys set (such as shift or CTRL) */
+ uint8_t Reserved; /**< Reserved, always set as 0x00 */
+ uint8_t KeyCode[6]; /**< Array of up to six simultaneous key codes of pressed keys */
+ } USB_KeyboardReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum Keyboard_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_KeyboardReport_Data_t* ReportData);
+ void ProcessLEDReport(uint8_t LEDReport);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.txt b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.txt
new file mode 100644
index 00000000..c2277255
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/Keyboard.txt
@@ -0,0 +1,43 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Keyboard Device Demo
+ *
+ * Keyboard demonstration application. This gives a simple reference
+ * application for implementing a USB Keyboard using the basic USB HID
+ * drivers in all modern OSes (i.e. no special drivers required). It is
+ * boot protocol compatible, and thus works under compatible BIOS as if
+ * it was a native keyboard (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a keyboard when the USB connection to a host is present. To use
+ * the keyboard example, manipulate the joystick to send the letters
+ * a, b, c, d and e. See the USB HID documentation for more information
+ * on sending keyboard event and keypresses.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/Keyboard/makefile b/digital/avr/modules/usb/lufa/Demos/Keyboard/makefile
new file mode 100644
index 00000000..b870c21f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Keyboard/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = Keyboard
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.c
new file mode 100644
index 00000000..23c4165a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.c
@@ -0,0 +1,267 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x06, /* Usage (Keyboard) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x08, /* Report Count (8) */
+ 0x05, 0x07, /* Usage Page (Key Codes) */
+ 0x19, 0xe0, /* Usage Minimum (Keyboard LeftControl) */
+ 0x29, 0xe7, /* Usage Maximum (Keyboard Right GUI) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x81, 0x03, /* Input (Const, Variable, Absolute) */
+ 0x95, 0x05, /* Report Count (5) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x08, /* Usage Page (LEDs) */
+ 0x19, 0x01, /* Usage Minimum (Num Lock) */
+ 0x29, 0x05, /* Usage Maximum (Kana) */
+ 0x91, 0x02, /* Output (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x03, /* Report Size (3) */
+ 0x91, 0x03, /* Output (Const, Variable, Absolute) */
+ 0x95, 0x06, /* Report Count (6) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x65, /* Logical Maximum (101) */
+ 0x05, 0x07, /* Usage Page (Keyboard) */
+ 0x19, 0x00, /* Usage Minimum (Reserved (no event indicated)) */
+ 0x29, 0x65, /* Usage Maximum (Keyboard Application) */
+ 0x81, 0x00, /* Input (Data, Array, Absolute) */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2042,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 2,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ KeyboardHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(KeyboardReport)
+ },
+
+ KeyboardEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ KeyboardLEDsEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(16), Type: DTYPE_String},
+
+ UnicodeString: L"Denver Gingerich"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Keyboard Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(KeyboardReport);
+ Size = sizeof(KeyboardReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.h
new file mode 100644
index 00000000..aa1bf05b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t KeyboardHID;
+ USB_Descriptor_Endpoint_t KeyboardEndpoint;
+ USB_Descriptor_Endpoint_t KeyboardLEDsEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_EPNUM 1
+
+ /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_LEDS_EPNUM 2
+
+ /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */
+ #define KEYBOARD_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Doxygen.conf
new file mode 100644
index 00000000..0a35a143
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Device Demo (Fully Interrupt Driven)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.aps
new file mode 100644
index 00000000..f23575e3
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardFullInt</ProjectName><Created>30-Sep-2008 14:07:59</Created><LastEdit>30-Sep-2008 14:08:25</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:07:59</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardFullInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>KeyboardFullInt.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>KeyboardFullInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardFullInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>makefile</FileName><Status>1</Status></File00000></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.c b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.c
new file mode 100644
index 00000000..7e90b5ff
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.c
@@ -0,0 +1,462 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardFullInt demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardFullInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA KeyboardFI App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Main program code loop */
+ for (;;)
+ {
+ /* No main code -- all USB code is interrupt driven */
+ }
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+}
+
+/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the
+ * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled
+ * asynchronously when they arrive rather than when the control endpoint is polled manually.
+ */
+EVENT_HANDLER(USB_Reset)
+{
+ /* Select the control endpoint */
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+
+ /* Enable the endpoint SETUP interrupt ISR for the control endpoint */
+ USB_INT_Enable(ENDPOINT_INT_SETUP);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the keyboard device endpoints.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Keyboard Keycode Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint IN interrupt ISR for the report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_IN);
+
+ /* Setup Keyboard LED Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_LEDS_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_OUT, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint OUT interrupt ISR for the LED report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_OUT);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+
+ /* Create the next keyboard report for transmission to the host */
+ GetNextReport(&KeyboardReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(KeyboardReportData))
+ wLength = sizeof(KeyboardReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetReport:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Wait until the LED report has been sent by the host */
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Clear the endpoint data */
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until the host is ready to receive the request confirmation */
+ while (!(Endpoint_IsSetupINReady()));
+
+ /* Handshake the request by sending an empty IN packet */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_KeyboardReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->KeyCode[0] = 0x04; // A
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->KeyCode[0] = 0x05; // B
+
+ if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->KeyCode[0] = 0x06; // C
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->KeyCode[0] = 0x07; // D
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->KeyCode[0] = 0x08; // E
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = (uint8_t)(PrevJoyStatus ^ JoyStatus_LCL);
+
+ /* Save the current joystick status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Processes a given LED report mask from the host and sets the board LEDs to match.
+ *
+ * \param LEDReport LED mask from the host, containing a mask of what LEDs are set
+ */
+void ProcessLEDReport(uint8_t LEDReport)
+{
+ uint8_t LEDMask = LEDS_LED2;
+
+ if (LEDReport & 0x01) // NUM Lock
+ LEDMask |= LEDS_LED1;
+
+ if (LEDReport & 0x02) // CAPS Lock
+ LEDMask |= LEDS_LED3;
+
+ if (LEDReport & 0x04) // SCROLL Lock
+ LEDMask |= LEDS_LED4;
+
+ /* Set the status LEDs to the current Keyboard LED status */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardFullInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as
+ * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send
+ * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB
+ * controller. It is also used to respond to standard and class specific requests send to the device on the control
+ * endpoint, by handing them off to the LUFA library when they are received.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ /* Check if the control endpoint has received a request */
+ if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))
+ {
+ /* Clear the endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(ENDPOINT_CONTROLEP);
+
+ /* Process the control request */
+ USB_USBTask();
+
+ /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */
+ USB_INT_Clear(ENDPOINT_INT_SETUP);
+ }
+
+ /* Check if keyboard endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(KEYBOARD_EPNUM))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+ bool SendReport;
+
+ /* Create the next keyboard report for transmission to the host */
+ SendReport = GetNextReport(&KeyboardReportData);
+
+ /* Check if the idle period is set and has elapsed */
+ if (IdleCount && !(IdleMSRemaining))
+ {
+ /* Idle period elapsed, indicate that a report must be sent */
+ SendReport = true;
+
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+
+ /* Check to see if a report should be issued */
+ if (SendReport)
+ {
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Keyboard Report endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
+
+ /* Write Keyboard Report Data */
+ Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+
+ /* Check if Keyboard LED status Endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(KEYBOARD_LEDS_EPNUM))
+ {
+ /* Select the Keyboard LED Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_LEDS_EPNUM);
+
+ /* Clear the endpoint OUT interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_OUT);
+
+ /* Clear the Keyboard LED Report endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_LEDS_EPNUM);
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Handshake the OUT Endpoint - clear endpoint and ready for next report */
+ Endpoint_ClearCurrentBank();
+ }
+}
+
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.h b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.h
new file mode 100644
index 00000000..7711faaa
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.h
@@ -0,0 +1,115 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for KeyboardFullInt.c.
+ */
+
+#ifndef _KEYBOARD_H_
+#define _KEYBOARD_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Modifier mask byte, containing a mask of modifier keys set (such as shift or CTRL) */
+ uint8_t Reserved; /**< Reserved, always set as 0x00 */
+ uint8_t KeyCode[6]; /**< Array of up to six simultaneous key codes of pressed keys */
+ } USB_KeyboardReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardFullInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
+ HANDLES_EVENT(USB_Reset);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_KeyboardReport_Data_t* ReportData);
+ void ProcessLEDReport(uint8_t LEDReport);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.txt
new file mode 100644
index 00000000..89071188
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/KeyboardFullInt.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Fully Interrupt Driven Keyboard Device Demo
+ *
+ * Keyboard demonstration application, using endpoint interrupts for the
+ * exchange of data to the USB host, and control requests on the control
+ * endpoint. This gives a simple reference application for implementing a
+ * USB Keyboard using the basic USB HID drivers in all modern OSes (i.e.
+ * no special drivers required). It is boot protocol compatible, and thus
+ * works under compatible BIOS as if it was a native keyboard (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a keyboard when the USB connection to a host is present. To use
+ * the keyboard example, manipulate the joystick to send the letters
+ * a, b, c, d and e. See the USB HID documentation for more information
+ * on sending keyboard event and keypresses.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/makefile
new file mode 100644
index 00000000..6937f41b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardFullInt/makefile
@@ -0,0 +1,701 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardFullInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.c
new file mode 100644
index 00000000..7a704cfc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.c
@@ -0,0 +1,144 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint.
+ *
+ * \return An error code from the KeyboardHost_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the keyboard interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the keyboard interface's data endpoint descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceKeyboardDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the keyboard data pipe */
+ Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Keyboard HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.h
new file mode 100644
index 00000000..1d168b45
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/ConfigDescriptor.h
@@ -0,0 +1,74 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "KeyboardHost.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define KEYBOARD_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Keyboard compliant device */
+ #define KEYBOARD_PROTOCOL 0x01
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum KeyboardHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextKeyboardInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/Doxygen.conf
new file mode 100644
index 00000000..3bdbc95e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Host Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.aps
new file mode 100644
index 00000000..f80c86dc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardHost</ProjectName><Created>30-Sep-2008 14:08:48</Created><LastEdit>30-Sep-2008 14:09:04</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:08:48</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>KeyboardHost.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>KeyboardHost.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.c
new file mode 100644
index 00000000..dd05bdea
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.c
@@ -0,0 +1,314 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardHost demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardHost.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA KBD Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Keyboard_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Keyboard Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop Keyboard and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_STOP);
+
+ puts_P(PSTR("Device Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Keyboard Host task */
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardHost_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read and process
+ * HID reports from the device and display the results onto the board LEDs.
+ */
+TASK(USB_Keyboard_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ /* HID class request to set the keyboard protocol to the Boot Protocol */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_SetProtocol,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Protocol).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Keyboard Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Select and unfreeze keyboard data pipe */
+ Pipe_SelectPipe(KEYBOARD_DATAPIPE);
+ Pipe_Unfreeze();
+
+ /* Check if data has been received from the attached keyboard */
+ if (Pipe_ReadWriteAllowed())
+ {
+ USB_KeyboardReport_Data_t KeyboardReport;
+
+ /* Read in keyboard report data */
+ Pipe_Read_Stream_LE(&KeyboardReport, sizeof(KeyboardReport));
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+
+ /* Indicate if the modifier byte is non-zero */
+ LEDs_ChangeLEDs(LEDS_LED1, (KeyboardReport.Modifier) ? LEDS_LED1 : 0);
+
+ /* Check if a key has been pressed */
+ if (KeyboardReport.KeyCode)
+ {
+ /* Toggle status LED to indicate keypress */
+ if (LEDs_GetLEDs() & LEDS_LED2)
+ LEDs_TurnOffLEDs(LEDS_LED2);
+ else
+ LEDs_TurnOnLEDs(LEDS_LED2);
+
+ char PressedKey = 0;
+
+ /* Retrieve pressed key character if alphanumeric */
+ if ((KeyboardReport.KeyCode >= 0x04) && (KeyboardReport.KeyCode <= 0x1D))
+ PressedKey = (KeyboardReport.KeyCode - 0x04) + 'A';
+ else if ((KeyboardReport.KeyCode >= 0x1E) && (KeyboardReport.KeyCode <= 0x27))
+ PressedKey = (KeyboardReport.KeyCode - 0x1E) + '0';
+ else if (KeyboardReport.KeyCode == 0x2C)
+ PressedKey = ' ';
+ else if (KeyboardReport.KeyCode == 0x28)
+ PressedKey = '\n';
+
+ /* Print the pressed key character out through the serial port if valid */
+ if (PressedKey)
+ putchar(PressedKey);
+ }
+ }
+
+ /* Freeze keyboard data pipe */
+ Pipe_Freeze();
+ break;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.h
new file mode 100644
index 00000000..97695f74
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.h
@@ -0,0 +1,95 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for KeyboardHost.c.
+ */
+
+#ifndef _KEYBOARD_HOST_H_
+#define _KEYBOARD_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+
+ /* Macros: */
+ /** Pipe number for the keyboard data IN pipe */
+ #define KEYBOARD_DATAPIPE 1
+
+ /** HID Class Specific request to set the report protocol mode */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for a standard Boot Protocol Keyboard report */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (such as Shift, Control, etc.) */
+ uint8_t RESERVED; /**< Reserved for OEM use, always set to 0 */
+ uint8_t KeyCode; /**< Key code of the currently pressed key */
+ } USB_KeyboardReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardHost_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Keyboard_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.txt
new file mode 100644
index 00000000..92e38078
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/KeyboardHost.txt
@@ -0,0 +1,46 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Keyboard Host Demo
+ *
+ * Keyboard host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse keyboard, for USB keyboards using
+ * the standard keyboard HID profile.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1.
+ *
+ * This uses a naive method where the keyboard is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * KeyboardHostWithParser demo application.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHost/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/makefile
new file mode 100644
index 00000000..f502bc31
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHost/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardHost
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.c
new file mode 100644
index 00000000..aaf929fe
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.c
@@ -0,0 +1,149 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint.
+ *
+ * \return An error code from the KeyboardHostViaInt_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the keyboard interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the keyboard interface's data endpoint descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceKeyboardDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the keyboard data pipe */
+ Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
+ Pipe_Unfreeze();
+
+ /* Enable the pipe IN interrupt for the data pipe */
+ USB_INT_Enable(PIPE_INT_IN);
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Keyboard HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.h
new file mode 100644
index 00000000..95854509
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/ConfigDescriptor.h
@@ -0,0 +1,74 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "KeyboardHostViaInt.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define KEYBOARD_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Keyboard compliant device */
+ #define KEYBOARD_PROTOCOL 0x01
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum KeyboardHostViaInt_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextKeyboardInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/Doxygen.conf
new file mode 100644
index 00000000..185fcd32
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Host Demo (Via Pipe Interrupts)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.aps
new file mode 100644
index 00000000..7a7cdb4c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardHostViaInt</ProjectName><Created>30-Sep-2008 14:09:23</Created><LastEdit>30-Sep-2008 14:09:46</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:09:23</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostViaInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>KeyboardHostViaInt.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>KeyboardHostViaInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardHostViaInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c
new file mode 100644
index 00000000..ecff9511
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.c
@@ -0,0 +1,321 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardHostViaInt demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardHostViaInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA KBD Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Keyboard_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Keyboard Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop keyboard and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_STOP);
+
+ puts_P(PSTR("\r\nDevice Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Keyboard Host task */
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to enable the pipe
+ * interrupts so that reports can be processed as they arrive from the device.
+ */
+TASK(USB_Keyboard_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ /* HID class request to set the keyboard protocol to the Boot Protocol */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_SetProtocol,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Protocol).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Keyboard Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardHostViaInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Interrupt handler for the Endpoint/Pipe interrupt vector. This interrupt fires each time an enabled
+ * pipe interrupt occurs on a pipe which has had that interrupt enabled.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ USB_KeyboardReport_Data_t KeyboardReport;
+ char PressedKey = 0;
+
+ /* Check to see if the keyboard data pipe has caused the interrupt */
+ if (Pipe_HasPipeInterrupted(KEYBOARD_DATAPIPE))
+ {
+ /* Clear the pipe interrupt, and select the keyboard pipe */
+ Pipe_ClearPipeInterrupt(KEYBOARD_DATAPIPE);
+ Pipe_SelectPipe(KEYBOARD_DATAPIPE);
+
+ /* Check to see if the pipe IN interrupt has fired */
+ if (USB_INT_HasOccurred(PIPE_INT_IN) && USB_INT_IsEnabled(PIPE_INT_IN))
+ {
+ /* Clear interrupt flag */
+ USB_INT_Clear(PIPE_INT_IN);
+
+ /* Read in keyboard report data */
+ Pipe_Read_Stream_LE(&KeyboardReport, sizeof(KeyboardReport));
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+
+ LEDs_ChangeLEDs(LEDS_LED1, (KeyboardReport.Modifier) ? LEDS_LED1 : 0);
+
+ /* Check if a key has been pressed */
+ if (KeyboardReport.KeyCode)
+ {
+ /* Toggle status LED to indicate keypress */
+ if (LEDs_GetLEDs() & LEDS_LED4)
+ LEDs_TurnOffLEDs(LEDS_LED4);
+ else
+ LEDs_TurnOnLEDs(LEDS_LED4);
+
+ /* Retrieve pressed key character if alphanumeric */
+ if ((KeyboardReport.KeyCode >= 0x04) && (KeyboardReport.KeyCode <= 0x1D))
+ PressedKey = (KeyboardReport.KeyCode - 0x04) + 'A';
+ else if ((KeyboardReport.KeyCode >= 0x1E) && (KeyboardReport.KeyCode <= 0x27))
+ PressedKey = (KeyboardReport.KeyCode - 0x1E) + '0';
+ else if (KeyboardReport.KeyCode == 0x2C)
+ PressedKey = ' ';
+ else if (KeyboardReport.KeyCode == 0x28)
+ PressedKey = '\n';
+
+ /* Print the pressed key character out through the serial port if valid */
+ if (PressedKey)
+ putchar(PressedKey);
+ }
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h
new file mode 100644
index 00000000..22848eea
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h
@@ -0,0 +1,95 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for KeyboardHostViaInt.c.
+ */
+
+#ifndef _KEYBOARD_HOST_VIA_INT_H_
+#define _KEYBOARD_HOST_VIA_INT_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+ #include <avr/interrupt.h>
+ #include <avr/wdt.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+
+ /* Macros: */
+ /** Pipe number for the keyboard data IN pipe */
+ #define KEYBOARD_DATAPIPE 1
+
+ /** HID Class Specific request to set the report protocol mode */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for a standard Boot Protocol Keyboard report */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (such as Shift, Control, etc.) */
+ uint8_t RESERVED; /**< Reserved for OEM use, always set to 0 */
+ uint8_t KeyCode; /**< Key code of the currently pressed key */
+ } USB_KeyboardReport_Data_t;
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardHostViaInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Keyboard_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt
new file mode 100644
index 00000000..07c11084
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt
@@ -0,0 +1,47 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Keyboard Host Demo
+ *
+ * Keyboard host demonstration application, using pipe interrupts. This gives
+ * a simple reference application for implementing a USB Keyboard host utilizing
+ * the LUFA pipe interrupt system, for USB keyboards using the standard Keyboard
+ * HID profile.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1.
+ *
+ * This uses a naive method where the keyboard is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * KeyboardHostWithParser demo application.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/makefile
new file mode 100644
index 00000000..23155ed4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostViaInt/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardHostViaInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.c
new file mode 100644
index 00000000..2c962cbc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.c
@@ -0,0 +1,171 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint and HID descriptor.
+ *
+ * \return An error code from the KeyboardHostWithParser_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+ uint8_t ErrorCode;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the keyboard interface from the configuration descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface)))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the keyboard interface's HID descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDDescriptorFound;
+ }
+
+ /* Save the HID report size for later use */
+ HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;
+
+ /* Get the keyboard interface's data endpoint descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceKeyboardDataEndpoint)))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the keyboard data pipe */
+ Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Keyboard HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next HID descriptor within the current HID interface descriptor.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextHID)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)
+ return Descriptor_Search_Found;
+ else
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.h
new file mode 100644
index 00000000..e007a942
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/ConfigDescriptor.h
@@ -0,0 +1,81 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "HIDReport.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define KEYBOARD_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Keyboard compliant device */
+ #define KEYBOARD_PROTOCOL 0x01
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /** Descriptor header type constant for a HID descriptor */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type constant for a HID report descriptor */
+ #define DTYPE_Report 0x22
+
+ /* Enums: */
+ enum KeyboardHostWithParser_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoHIDDescriptorFound = 5, /**< A compatible HID descriptor was not found in the device's HID interface */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextKeyboardInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint);
+ DESCRIPTOR_COMPARATOR(NextHID);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/Doxygen.conf
new file mode 100644
index 00000000..6c6db18f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Host (Using HID Descriptor Parser)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.c
new file mode 100644
index 00000000..70749eb1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.c
@@ -0,0 +1,119 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "HIDReport.h"
+
+/** Size in bytes of the attached device's HID report descriptor */
+uint16_t HIDReportSize;
+
+/** Processed HID report descriptor items structure, containing information on each HID report element */
+HID_ReportInfo_t HIDReportInfo;
+
+
+/** Function to read in the HID report descriptor from the attached device, and process it into easy-to-read
+ * structures via the HID parser routines in the LUFA library.
+ *
+ * \return A value from the KeyboardHostWithParser_GetHIDReportDataCodes_t enum
+ */
+uint8_t GetHIDReportData(void)
+{
+ /* Create a buffer big enough to hold the entire returned HID report */
+ uint8_t HIDReportData[HIDReportSize];
+
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
+ bRequest: REQ_GetDescriptor,
+ wValue: (DTYPE_Report << 8),
+ wIndex: 0,
+ wLength: HIDReportSize,
+ };
+
+ /* Send control request to retrieve the HID report from the attached device */
+ if (USB_Host_SendControlRequest(HIDReportData) != HOST_SENDCONTROL_Successful)
+ return ParseControlError;
+
+ /* Send the HID report to the parser for processing */
+ if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)
+ return ParseError;
+
+ return ParseSuccessful;
+}
+
+/** Function to print out the attached device's HID descriptor elements in human readable form
+ * through the serial port. This is good for examining a device's HID descriptors, however it
+ * can cause noticible delays as there is generally a lot of data to be sent.
+ */
+void DumpHIDReportItems(void)
+{
+ /* Loop through each of the loaded HID report items in the processed item structure */
+ for (uint8_t ItemIndex = 0; ItemIndex < HIDReportInfo.TotalReportItems; ItemIndex++)
+ {
+ /* Create pointer to the current report info structure */
+ HID_ReportItem_t* RItem = &HIDReportInfo.ReportItems[ItemIndex];
+
+ /* Print out each report item's details */
+ printf_P(PSTR(" Item %d:\r\n"
+ " Type: %s\r\n"
+ " Flags: %d\r\n"
+ " BitOffset: %d\r\n"
+ " BitSize: %d\r\n"
+ " Coll Ptr: %d\r\n"
+ " Coll Usage: %d\r\n"
+ " Coll Prnt: %d\r\n"
+ " Usage Page: %d\r\n"
+ " Usage: %d\r\n"
+ " Usage Min: %d\r\n"
+ " Usage Max: %d\r\n"
+ " Unit Type: %d\r\n"
+ " Unit Exp: %d\r\n"
+ " Log Min: %d\r\n"
+ " Log Max: %d\r\n"
+ " Phy Min: %d\r\n"
+ " Phy Max: %d\r\n"), ItemIndex,
+ ((RItem->ItemType == REPORT_ITEM_TYPE_In) ? "IN" : "OUT"),
+ RItem->ItemFlags,
+ RItem->BitOffset,
+ RItem->Attributes.BitSize,
+ RItem->CollectionPath,
+ RItem->CollectionPath->Usage,
+ RItem->CollectionPath->Parent,
+ RItem->Attributes.Usage.Page,
+ RItem->Attributes.Usage.Usage,
+ RItem->Attributes.Usage.MinMax.Minimum,
+ RItem->Attributes.Usage.MinMax.Maximum,
+ RItem->Attributes.Unit.Type,
+ RItem->Attributes.Unit.Exponent,
+ RItem->Attributes.Logical.Minimum,
+ RItem->Attributes.Logical.Maximum,
+ RItem->Attributes.Physical.Minimum,
+ RItem->Attributes.Physical.Maximum);
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.h
new file mode 100644
index 00000000..282b58b2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/HIDReport.h
@@ -0,0 +1,80 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for HIDReport.c.
+ */
+
+#ifndef _HID_REPORT_H_
+#define _HID_REPORT_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/Class/HIDParser.h> // HID Class Report Parser
+
+ #include "KeyboardHostWithParser.h"
+
+ /* Macros: */
+ /** HID Report Descriptor Usage Page value for a desktop keyboard */
+ #define USAGE_PAGE_KEYBOARD 0x07
+
+ /* Enums: */
+ /** Enum for the possible return codes of the GetHIDReportData() function. */
+ enum KeyboardHostWithParser_GetHIDReportDataCodes_t
+ {
+ ParseSuccessful = 0, /**< HID report descriptor parsed successfully */
+ ParseError = 1, /**< Failed to fully process the HID report descriptor */
+ ParseControlError = 2, /**< Control error occured while trying to read the device HID descriptor */
+ };
+
+ /* Type Defines: */
+ /** Type define for a HID descriptor. */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+
+ uint16_t HIDSpec; /**< Implemented HID class specification, in BCD encoded format */
+ uint8_t CountryCode; /**< Country code value for localized hardware */
+
+ uint8_t TotalHIDReports; /**< Total number of HID report descriptors in the current interface */
+
+ uint8_t HIDReportType; /**< HID report type of the first HID report descriptor */
+ uint16_t HIDReportLength; /**< Total size in bytes of the first HID report descriptor */
+ } USB_Descriptor_HID_t;
+
+ /* External Variables: */
+ extern uint16_t HIDReportSize;
+ extern HID_ReportInfo_t HIDReportInfo;
+
+ /* Function Prototypes: */
+ uint8_t GetHIDReportData(void);
+ void DumpHIDReportItems(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.aps
new file mode 100644
index 00000000..3a51668b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardHostWithParser</ProjectName><Created>30-Sep-2008 14:10:10</Created><LastEdit>30-Sep-2008 14:10:39</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:10:10</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>KeyboardHostWithParser.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>HIDReport.c</SOURCEFILE><SOURCEFILE>KeyboardHostWithParser.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>HIDReport.h</HEADERFILE><HEADERFILE>KeyboardHostWithParser.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardHostWithParser.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\ConfigDescriptor.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\HIDReport.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\KeyboardHostWithParser.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\ConfigDescriptor.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\HIDReport.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardHostWithParser\KeyboardHostWithParser.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c
new file mode 100644
index 00000000..7b92c302
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -0,0 +1,345 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardHostWithParser demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardHostWithParser.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA KBD Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Keyboard_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Keyboard Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop keyboard and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_STOP);
+
+ puts_P(PSTR("\r\nDevice Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Keyboard Host task */
+ Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardHostWithParser_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ case Status_Busy:
+ LEDMask = (LEDS_LED1 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read and process
+ * the HID report descriptor and HID reports from the device and display the results onto the board LEDs.
+ */
+TASK(USB_Keyboard_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Processing HID Report.\r\n"));
+
+ /* LEDs one and two on to indicate busy processing */
+ UpdateStatus(Status_Busy);
+
+ /* Get and process the device's first HID report descriptor */
+ if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)
+ {
+ puts_P(PSTR("Report Parse Error.\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Dumping HID Report Items.\r\n"));
+
+ /* Dump the HID report items to the serial port */
+ DumpHIDReportItems();
+
+ /* All LEDs off - ready to indicate keypresses */
+ UpdateStatus(Status_USBReady);
+
+ puts_P(PSTR("Keyboard Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Select and unfreeze keyboard data pipe */
+ Pipe_SelectPipe(KEYBOARD_DATAPIPE);
+ Pipe_Unfreeze();
+
+ /* Check if data has been received from the attached keyboard */
+ if (Pipe_ReadWriteAllowed())
+ {
+ /* Create buffer big enough for the report */
+ uint8_t KeyboardReport[Pipe_BytesInPipe()];
+
+ /* Load in the keyboard report */
+ Pipe_Read_Stream_LE(KeyboardReport, Pipe_BytesInPipe());
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+
+ /* Check each HID report item in turn, looking for keyboard scan code reports */
+ for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
+ {
+ /* Create a tempoary item pointer to the next report item */
+ HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
+
+ /* Check if the current report item is a keyboard scancode */
+ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
+ (ReportItem->Attributes.BitSize == 8) &&
+ (ReportItem->Attributes.Logical.Maximum > 1) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Retrieve the keyboard scancode from the report data retrieved from the device */
+ bool FoundData = GetReportItemInfo(KeyboardReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ /* Key code is an unsigned char in length, cast to the appropriate type */
+ uint8_t KeyCode = (uint8_t)ReportItem->Value;
+
+ /* If scancode is non-zero, a key is being pressed */
+ if (KeyCode)
+ {
+ /* Toggle status LED to indicate keypress */
+ if (LEDs_GetLEDs() & LEDS_LED2)
+ LEDs_TurnOffLEDs(LEDS_LED2);
+ else
+ LEDs_TurnOnLEDs(LEDS_LED2);
+
+ char PressedKey = 0;
+
+ /* Convert scancode to printable character if alphanumeric */
+ if ((KeyCode >= 0x04) && (KeyCode <= 0x1D))
+ PressedKey = (KeyCode - 0x04) + 'A';
+ else if ((KeyCode >= 0x1E) && (KeyCode <= 0x27))
+ PressedKey = (KeyCode - 0x1E) + '0';
+ else if (KeyCode == 0x2C)
+ PressedKey = ' ';
+ else if (KeyCode == 0x28)
+ PressedKey = '\n';
+
+ /* Print the pressed key character out through the serial port if valid */
+ if (PressedKey)
+ putchar(PressedKey);
+ }
+
+ /* Once a scancode is found, stop scanning through the report items */
+ break;
+ }
+ }
+ }
+
+ /* Freeze keyboard data pipe */
+ Pipe_Freeze();
+ break;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h
new file mode 100644
index 00000000..6846e179
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.h
@@ -0,0 +1,80 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#ifndef _KEYBOARD_HOST_H_
+#define _KEYBOARD_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+ #include "HIDReport.h"
+
+ /* Macros: */
+ /** Pipe number for the keyboard report data pipe */
+ #define KEYBOARD_DATAPIPE 1
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardHostWithParser_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ Status_Busy = 5, /**< Busy dumping HID report items to the serial port */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Keyboard_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt
new file mode 100644
index 00000000..09a83ca5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Keyboard Host With HID Descriptor Parser Demo
+ *
+ * Keyboard host demonstration application. This gives a simple reference
+ * application for implementing a USB Keyboard host, for USB keyboards using
+ * the standard Keyboard HID profile. It uses a HID parser for the HID reports,
+ * allowing for correct operation across all USB keyboards. This demo supports
+ * keyboards with a single HID report.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1. On connection to a USB keyboard, the
+ * report items will be processed and printed as a formatted list through the
+ * USART before the keyboard is fully enumerated.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/makefile
new file mode 100644
index 00000000..6c5a236d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardHostWithParser/makefile
@@ -0,0 +1,707 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardHostWithParser
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ HIDReport.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/Class/HIDParser.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.c
new file mode 100644
index 00000000..c9d91039
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.c
@@ -0,0 +1,354 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ *
+ * This descriptor describes the mouse HID interface's report structure.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x02, /* Usage (Mouse) */
+ 0xA1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xA1, 0x00, /* Collection (Physical) */
+ 0x95, 0x03, /* Report Count (3) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x09, /* Usage Page (Button) */
+ 0x19, 0x01, /* Usage Minimum (Button 1) */
+ 0x29, 0x03, /* Usage Maximum (Button 3) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x05, /* Report Size (5) */
+ 0x81, 0x01, /* Input (Constant) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x05, 0x01, /* Usage Page (Generic Desktop Control) */
+ 0x09, 0x30, /* Usage X */
+ 0x09, 0x31, /* Usage Y */
+ 0x15, 0x81, /* Logical Minimum (-127) */
+ 0x25, 0x7F, /* Logical Maximum (127) */
+ 0x81, 0x06, /* Input (Data, Variable, Relative) */
+ 0xC0, /* End Collection */
+ 0xC0, /* End Collection */
+};
+
+/** Same as the MouseReport structure, but defines the keyboard HID interface's report structure. */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x06, /* Usage (Keyboard) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x08, /* Report Count (8) */
+ 0x05, 0x07, /* Usage Page (Key Codes) */
+ 0x19, 0xe0, /* Usage Minimum (Keyboard LeftControl) */
+ 0x29, 0xe7, /* Usage Maximum (Keyboard Right GUI) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x81, 0x03, /* Input (Const, Variable, Absolute) */
+ 0x95, 0x05, /* Report Count (5) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x08, /* Usage Page (LEDs) */
+ 0x19, 0x01, /* Usage Minimum (Num Lock) */
+ 0x29, 0x05, /* Usage Maximum (Kana) */
+ 0x91, 0x02, /* Output (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x03, /* Report Size (3) */
+ 0x91, 0x03, /* Output (Const, Variable, Absolute) */
+ 0x95, 0x06, /* Report Count (6) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x65, /* Logical Maximum (101) */
+ 0x05, 0x07, /* Usage Page (Keyboard) */
+ 0x19, 0x00, /* Usage Minimum (Reserved (no event indicated)) */
+ 0x29, 0x65, /* Usage Maximum (Keyboard Application) */
+ 0x81, 0x00, /* Input (Data, Array, Absolute) */
+ 0xC0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x204D,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ KeyboardInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 2,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ KeyboardHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(KeyboardReport)
+ },
+
+ KeyboardInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_IN_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: HID_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ KeyboardOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: HID_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ MouseInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x01,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x02,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ MouseHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(MouseReport)
+ },
+
+ MouseInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: HID_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(28), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Mouse and Keyboard Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ if (!(wIndex))
+ {
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ }
+ else
+ {
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ }
+ break;
+ case DTYPE_Report:
+ if (!(wIndex))
+ {
+ Address = DESCRIPTOR_ADDRESS(KeyboardReport);
+ Size = sizeof(KeyboardReport);
+ }
+ else
+ {
+ Address = DESCRIPTOR_ADDRESS(MouseReport);
+ Size = sizeof(MouseReport);
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.h
new file mode 100644
index 00000000..59495425
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Descriptors.h
@@ -0,0 +1,104 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t KeyboardInterface;
+ USB_Descriptor_HID_t KeyboardHID;
+ USB_Descriptor_Endpoint_t KeyboardInEndpoint;
+ USB_Descriptor_Endpoint_t KeyboardOutEndpoint;
+ USB_Descriptor_Interface_t MouseInterface;
+ USB_Descriptor_HID_t MouseHID;
+ USB_Descriptor_Endpoint_t MouseInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_IN_EPNUM 1
+
+ /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_OUT_EPNUM 2
+
+ /** Endpoint number of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_IN_EPNUM 3
+
+ /** Size in bytes of each of the HID reporting IN and OUT endpoints. */
+ #define HID_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Doxygen.conf
new file mode 100644
index 00000000..12916856
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Combined Keyboard/Mouse Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.aps
new file mode 100644
index 00000000..eb54f1d4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardMouse</ProjectName><Created>30-Sep-2008 14:11:00</Created><LastEdit>30-Sep-2008 14:11:17</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:11:00</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardMouse\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>KeyboardMouse.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>KeyboardMouse.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardMouse.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.c b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.c
new file mode 100644
index 00000000..2216472d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.c
@@ -0,0 +1,372 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardMouse demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardMouse.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MouseKBD App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Mouse , TaskStatus: TASK_RUN },
+ { Task: USB_Keyboard , TaskStatus: TASK_RUN },
+};
+
+/* Global Variables */
+/** Global structure to hold the current keyboard interface HID report, for transmission to the host */
+USB_KeyboardReport_Data_t KeyboardReportData;
+
+/** Global structure to hold the current mouse interface HID report, for transmission to the host */
+USB_MouseReport_Data_t MouseReportData;
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management task.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running HID reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the keyboard and mouse device endpoints.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Keyboard Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, HID_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Setup Keyboard LED Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_OUT, HID_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Setup Mouse Report Endpoint */
+ Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, HID_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* ReportData;
+ uint8_t ReportSize;
+
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_Ignore_Word();
+
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ /* Determine if it is the mouse or the keyboard data that is being requested */
+ if (!(wIndex))
+ {
+ ReportData = (uint8_t*)&KeyboardReportData;
+ ReportSize = sizeof(KeyboardReportData);
+ }
+ else
+ {
+ ReportData = (uint8_t*)&MouseReportData;
+ ReportSize = sizeof(MouseReportData);
+ }
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > ReportSize)
+ wLength = ReportSize;
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(ReportData, wLength);
+
+ /* Clear the report data afterwards */
+ memset(ReportData, 0, ReportSize);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetReport:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Wait until the LED report has been sent by the host */
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+ uint8_t LEDMask = LEDS_LED2;
+
+ if (LEDStatus & 0x01) // NUM Lock
+ LEDMask |= LEDS_LED1;
+
+ if (LEDStatus & 0x02) // CAPS Lock
+ LEDMask |= LEDS_LED3;
+
+ if (LEDStatus & 0x04) // SCROLL Lock
+ LEDMask |= LEDS_LED4;
+
+ /* Set the status LEDs to the current HID LED status */
+ LEDs_SetAllLEDs(LEDMask);
+
+ /* Clear the endpoint data */
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until the host is ready to receive the request confirmation */
+ while (!(Endpoint_IsSetupINReady()));
+
+ /* Handshake the request by sending an empty IN packet */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardMouse_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Keyboard task. This generates the next keyboard HID report for the host, and transmits it via the
+ * keyboard IN endpoint when the host is ready for more data. Additionally, it processes host LED status
+ * reports sent to the device via the keyboard OUT reporting endpoint.
+ */
+TASK(USB_Keyboard)
+{
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+
+ /* Check if HWB is not pressed, if so mouse mode enabled */
+ if (!(HWB_GetStatus()))
+ {
+ if (JoyStatus_LCL & JOY_UP)
+ KeyboardReportData.KeyCode[0] = 0x04; // A
+ else if (JoyStatus_LCL & JOY_DOWN)
+ KeyboardReportData.KeyCode[0] = 0x05; // B
+
+ if (JoyStatus_LCL & JOY_LEFT)
+ KeyboardReportData.KeyCode[0] = 0x06; // C
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ KeyboardReportData.KeyCode[0] = 0x07; // D
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ KeyboardReportData.KeyCode[0] = 0x08; // E
+ }
+
+ /* Check if the USB system is connected to a host and report protocol mode is enabled */
+ if (USB_IsConnected)
+ {
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);
+
+ /* Check if Keyboard Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Write Keyboard Report Data */
+ Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Clear the report data afterwards */
+ memset(&KeyboardReportData, 0, sizeof(KeyboardReportData));
+ }
+
+ /* Select the Keyboard LED Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);
+
+ /* Check if Keyboard LED Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+ uint8_t LEDMask = LEDS_LED2;
+
+ if (LEDStatus & 0x01) // NUM Lock
+ LEDMask |= LEDS_LED1;
+
+ if (LEDStatus & 0x02) // CAPS Lock
+ LEDMask |= LEDS_LED3;
+
+ if (LEDStatus & 0x04) // SCROLL Lock
+ LEDMask |= LEDS_LED4;
+
+ /* Set the status LEDs to the current Keyboard LED status */
+ LEDs_SetAllLEDs(LEDMask);
+
+ /* Handshake the OUT Endpoint - clear endpoint and ready for next report */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+}
+
+/** Mouse task. This generates the next mouse HID report for the host, and transmits it via the
+ * mouse IN endpoint when the host is ready for more data.
+ */
+TASK(USB_Mouse)
+{
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+
+ /* Check if HWB is pressed, if so mouse mode enabled */
+ if (HWB_GetStatus())
+ {
+ if (JoyStatus_LCL & JOY_UP)
+ MouseReportData.Y = 1;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ MouseReportData.Y = -1;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ MouseReportData.X = 1;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ MouseReportData.X = -1;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ MouseReportData.Button = (1 << 0);
+ }
+
+ /* Check if the USB system is connected to a host and report protocol mode is enabled */
+ if (USB_IsConnected)
+ {
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
+
+ /* Check if Mouse Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Write Mouse Report Data */
+ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Clear the report data afterwards */
+ memset(&MouseReportData, 0, sizeof(MouseReportData));
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.h b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.h
new file mode 100644
index 00000000..f5c1d4e7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.h
@@ -0,0 +1,114 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#ifndef _KEYBOARD_MOUSE_H_
+#define _KEYBOARD_MOUSE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Task Definitions: */
+ TASK(USB_Keyboard);
+ TASK(USB_Mouse);
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardMouse_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Modifier mask byte, containing a mask of modifier keys set (such as shift or CTRL) */
+ uint8_t Reserved; /**< Reserved, always set as 0x00 */
+ uint8_t KeyCode[6]; /**< Array of up to six simultaneous key codes of pressed keys */
+ } USB_KeyboardReport_Data_t;
+
+ /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Button; /**< Bit mask of the currently pressed mouse buttons */
+ int8_t X; /**< Current mouse delta X movement, as a signed 8-bit integer */
+ int8_t Y; /**< Current mouse delta Y movement, as a signed 8-bit integer */
+ } USB_MouseReport_Data_t;
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.txt
new file mode 100644
index 00000000..969e2871
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/KeyboardMouse.txt
@@ -0,0 +1,48 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Dual HID Keyboard and Mouse Device Demo
+ *
+ * Keyboard/Mouse demonstration application. This gives a simple reference
+ * application for implementing a composite device containing both USB Keyboard
+ * and USB Mouse functionality using the basic USB HID drivers in all modern OSes
+ * (i.e. no special drivers required). This example uses two seperate HID
+ * interfaces for each function. It is boot protocol compatible, and thus works under
+ * compatible BIOS as if it was a native keyboard and mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a keyboard when the USB connection to a host is present and the HWB is not
+ * pressed. When enabled, manipulate the joystick to send the letters
+ * a, b, c, d and e. See the USB HID documentation for more information
+ * on sending keyboard event and keypresses.
+ *
+ * When the HWB is pressed, the mouse mode is enabled. When enabled, move the
+ * joystick to move the pointer, and push the joystick inwards to simulate a
+ * left-button click.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/makefile
new file mode 100644
index 00000000..1fc0a6ea
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardMouse/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardMouse
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.c
new file mode 100644
index 00000000..8e28b59e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.c
@@ -0,0 +1,267 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x06, /* Usage (Keyboard) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x08, /* Report Count (8) */
+ 0x05, 0x07, /* Usage Page (Key Codes) */
+ 0x19, 0xe0, /* Usage Minimum (Keyboard LeftControl) */
+ 0x29, 0xe7, /* Usage Maximum (Keyboard Right GUI) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x81, 0x03, /* Input (Const, Variable, Absolute) */
+ 0x95, 0x05, /* Report Count (5) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x08, /* Usage Page (LEDs) */
+ 0x19, 0x01, /* Usage Minimum (Num Lock) */
+ 0x29, 0x05, /* Usage Maximum (Kana) */
+ 0x91, 0x02, /* Output (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x03, /* Report Size (3) */
+ 0x91, 0x03, /* Output (Const, Variable, Absolute) */
+ 0x95, 0x06, /* Report Count (6) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x65, /* Logical Maximum (101) */
+ 0x05, 0x07, /* Usage Page (Keyboard) */
+ 0x19, 0x00, /* Usage Minimum (Reserved (no event indicated)) */
+ 0x29, 0x65, /* Usage Maximum (Keyboard Application) */
+ 0x81, 0x00, /* Input (Data, Array, Absolute) */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2042,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 2,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ KeyboardHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(KeyboardReport)
+ },
+
+ KeyboardEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ KeyboardLEDsEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(16), Type: DTYPE_String},
+
+ UnicodeString: L"Denver Gingerich"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Keyboard Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(KeyboardReport);
+ Size = sizeof(KeyboardReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.h
new file mode 100644
index 00000000..aa1bf05b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t KeyboardHID;
+ USB_Descriptor_Endpoint_t KeyboardEndpoint;
+ USB_Descriptor_Endpoint_t KeyboardLEDsEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_EPNUM 1
+
+ /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_LEDS_EPNUM 2
+
+ /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */
+ #define KEYBOARD_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Doxygen.conf
new file mode 100644
index 00000000..d354a312
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Keyboard Device Demo (Via Endpoint Interrupts)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.aps b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.aps
new file mode 100644
index 00000000..d31b4a0f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>KeyboardViaInt</ProjectName><Created>30-Sep-2008 14:11:35</Created><LastEdit>30-Sep-2008 14:11:49</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:11:35</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\KeyboardViaInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>KeyboardViaInt.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>KeyboardViaInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>KeyboardViaInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.c b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.c
new file mode 100644
index 00000000..7f6fcd8c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.c
@@ -0,0 +1,453 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the KeyboardViaInt demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "KeyboardViaInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA KeyboardI App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management task.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running keyboard reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the keyboard device endpoints.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Keyboard Keycode Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint IN interrupt ISR for the report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_IN);
+
+ /* Setup Keyboard LED Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_LEDS_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_OUT, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint OUT interrupt ISR for the LED report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_OUT);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+
+ /* Create the next keyboard report for transmission to the host */
+ GetNextReport(&KeyboardReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(KeyboardReportData))
+ wLength = sizeof(KeyboardReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetReport:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Wait until the LED report has been sent by the host */
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Clear the endpoint data */
+ Endpoint_ClearSetupOUT();
+
+ /* Wait until the host is ready to receive the request confirmation */
+ while (!(Endpoint_IsSetupINReady()));
+
+ /* Handshake the request by sending an empty IN packet */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_KeyboardReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->KeyCode[0] = 0x04; // A
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->KeyCode[0] = 0x05; // B
+
+ if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->KeyCode[0] = 0x06; // C
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->KeyCode[0] = 0x07; // D
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->KeyCode[0] = 0x08; // E
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = (uint8_t)(PrevJoyStatus ^ JoyStatus_LCL);
+
+ /* Save the current joystick status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Processes a given LED report mask from the host and sets the board LEDs to match.
+ *
+ * \param LEDReport LED mask from the host, containing a mask of what LEDs are set
+ */
+void ProcessLEDReport(uint8_t LEDReport)
+{
+ uint8_t LEDMask = LEDS_LED2;
+
+ if (LEDReport & 0x01) // NUM Lock
+ LEDMask |= LEDS_LED1;
+
+ if (LEDReport & 0x02) // CAPS Lock
+ LEDMask |= LEDS_LED3;
+
+ if (LEDReport & 0x04) // SCROLL Lock
+ LEDMask |= LEDS_LED4;
+
+ /* Set the status LEDs to the current Keyboard LED status */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the KeyboardViaInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as
+ * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send
+ * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB
+ * controller.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ /* Save previously selected endpoint before selecting a new endpoint */
+ uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();
+
+ /* Check if keyboard endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(KEYBOARD_EPNUM))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+ bool SendReport;
+
+ /* Create the next keyboard report for transmission to the host */
+ SendReport = GetNextReport(&KeyboardReportData);
+
+ /* Check if the idle period is set and has elapsed */
+ if (IdleCount && !(IdleMSRemaining))
+ {
+ /* Idle period elapsed, indicate that a report must be sent */
+ SendReport = true;
+
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+
+ /* Check to see if a report should be issued */
+ if (SendReport)
+ {
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Keyboard Report endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
+
+ /* Write Keyboard Report Data */
+ Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
+ }
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Check if Keyboard LED status Endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(KEYBOARD_LEDS_EPNUM))
+ {
+ /* Select the Keyboard LED Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_LEDS_EPNUM);
+
+ /* Clear the endpoint OUT interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_OUT);
+
+ /* Clear the Keyboard LED Report endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_LEDS_EPNUM);
+
+ /* Read in the LED report from the host */
+ uint8_t LEDStatus = Endpoint_Read_Byte();
+
+ /* Process the incomming LED report */
+ ProcessLEDReport(LEDStatus);
+
+ /* Handshake the OUT Endpoint - clear endpoint and ready for next report */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Restore previously selected endpoint */
+ Endpoint_SelectEndpoint(PrevSelectedEndpoint);
+}
+
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.h b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.h
new file mode 100644
index 00000000..833bc919
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.h
@@ -0,0 +1,112 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for KeyboardViaInt.c.
+ */
+
+#ifndef _KEYBOARD_H_
+#define _KEYBOARD_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Modifier mask byte, containing a mask of modifier keys set (such as shift or CTRL) */
+ uint8_t Reserved; /**< Reserved, always set as 0x00 */
+ uint8_t KeyCode[6]; /**< Array of up to six simultaneous key codes of pressed keys */
+ } USB_KeyboardReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum KeyboardViaInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_KeyboardReport_Data_t* ReportData);
+ void ProcessLEDReport(uint8_t LEDReport);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.txt b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.txt
new file mode 100644
index 00000000..02ee7592
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/KeyboardViaInt.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Partially Interrupt Driven Keyboard Device Demo
+ *
+ * Keyboard demonstration application, using endpoint interrupts for the
+ * exchange of data to the USB host. This gives a simple reference
+ * application for implementing a USB Keyboard using the basic USB HID
+ * drivers in all modern OSes (i.e. no special drivers required). It is
+ * boot protocol compatible, and thus works under compatible BIOS as if
+ * it was a native keyboard (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a keyboard when the USB connection to a host is present. To use
+ * the keyboard example, manipulate the joystick to send the letters
+ * a, b, c, d and e. See the USB HID documentation for more information
+ * on sending keyboard event and keypresses.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/makefile b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/makefile
new file mode 100644
index 00000000..2e2108e7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/KeyboardViaInt/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = KeyboardViaInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.c
new file mode 100644
index 00000000..1dbc1d91
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.c
@@ -0,0 +1,325 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2048,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ AudioControlInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0x01,
+ SubClass: 0x01,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioControlInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_Header,
+
+ ACSpecification: VERSION_BCD(01.00),
+ TotalLength: sizeof(USB_AudioInterface_AC_t),
+
+ InCollection: 1,
+ InterfaceNumbers: {1},
+ },
+
+ AudioStreamInterface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x01,
+ SubClass: 0x03,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ AudioStreamInterface_SPC:
+ {
+ Header: {Size: sizeof(USB_AudioInterface_MIDI_AS_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_General,
+
+ AudioSpecification: VERSION_BCD(01.00),
+
+ TotalLength: (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, AudioStreamInterface_SPC))
+ },
+
+ MIDI_In_Jack_Emb:
+ {
+ Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_InputJack,
+
+ JackType: JACKTYPE_EMBEDDED,
+ JackID: 0x01,
+
+ JackStrIndex: NO_DESCRIPTOR
+ },
+
+ MIDI_In_Jack_Ext:
+ {
+ Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_InputJack,
+
+ JackType: JACKTYPE_EXTERNAL,
+ JackID: 0x02,
+
+ JackStrIndex: NO_DESCRIPTOR
+ },
+
+ MIDI_Out_Jack_Emb:
+ {
+ Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_OutputJack,
+
+ JackType: JACKTYPE_EMBEDDED,
+ JackID: 0x03,
+
+ NumberOfPins: 1,
+ SourceJackID: {0x02},
+ SourcePinID: {0x01},
+
+ JackStrIndex: NO_DESCRIPTOR
+ },
+
+ MIDI_Out_Jack_Ext:
+ {
+ Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
+ Subtype: DSUBTYPE_OutputJack,
+
+ JackType: JACKTYPE_EXTERNAL,
+ JackID: 0x04,
+
+ NumberOfPins: 1,
+ SourceJackID: {0x01},
+ SourcePinID: {0x01},
+
+ JackStrIndex: NO_DESCRIPTOR
+ },
+
+ MIDI_In_Jack_Endpoint:
+ {
+ Endpoint:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
+ Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ EndpointSize: MIDI_STREAM_EPSIZE,
+ PollingIntervalMS: 0
+ },
+
+ Refresh: 0,
+ SyncEndpointNumber: 0
+ },
+
+ MIDI_In_Jack_Endpoint_SPC:
+ {
+ Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
+ Subtype: DSUBTYPE_General,
+
+ TotalEmbeddedJacks: 0x01,
+ AssociatedJackID: {0x01}
+ },
+
+ MIDI_Out_Jack_Endpoint:
+ {
+ Endpoint:
+ {
+ Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
+ Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ EndpointSize: MIDI_STREAM_EPSIZE,
+ PollingIntervalMS: 0
+ },
+
+ Refresh: 0,
+ SyncEndpointNumber: 0
+ },
+
+ MIDI_Out_Jack_Endpoint_SPC:
+ {
+ Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
+ Subtype: DSUBTYPE_General,
+
+ TotalEmbeddedJacks: 0x01,
+ AssociatedJackID: {0x03}
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(14), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA MIDI Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.h
new file mode 100644
index 00000000..f80e58b2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/Descriptors.h
@@ -0,0 +1,189 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Descriptor header constant to indicate a Audio class interface descriptor. */
+ #define DTYPE_AudioInterface 0x24
+
+ /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
+ #define DTYPE_AudioEndpoint 0x25
+
+ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
+ #define DSUBTYPE_Header 0x01
+
+ /** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
+ #define DSUBTYPE_InputJack 0x02
+
+ /** Audio class descriptor subtype value for a Audio class specific MIDI output jack descriptor. */
+ #define DSUBTYPE_OutputJack 0x03
+
+ /** Audio class descriptor subtype value for a general Audio class specific descriptor. */
+ #define DSUBTYPE_General 0x01
+
+ /** Audio class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
+ #define JACKTYPE_EMBEDDED 0x01
+
+ /** Audio class descriptor jack type value for an external (physical) MIDI input or output jack. */
+ #define JACKTYPE_EXTERNAL 0x02
+
+ /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
+ #define MIDI_STREAM_OUT_EPNUM 1
+
+ /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
+ #define MIDI_STREAM_IN_EPNUM 2
+
+ /** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
+ #define MIDI_STREAM_EPSIZE 64
+
+ /* Type Defines: */
+ /** Type define for an Audio class specific interface descriptor. This follows a regular interface descriptor to
+ * supply extra information about the audio device's layout to the host. See the USB Audio specification for more
+ * details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint16_t ACSpecification; /** Binary coded decimal value, indicating the supported Audio Class specification version */
+ uint16_t TotalLength; /** Total length of the Audio class specific control descriptors, including this descriptor */
+
+ uint8_t InCollection; /** Total number of audio class interfaces within this device */
+ uint8_t InterfaceNumbers[1]; /** Interface numbers of each audio interface */
+ } USB_AudioInterface_AC_t;
+
+ /** Type define for an Audio class specific MIDI streaming interface descriptor. This indicates to the host
+ * how MIDI the specification compliance of the device and the total length of the Audio class specific descriptors.
+ * See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
+ uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
+ } USB_AudioInterface_MIDI_AS_t;
+
+ /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
+ * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint */
+
+ uint8_t Refresh; /**< Always set to zero */
+ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
+ } USB_AudioStreamEndpoint_Std_t;
+
+ /** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either
+ * a physical input jack, or a logical jack (recieving input data internally, or from the host via an endpoint).
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values */
+ uint8_t JackID; /**< ID value of this jack - must be a unique value within the device */
+
+ uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_MIDI_In_Jack_t;
+
+ /** Type define for an Audio class specific MIDI OUT jack. This gives information to the host on a MIDI output, either
+ * a physical output jack, or a logical jack (sending output data internally, or to the host via an endpoint).
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values */
+ uint8_t JackID; /**< ID value of this jack - must be a unique value within the device */
+
+ uint8_t NumberOfPins; /**< Number of output channels within the jack, either physical or logical */
+ uint8_t SourceJackID[1]; /**< ID of each output pin's source data jack */
+ uint8_t SourcePinID[1]; /**< Pin number in the input jack of each output pin's source data */
+
+ uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
+ } USB_MIDI_Out_Jack_t;
+
+ /** Type define for an Audio class specific extended MIDI jack endpoint descriptor. This contains extra information
+ * on the usage of MIDI endpoints used to stream MIDI events in and out of the USB Audio device, and follows an Audio
+ * class specific extended MIDI endpoint descriptor. See the USB Audio specification for more details.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+ uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
+
+ uint8_t TotalEmbeddedJacks; /**< Total number of jacks inside this endpoint */
+ uint8_t AssociatedJackID[1]; /**< IDs of each jack inside the endpoint */
+ } USB_MIDI_Jack_Endpoint_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t AudioControlInterface;
+ USB_AudioInterface_AC_t AudioControlInterface_SPC;
+ USB_Descriptor_Interface_t AudioStreamInterface;
+ USB_AudioInterface_MIDI_AS_t AudioStreamInterface_SPC;
+ USB_MIDI_In_Jack_t MIDI_In_Jack_Emb;
+ USB_MIDI_In_Jack_t MIDI_In_Jack_Ext;
+ USB_MIDI_Out_Jack_t MIDI_Out_Jack_Emb;
+ USB_MIDI_Out_Jack_t MIDI_Out_Jack_Ext;
+ USB_AudioStreamEndpoint_Std_t MIDI_In_Jack_Endpoint;
+ USB_MIDI_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC;
+ USB_AudioStreamEndpoint_Std_t MIDI_Out_Jack_Endpoint;
+ USB_MIDI_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MIDI/Doxygen.conf
new file mode 100644
index 00000000..7d36de8e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - MIDI Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.aps b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.aps
new file mode 100644
index 00000000..e61e7701
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MIDI</ProjectName><Created>30-Sep-2008 14:13:12</Created><LastEdit>30-Sep-2008 14:13:33</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:13:12</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MIDI\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>MIDI.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>MIDI.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MIDI.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.c b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.c
new file mode 100644
index 00000000..a9c827a0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.c
@@ -0,0 +1,225 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MIDI input demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "MIDI.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MIDI App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_MIDI_Task , TaskStatus: TASK_STOP },
+};
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running audio and USB management tasks */
+ Scheduler_SetTaskMode(USB_MIDI_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup MIDI stream endpoints */
+ Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, MIDI_STREAM_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, MIDI_STREAM_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start MIDI task */
+ Scheduler_SetTaskMode(USB_MIDI_Task, TASK_RUN);
+}
+
+/** Task to handle the generation of MIDI note change events in response to presses of the board joystick, and send them
+ * to the host.
+ */
+TASK(USB_MIDI_Task)
+{
+ static uint8_t PrevJoystickStatus;
+
+ /* Select the MIDI IN stream */
+ Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);
+
+ /* Check if endpoint is ready to be written to */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Get current joystick mask, XOR with previous to detect joystick changes */
+ uint8_t JoystickStatus = Joystick_GetStatus();
+ uint8_t JoystickChanges = (JoystickStatus ^ PrevJoystickStatus);
+
+ /* Get HWB status - if set use channel 10 (percussion), otherwise use channel 1 */
+ uint8_t Channel = ((HWB_GetStatus()) ? MIDI_CHANNEL(10) : MIDI_CHANNEL(1));
+
+ if (JoystickChanges & JOY_LEFT)
+ SendMIDINoteChange(0x3C, (JoystickStatus & JOY_LEFT), 0, Channel);
+
+ if (JoystickChanges & JOY_UP)
+ SendMIDINoteChange(0x3D, (JoystickStatus & JOY_UP), 0, Channel);
+
+ if (JoystickChanges & JOY_RIGHT)
+ SendMIDINoteChange(0x3E, (JoystickStatus & JOY_RIGHT), 0, Channel);
+
+ if (JoystickChanges & JOY_DOWN)
+ SendMIDINoteChange(0x3F, (JoystickStatus & JOY_DOWN), 0, Channel);
+
+ if (JoystickChanges & JOY_PRESS)
+ SendMIDINoteChange(0x3B, (JoystickStatus & JOY_PRESS), 0, Channel);
+
+ /* Save previous joystick value for next joystick change detection */
+ PrevJoystickStatus = JoystickStatus;
+ }
+
+ /* Select the MIDI OUT stream */
+ Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPNUM);
+
+ /* Check if endpoint is ready to be read from, if so discard its (unused) data */
+ if (Endpoint_ReadWriteAllowed())
+ Endpoint_ClearCurrentBank();
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MIDI_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Sends a MIDI note change event (note on or off) to the MIDI output jack, on the given virtual cable ID and channel.
+ *
+ * \param Pitch Pitch of the note to turn on or off
+ * \param OnOff Set to true if the note is on (being held down), or false otherwise
+ * \param CableID ID of the virtual cable to send the note change to
+ * \param Channel MIDI channel number to send the note change event to
+ */
+void SendMIDINoteChange(const uint8_t Pitch, const bool OnOff, const uint8_t CableID, const uint8_t Channel)
+{
+ /* Wait until endpoint ready for more data */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Check if the message should be a Note On or Note Off command */
+ uint8_t Command = ((OnOff)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF);
+
+ /* Write the Packet Header to the endpoint */
+ Endpoint_Write_Byte((CableID << 4) | (Command >> 4));
+
+ /* Write the Note On/Off command with the specified channel, pitch and velocity */
+ Endpoint_Write_Byte(Command | Channel);
+ Endpoint_Write_Byte(Pitch);
+ Endpoint_Write_Byte(MIDI_STANDARD_VELOCITY);
+
+ /* Send the data in the endpoint to the host */
+ Endpoint_ClearCurrentBank();
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.h b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.h
new file mode 100644
index 00000000..1775c637
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for AudioOutput.c.
+ */
+
+#ifndef _AUDIO_OUTPUT_H_
+#define _AUDIO_OUTPUT_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <stdbool.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** MIDI command for a note on (activation) event */
+ #define MIDI_COMMAND_NOTE_ON 0x90
+
+ /** MIDI command for a note off (deactivation) event */
+ #define MIDI_COMMAND_NOTE_OFF 0x80
+
+ /** Standard key press velocity value used for all note events, as no pressure sensor is mounted */
+ #define MIDI_STANDARD_VELOCITY 64
+
+ /** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel
+ * addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address.
+ *
+ * \param channel MIDI channel number to address
+ */
+ #define MIDI_CHANNEL(channel) (channel - 1)
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MIDI_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_MIDI_Task);
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /* Function Prototypes: */
+ void SendMIDINoteChange(const uint8_t Pitch, const bool OnOff,
+ const uint8_t CableID, const uint8_t Channel);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.txt b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.txt
new file mode 100644
index 00000000..0b34ccb6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/MIDI.txt
@@ -0,0 +1,48 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage MIDI Input Device Demo
+ *
+ * MIDI demonstration application. This gives a simple reference
+ * application for implementing the USB-MIDI class in USB devices.
+ * It is built upon the USB Audio class.
+ *
+ * Joystick movements are translated into note on/off messages and
+ * are sent to the host PC as MIDI streams which can be read by any
+ * MIDI program supporting MIDI IN devices.
+ *
+ * If the HWB is not pressed, channel 1 (default piano) is used. If
+ * the HWB is set, then channel 10 (default percussion) is selected.
+ *
+ * This device implements MIDI-THRU mode, with the IN MIDI data being
+ * generated by the device itself. OUT MIDI data is discarded.
+ *
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Audio Class</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Standard Audio Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Audio Class Specification</td>
+ * <td>USB-MIDI Audio Class Extention Specification</td>
+ * <td>General MIDI Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MIDI/makefile b/digital/avr/modules/usb/lufa/Demos/MIDI/makefile
new file mode 100644
index 00000000..40e19519
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MIDI/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MIDI
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.c b/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.c
new file mode 100644
index 00000000..ba09a595
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.c
@@ -0,0 +1,316 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Functions to manage the physical dataflash media, including reading and writing of
+ * blocks of data. These functions are called by the SCSI layer when data must be stored
+ * or retrieved to/from the physical storage media. If a different media is used (such
+ * as a SD card or EEPROM), functions similar to these will need to be generated.
+ */
+
+#define INCLUDE_FROM_DATAFLASHMANAGER_C
+#include "DataflashManager.h"
+
+/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board dataflash IC(s), from
+ * the pre-selected data OUT endpoint. This routine reads in OS sized blocks from the endpoint and writes
+ * them to the dataflash in Dataflash page sized blocks.
+ *
+ * \param BlockAddress Data block starting address for the write sequence
+ * \param TotalBlocks Number of blocks of data to write
+ */
+void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
+{
+ uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
+ uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
+ uint8_t CurrDFPageByteDiv16 = (CurrDFPageByte >> 4);
+
+ /* Select the dataflash IC based on the page number */
+ Dataflash_SelectChipFromPage(CurrDFPage);
+ Dataflash_WaitWhileBusy();
+
+ /* Copy selected dataflash's current page contents to the dataflash buffer */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_MAINMEMTOBUFF1);
+ Dataflash_SendAddressBytes(CurrDFPage, 0);
+ Dataflash_WaitWhileBusy();
+
+ /* Send the dataflash buffer write command */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_BUFF1WRITE);
+ Dataflash_SendAddressBytes(0, CurrDFPageByte);
+
+ /* Ensure endpoint is ready before continuing */
+ Endpoint_WaitUntilReady();
+
+ while (TotalBlocks)
+ {
+ uint8_t BytesInBlockDiv16 = 0;
+
+ /* Write an endpoint packet sized data block to the dataflash */
+ while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
+ {
+ /* Check if the endpoint is currently empty */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ /* Clear the current endpoint bank */
+ Endpoint_ClearCurrentBank();
+
+ /* Wait until the host has sent another packet */
+ Endpoint_WaitUntilReady();
+ }
+
+ /* Check if end of dataflash page reached */
+ if (CurrDFPageByteDiv16 == (DATAFLASH_PAGE_SIZE >> 4))
+ {
+ /* Write the dataflash buffer contents back to the dataflash page */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_BUFF1TOMAINMEMWITHERASE);
+ Dataflash_SendAddressBytes(CurrDFPage, 0);
+
+ /* Reset the dataflash buffer counter, increment the page counter */
+ CurrDFPageByteDiv16 = 0;
+ CurrDFPage++;
+
+ /* Select the next dataflash chip based on the new dataflash page index */
+ Dataflash_SelectChipFromPage(CurrDFPage);
+ Dataflash_WaitWhileBusy();
+
+#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
+ /* If less than one dataflash page remaining, copy over the existing page to preserve trailing data */
+ if ((TotalBlocks * (VIRTUAL_MEMORY_BLOCK_SIZE >> 4)) < (DATAFLASH_PAGE_SIZE >> 4))
+ {
+ /* Copy selected dataflash's current page contents to the dataflash buffer */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_MAINMEMTOBUFF1);
+ Dataflash_SendAddressBytes(CurrDFPage, 0);
+ Dataflash_WaitWhileBusy();
+ }
+#endif
+
+ /* Send the dataflash buffer write command */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_BUFF1WRITE);
+ Dataflash_SendAddressBytes(0, 0);
+ }
+
+ /* Write one 16-byte chunk of data to the dataflash */
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+ Dataflash_SendByte(Endpoint_Read_Byte());
+
+ /* Increment the dataflash page 16 byte block counter */
+ CurrDFPageByteDiv16++;
+
+ /* Increment the block 16 byte block counter */
+ BytesInBlockDiv16++;
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return;
+ }
+
+ /* Decrement the blocks remaining counter and reset the sub block counter */
+ TotalBlocks--;
+ }
+
+ /* Write the dataflash buffer contents back to the dataflash page */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_BUFF1TOMAINMEMWITHERASE);
+ Dataflash_SendAddressBytes(CurrDFPage, 0x00);
+ Dataflash_WaitWhileBusy();
+
+ /* If the endpoint is empty, clear it ready for the next packet from the host */
+ if (!(Endpoint_ReadWriteAllowed()))
+ Endpoint_ClearCurrentBank();
+
+ /* Deselect all dataflash chips */
+ Dataflash_DeselectChip();
+}
+
+/** Reads blocks (OS blocks, not Dataflash pages) from the storage medium, the board dataflash IC(s), into
+ * the pre-selected data IN endpoint. This routine reads in Dataflash page sized blocks from the Dataflash
+ * and writes them in OS sized blocks to the endpoint.
+ *
+ * \param BlockAddress Data block starting address for the read sequence
+ * \param TotalBlocks Number of blocks of data to read
+ */
+void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
+{
+ uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
+ uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
+ uint8_t CurrDFPageByteDiv16 = (CurrDFPageByte >> 4);
+
+ /* Select the dataflash IC based on the page number */
+ Dataflash_SelectChipFromPage(CurrDFPage);
+ Dataflash_WaitWhileBusy();
+
+ /* Send the dataflash main memory page read command */
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_MAINMEMPAGEREAD);
+ Dataflash_SendAddressBytes(CurrDFPage, CurrDFPageByte);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+
+ /* Ensure endpoint is ready before continuing */
+ Endpoint_WaitUntilReady();
+
+ while (TotalBlocks)
+ {
+ uint8_t BytesInBlockDiv16 = 0;
+
+ /* Write an endpoint packet sized data block to the dataflash */
+ while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
+ {
+ /* Check if the endpoint is currently full */
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ /* Clear the endpoint bank to send its contents to the host */
+ Endpoint_ClearCurrentBank();
+
+ /* Wait until the endpoint is ready for more data */
+ Endpoint_WaitUntilReady();
+ }
+
+ /* Check if end of dataflash page reached */
+ if (CurrDFPageByteDiv16 == (DATAFLASH_PAGE_SIZE >> 4))
+ {
+ /* Reset the dataflash buffer counter, increment the page counter */
+ CurrDFPageByteDiv16 = 0;
+ CurrDFPage++;
+
+ /* Select the next dataflash chip based on the new dataflash page index */
+ Dataflash_SelectChipFromPage(CurrDFPage);
+
+ /* Send the dataflash main memory page read command */
+ Dataflash_SendByte(DF_CMD_MAINMEMPAGEREAD);
+ Dataflash_SendAddressBytes(CurrDFPage, 0);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+ Dataflash_SendByte(0x00);
+ }
+
+ /* Read one 16-byte chunk of data from the dataflash */
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+ Endpoint_Write_Byte(Dataflash_ReceiveByte());
+
+ /* Increment the dataflash page 16 byte block counter */
+ CurrDFPageByteDiv16++;
+
+ /* Increment the block 16 byte block counter */
+ BytesInBlockDiv16++;
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return;
+ }
+
+ /* Decrement the blocks remaining counter */
+ TotalBlocks--;
+ }
+
+ /* If the endpoint is full, send its contents to the host */
+ if (!(Endpoint_ReadWriteAllowed()))
+ Endpoint_ClearCurrentBank();
+
+ /* Deselect all dataflash chips */
+ Dataflash_DeselectChip();
+}
+
+/** Disables the dataflash memory write protection bits on the board Dataflash ICs, if enabled. */
+void DataflashManager_ResetDataflashProtections(void)
+{
+ /* Select first dataflash chip, send the read status register command */
+ Dataflash_SelectChip(DATAFLASH_CHIP1);
+ Dataflash_SendByte(DF_CMD_GETSTATUS);
+
+ /* Check if sector protection is enabled */
+ if (Dataflash_ReceiveByte() & DF_STATUS_SECTORPROTECTION_ON)
+ {
+ Dataflash_ToggleSelectedChipCS();
+
+ /* Send the commands to disable sector protection */
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[0]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[1]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[2]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[3]);
+ }
+
+ /* Select second dataflash chip (if present on selected board), send read status register command */
+ #if (DATAFLASH_TOTALCHIPS == 2)
+ Dataflash_SelectChip(DATAFLASH_CHIP2);
+ Dataflash_SendByte(DF_CMD_GETSTATUS);
+
+ /* Check if sector protection is enabled */
+ if (Dataflash_ReceiveByte() & DF_STATUS_SECTORPROTECTION_ON)
+ {
+ Dataflash_ToggleSelectedChipCS();
+
+ /* Send the commands to disable sector protection */
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[0]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[1]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[2]);
+ Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[3]);
+ }
+ #endif
+
+ /* Deselect current dataflash chip */
+ Dataflash_DeselectChip();
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.h b/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.h
new file mode 100644
index 00000000..a0c43c39
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/DataflashManager.h
@@ -0,0 +1,71 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for DataflashManager.c.
+ */
+
+#ifndef _DATAFLASH_MANAGER_H
+#define _DATAFLASH_MANAGER_H
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "MassStorage.h"
+ #include "Descriptors.h"
+
+ #include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
+
+ /* Preprocessor Checks: */
+ #if (DATAFLASH_PAGE_SIZE % 16)
+ #error Dataflash page size must be a multiple of 16 bytes.
+ #endif
+
+ /* Defines: */
+ /** Total number of bytes of the storage medium, comprised of one or more dataflash ICs. */
+ #define VIRTUAL_MEMORY_BYTES ((uint32_t)DATAFLASH_PAGES * DATAFLASH_PAGE_SIZE * DATAFLASH_TOTALCHIPS)
+
+ /** Block size of the device. This is kept at 512 to remain compatible with the OS despite the underlying
+ * storage media (Dataflash) using a different native block size.
+ */
+ #define VIRTUAL_MEMORY_BLOCK_SIZE 512
+
+ /** Total number of blocks of the virtual memory for reporting to the host as the device's total capacity. */
+ #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
+
+ /* Function Prototypes: */
+ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks);
+ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks);
+ void DataflashManager_ResetDataflashProtections(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.c
new file mode 100644
index 00000000..a6173156
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.c
@@ -0,0 +1,223 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2045,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: 0x03,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: USB_CONFIG_ATTR_BUSPOWERED,
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x08,
+ SubClass: 0x06,
+ Protocol: 0x50,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: MASS_STORAGE_IO_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: MASS_STORAGE_IO_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(22), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Mass Storage Demo"
+};
+
+/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12
+ * digits in length to uniquely identify a device when concatenated with the device's Vendor and Product IDs. By
+ * using the unique serial number string to identify a device, the device drivers do not need to be reinstalled
+ * each time the device is inserted into a different USB port on the same system. <b>This should be unique between
+ * devices, or conflicts will occur if two devices sharing the same serial number are inserted into the same system
+ * at the same time.</b>
+ */
+USB_Descriptor_String_t PROGMEM SerialNumberString =
+{
+ Header: {Size: USB_STRING_LEN(12), Type: DTYPE_String},
+
+ UnicodeString: L"000000000000"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ case 0x03:
+ Address = DESCRIPTOR_ADDRESS(SerialNumberString);
+ Size = pgm_read_byte(&SerialNumberString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.h
new file mode 100644
index 00000000..a64d72e9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/Descriptors.h
@@ -0,0 +1,71 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPNUM 3
+
+ /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPNUM 4
+
+ /** Size in bytes of the Mass Storage data endpoints. */
+ #define MASS_STORAGE_IO_EPSIZE 64
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MassStorage/Doxygen.conf
new file mode 100644
index 00000000..a7b90016
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mass Storage Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.aps b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.aps
new file mode 100644
index 00000000..483bc4ca
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MassStorage</ProjectName><Created>30-Sep-2008 14:12:09</Created><LastEdit>30-Sep-2008 14:12:25</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:12:09</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MassStorage\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>DataflashManager.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>MassStorage.c</SOURCEFILE><SOURCEFILE>SCSI.c</SOURCEFILE><HEADERFILE>DataflashManager.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>MassStorage.h</HEADERFILE><HEADERFILE>SCSI.h</HEADERFILE><HEADERFILE>SCSI_Codes.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MassStorage.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.c b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.c
new file mode 100644
index 00000000..fb61530f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.c
@@ -0,0 +1,396 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Mass Storage demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#define INCLUDE_FROM_MASSSTORAGE_C
+#include "MassStorage.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MassStore App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_MassStorage , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Structure to hold the latest Command Block Wrapper issued by the host, containing a SCSI command to execute. */
+CommandBlockWrapper_t CommandBlock;
+
+/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */
+CommandStatusWrapper_t CommandStatus = { Signature: CSW_SIGNATURE };
+
+/** Flag to asyncronously abort any in-progress data transfers upon the reception of a mass storage reset command. */
+volatile bool IsMassStoreReset = false;
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+ Dataflash_Init(SPI_SPEED_FCPU_DIV_2);
+
+ /* Clear Dataflash sector protections, if enabled */
+ DataflashManager_ResetDataflashProtections();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the
+ * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled
+ * asynchronously when they arrive rather than when the control endpoint is polled manually.
+ */
+EVENT_HANDLER(USB_Reset)
+{
+ /* Select the control endpoint */
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+
+ /* Enable the endpoint SETUP interrupt ISR for the control endpoint */
+ USB_INT_Enable(ENDPOINT_INT_SETUP);
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Reset the MSReset flag upon connection */
+ IsMassStoreReset = false;
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the Mass Storage management task.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running mass storage task */
+ Scheduler_SetTaskMode(USB_MassStorage, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Mass Storage In and Out Endpoints */
+ Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, MASS_STORAGE_IO_EPSIZE,
+ ENDPOINT_BANK_DOUBLE);
+
+ Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, MASS_STORAGE_IO_EPSIZE,
+ ENDPOINT_BANK_DOUBLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start mass storage task */
+ Scheduler_SetTaskMode(USB_MassStorage, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the Mass Storage class-specific
+ * requests) so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Process UFI specific control requests */
+ switch (bRequest)
+ {
+ case REQ_MassStorageReset:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Indicate that the current transfer should be aborted */
+ IsMassStoreReset = true;
+
+ Endpoint_ClearSetupReceived();
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetMaxLUN:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Indicate to the host the number of supported LUNs (virtual disks) on the device */
+ Endpoint_ClearSetupReceived();
+ Endpoint_Write_Byte(TOTAL_LUNS - 1);
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MassStorage_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ case Status_CommandBlockError:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_ProcessingCommandBlock:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to manage the Mass Storage interface, reading in Command Block Wrappers from the host, processing the SCSI commands they
+ * contain, and returning Command Status Wrappers back to the host to indicate the success or failure of the last issued command.
+ */
+TASK(USB_MassStorage)
+{
+ /* Check if the USB System is connected to a Host */
+ if (USB_IsConnected)
+ {
+ /* Select the Data Out Endpoint */
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+
+ /* Check to see if a command from the host has been issued */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Indicate busy */
+ UpdateStatus(Status_ProcessingCommandBlock);
+
+ /* Process sent command block from the host */
+ if (ReadInCommandBlock())
+ {
+ /* Check direction of command, select Data IN endpoint if data is from the device */
+ if (CommandBlock.Flags & COMMAND_DIRECTION_DATA_IN)
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+
+ /* Decode the received SCSI command */
+ SCSI_DecodeSCSICommand();
+
+ /* Load in the CBW tag into the CSW to link them together */
+ CommandStatus.Tag = CommandBlock.Tag;
+
+ /* Load in the data residue counter into the CSW */
+ CommandStatus.DataTransferResidue = CommandBlock.DataTransferLength;
+
+ /* Stall the selected data pipe if command failed (if data is still to be transferred) */
+ if ((CommandStatus.Status == Command_Fail) && (CommandStatus.DataTransferResidue))
+ Endpoint_StallTransaction();
+
+ /* Return command status block to the host */
+ ReturnCommandStatus();
+
+ /* Check if a Mass Storage Reset ocurred */
+ if (IsMassStoreReset)
+ {
+ /* Reset the data endpoint banks */
+ Endpoint_ResetFIFO(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_ResetFIFO(MASS_STORAGE_IN_EPNUM);
+
+ /* Clear the abort transfer flag */
+ IsMassStoreReset = false;
+ }
+
+ /* Indicate ready */
+ UpdateStatus(Status_USBReady);
+ }
+ else
+ {
+ /* Indicate error reading in the command block from the host */
+ UpdateStatus(Status_CommandBlockError);
+ }
+ }
+ }
+}
+
+/** Function to read in a command block from the host, via the bulk data OUT endpoint. This function reads in the next command block
+ * if one has been issued, and performs validation to ensure that the block command is valid.
+ *
+ * \return Boolean true if a valid command block has been read in from the endpoint, false otherwise
+ */
+static bool ReadInCommandBlock(void)
+{
+ /* Select the Data Out endpoint */
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+
+ /* Read in command block header */
+ Endpoint_Read_Stream_LE(&CommandBlock, (sizeof(CommandBlock) - sizeof(CommandBlock.SCSICommandData)),
+ AbortOnMassStoreReset);
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return false;
+
+ /* Verify the command block - abort if invalid */
+ if ((CommandBlock.Signature != CBW_SIGNATURE) ||
+ (CommandBlock.LUN >= TOTAL_LUNS) ||
+ (CommandBlock.SCSICommandLength > MAX_SCSI_COMMAND_LENGTH))
+ {
+ /* Stall both data pipes until reset by host */
+ Endpoint_StallTransaction();
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_StallTransaction();
+
+ return false;
+ }
+
+ /* Read in command block command data */
+ Endpoint_Read_Stream_LE(&CommandBlock.SCSICommandData,
+ CommandBlock.SCSICommandLength,
+ AbortOnMassStoreReset);
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return false;
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ return true;
+}
+
+/** Returns the filled Command Status Wrapper back to the host via the bulk data IN endpoint, waiting for the host to clear any
+ * stalled data endpoints as needed.
+ */
+static void ReturnCommandStatus(void)
+{
+ /* Select the Data Out endpoint */
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+
+ /* While data pipe is stalled, wait until the host issues a control request to clear the stall */
+ while (Endpoint_IsStalled())
+ {
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return;
+ }
+
+ /* Select the Data In endpoint */
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+
+ /* While data pipe is stalled, wait until the host issues a control request to clear the stall */
+ while (Endpoint_IsStalled())
+ {
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return;
+ }
+
+ /* Write the CSW to the endpoint */
+ Endpoint_Write_Stream_LE(&CommandStatus, sizeof(CommandStatus),
+ AbortOnMassStoreReset);
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return;
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+}
+
+/** Stream callback function for the Endpoint stream read and write functions. This callback will abort the current stream transfer
+ * if a Mass Storage Reset request has been issued to the control endpoint.
+ */
+STREAM_CALLBACK(AbortOnMassStoreReset)
+{
+ /* Abort if a Mass Storage reset command was received */
+ if (IsMassStoreReset)
+ return STREAMCALLBACK_Abort;
+
+ /* Continue with the current stream operation */
+ return STREAMCALLBACK_Continue;
+}
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when a control request has been issued to the control endpoint,
+ * so that the request can be processed. As several elements of the Mass Storage implementation require asynchronous control requests
+ * (such as endpoint stall clearing and Mass Storage Reset requests during data transfers) this is done via interrupts rather than
+ * polling.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ /* Check if the control endpoint has received a request */
+ if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))
+ {
+ /* Clear the endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(ENDPOINT_CONTROLEP);
+
+ /* Process the control request */
+ USB_USBTask();
+
+ /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */
+ USB_INT_Clear(ENDPOINT_INT_SETUP);
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.h b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.h
new file mode 100644
index 00000000..4f0e5b58
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.h
@@ -0,0 +1,159 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MassStorage.c.
+ */
+
+#ifndef _MASS_STORAGE_H_
+#define _MASS_STORAGE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+
+ #include "Descriptors.h"
+ #include "SCSI.h"
+ #include "DataflashManager.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
+ #define REQ_MassStorageReset 0xFF
+
+ /** Mass Storage Class specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
+ #define REQ_GetMaxLUN 0xFE
+
+ /** Maximum length of a SCSI command which can be issued by the device or host in a Mass Storage bulk wrapper. */
+ #define MAX_SCSI_COMMAND_LENGTH 16
+
+ /** Total number of Logical Units (drives) in the device. By default, the total device capacity is shared equally between
+ * each drive - this can be set to any positive non-zero amount. */
+ #define TOTAL_LUNS 2
+
+ /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */
+ #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS)
+
+ /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
+ #define CBW_SIGNATURE 0x43425355UL
+
+ /** Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol. */
+ #define CSW_SIGNATURE 0x53425355UL
+
+ /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device. */
+ #define COMMAND_DIRECTION_DATA_OUT (0 << 7)
+
+ /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from device-to-host. */
+ #define COMMAND_DIRECTION_DATA_IN (1 << 7)
+
+ /* Type defines: */
+ /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
+ typedef struct
+ {
+ uint32_t Signature; /**< Command block signature, must be CBW_SIGNATURE to indicate a valid Command Block */
+ uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
+ uint32_t DataTransferLength; /** Length of the optional data portion of the issued command, in bytes */
+ uint8_t Flags; /**< Command block flags, indicating command data direction */
+ uint8_t LUN; /**< Logical Unit number this command is issued to */
+ uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */
+ uint8_t SCSICommandData[MAX_SCSI_COMMAND_LENGTH]; /**< Issued SCSI command in the Command Block */
+ } CommandBlockWrapper_t;
+
+ /** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
+ typedef struct
+ {
+ uint32_t Signature; /**< Status block signature, must be CSW_SIGNATURE to indicate a valid Command Status */
+ uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
+ uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command */
+ uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum */
+ } CommandStatusWrapper_t;
+
+ /* Enums: */
+ /** Enum for the possible command status wrapper return status codes. */
+ enum MassStorage_CommandStatusCodes_t
+ {
+ Command_Pass = 0, /**< Command completed with no error */
+ Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */
+ Phase_Error = 2 /**< Command failed due to being invalid in the current phase */
+ };
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MassStorage_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_CommandBlockError = 3, /**< Processing a SCSI command block from the host */
+ Status_ProcessingCommandBlock = 4, /**< Error during the processing of a SCSI command block from the host */
+ };
+
+ /* Global Variables: */
+ extern CommandBlockWrapper_t CommandBlock;
+ extern CommandStatusWrapper_t CommandStatus;
+ extern volatile bool IsMassStoreReset;
+
+ /* Task Definitions: */
+ TASK(USB_MassStorage);
+
+ /* Stream Callbacks: */
+ STREAM_CALLBACK(AbortOnMassStoreReset);
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
+ HANDLES_EVENT(USB_Reset);
+
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+ #if defined(INCLUDE_FROM_MASSSTORAGE_C)
+ static bool ReadInCommandBlock(void);
+ static void ReturnCommandStatus(void);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.txt b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.txt
new file mode 100644
index 00000000..428faa8e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/MassStorage.txt
@@ -0,0 +1,54 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mass Storage Device Demo
+ *
+ * Dual LUN Mass Storage demonstration application. This gives a simple
+ * reference application for implementing a multiple LUN USB Mass Storage
+ * device using the basic USB UFI drivers in all modern OSes (i.e. no
+ * special drivers required).
+ *
+ * On startup the system will automatically enumerate and function as an
+ * external mass storage device with two LUNs (seperate disks) which may
+ * be formatted and used in the same manner as commercial USB Mass Storage
+ * devices.
+ *
+ * You will need to format the mass storage drives upon first run of this
+ * demonstration - as the device acts only as a data block transport between
+ * the host and the storage media, it does not matter what file system is used,
+ * as the data interpretation is performed by the host and not the USB device.
+ *
+ * This demo is not restricted to only two LUNs; by changing the TOTAL_LUNS
+ * value in MassStorageDualLUN.h, any number of LUNs can be used (from 1 to
+ * 255), with each LUN being allocated an equal portion of the available
+ * Dataflash memory.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Mass Storage Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Bulk-Only Transport</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Mass Storage Standard</td>
+ * <td>USB Bulk-Only Transport Standard</td>
+ * <td>SCSI Primary Commands Specification</td>
+ * <td>SCSI Block Commands Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.c b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.c
new file mode 100644
index 00000000..d9c55269
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.c
@@ -0,0 +1,350 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * SCSI command processing routines, for SCSI commands issued by the host. Mass Storage
+ * devices use a thin "Bulk-Only Transport" protocol for issuing commands and status information,
+ * which wrap around standard SCSI device commands for controlling the actual storage medium.
+ */
+
+#define INCLUDE_FROM_SCSI_C
+#include "SCSI.h"
+
+/** Structure to hold the SCSI reponse data to a SCSI INQUIRY command. This gives information about the device's
+ * features and capabilities.
+ */
+SCSI_Inquiry_Response_t InquiryData =
+ {
+ DeviceType: 0,
+ PeripheralQualifier: 0,
+
+ Removable: true,
+
+ Version: 0,
+
+ ResponseDataFormat: 2,
+ NormACA: false,
+ TrmTsk: false,
+ AERC: false,
+
+ AdditionalLength: 0x1F,
+
+ SoftReset: false,
+ CmdQue: false,
+ Linked: false,
+ Sync: false,
+ WideBus16Bit: false,
+ WideBus32Bit: false,
+ RelAddr: false,
+
+ VendorID: "LUFA",
+ ProductID: "Dataflash Disk",
+ RevisionID: {'0','.','0','0'},
+ };
+
+/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
+ * command is issued. This gives information on exactly why the last command failed to complete.
+ */
+SCSI_Request_Sense_Response_t SenseData =
+ {
+ ResponseCode: 0x70,
+ AdditionalLength: 0x0A,
+ };
+
+
+/** Main routine to process the SCSI command located in the Command Block Wrapper read from the host. This dispatches
+ * to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns
+ * a command failure due to a ILLEGAL REQUEST.
+ */
+void SCSI_DecodeSCSICommand(void)
+{
+ bool CommandSuccess = false;
+
+ /* Run the apropriate SCSI command hander function based on the passed command */
+ switch (CommandBlock.SCSICommandData[0])
+ {
+ case SCSI_CMD_INQUIRY:
+ CommandSuccess = SCSI_Command_Inquiry();
+ break;
+ case SCSI_CMD_REQUEST_SENSE:
+ CommandSuccess = SCSI_Command_Request_Sense();
+ break;
+ case SCSI_CMD_READ_CAPACITY_10:
+ CommandSuccess = SCSI_Command_Read_Capacity_10();
+ break;
+ case SCSI_CMD_SEND_DIAGNOSTIC:
+ CommandSuccess = SCSI_Command_Send_Diagnostic();
+ break;
+ case SCSI_CMD_WRITE_10:
+ CommandSuccess = SCSI_Command_ReadWrite_10(DATA_WRITE);
+ break;
+ case SCSI_CMD_READ_10:
+ CommandSuccess = SCSI_Command_ReadWrite_10(DATA_READ);
+ break;
+ case SCSI_CMD_TEST_UNIT_READY:
+ case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
+ case SCSI_CMD_VERIFY_10:
+ /* These commands should just succeed, no handling required */
+ CommandSuccess = true;
+ CommandBlock.DataTransferLength = 0;
+ break;
+ default:
+ /* Update the SENSE key to reflect the invalid command */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,
+ SCSI_ASENSE_INVALID_COMMAND,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+ break;
+ }
+
+ /* Check if command was successfully processed */
+ if (CommandSuccess)
+ {
+ /* Command succeeded - set the CSW status and update the SENSE key */
+ CommandStatus.Status = Command_Pass;
+
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_GOOD,
+ SCSI_ASENSE_NO_ADDITIONAL_INFORMATION,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+ }
+ else
+ {
+ /* Command failed - set the CSW status - failed command function updates the SENSE key */
+ CommandStatus.Status = Command_Fail;
+ }
+}
+
+/** Command processing for an issued SCSI INQUIRY command. This command returns information about the device's features
+ * and capabilities to the host.
+ *
+ * \return Boolean true if the command completed successfully, false otherwise.
+ */
+static bool SCSI_Command_Inquiry(void)
+{
+ uint16_t AllocationLength = (((uint16_t)CommandBlock.SCSICommandData[3] << 8) |
+ CommandBlock.SCSICommandData[4]);
+ uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :
+ sizeof(InquiryData);
+
+ /* Only the standard INQUIRY data is supported, check if any optional INQUIRY bits set */
+ if ((CommandBlock.SCSICommandData[1] & ((1 << 0) | (1 << 1))) ||
+ CommandBlock.SCSICommandData[2])
+ {
+ /* Optional but unsupported bits set - update the SENSE key and fail the request */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,
+ SCSI_ASENSE_INVALID_FIELD_IN_CDB,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
+ return false;
+ }
+
+ /* Write the INQUIRY data to the endpoint */
+ Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, AbortOnMassStoreReset);
+
+ uint8_t PadBytes[AllocationLength - BytesTransferred];
+
+ /* Pad out remaining bytes with 0x00 */
+ Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), AbortOnMassStoreReset);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Succeed the command and update the bytes transferred counter */
+ CommandBlock.DataTransferLength -= BytesTransferred;
+
+ return true;
+}
+
+/** Command processing for an issued SCSI REQUEST SENSE command. This command returns information about the last issued command,
+ * including the error code and additional error information so that the host can determine why a command failed to complete.
+ *
+ * \return Boolean true if the command completed successfully, false otherwise.
+ */
+static bool SCSI_Command_Request_Sense(void)
+{
+ uint8_t AllocationLength = CommandBlock.SCSICommandData[4];
+ uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
+
+ /* Send the SENSE data - this indicates to the host the status of the last command */
+ Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, AbortOnMassStoreReset);
+
+ uint8_t PadBytes[AllocationLength - BytesTransferred];
+
+ /* Pad out remaining bytes with 0x00 */
+ Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), AbortOnMassStoreReset);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Succeed the command and update the bytes transferred counter */
+ CommandBlock.DataTransferLength -= BytesTransferred;
+
+ return true;
+}
+
+/** Command processing for an issued SCSI READ CAPACITY (10) command. This command returns information about the device's capacity
+ * on the selected Logical Unit (drive), as a number of OS-sized blocks.
+ *
+ * \return Boolean true if the command completed successfully, false otherwise.
+ */
+static bool SCSI_Command_Read_Capacity_10(void)
+{
+ /* Send the total number of logical blocks in the current LUN */
+ Endpoint_Write_DWord_BE(LUN_MEDIA_BLOCKS - 1);
+
+ /* Send the logical block size of the device (must be 512 bytes) */
+ Endpoint_Write_DWord_BE(VIRTUAL_MEMORY_BLOCK_SIZE);
+
+ /* Check if the current command is being aborted by the host */
+ if (IsMassStoreReset)
+ return false;
+
+ /* Send the endpoint data packet to the host */
+ Endpoint_ClearCurrentBank();
+
+ /* Succeed the command and update the bytes transferred counter */
+ CommandBlock.DataTransferLength -= 8;
+
+ return true;
+}
+
+/** Command processing for an issued SCSI SEND DIAGNOSTIC command. This command peforms a quick check of the Dataflash ICs on the
+ * board, and indicates if they are present and functioning correctly. Only the Self-Test portion of the diagnostic command is
+ * supported.
+ *
+ * \return Boolean true if the command completed successfully, false otherwise.
+ */
+static bool SCSI_Command_Send_Diagnostic(void)
+{
+ uint8_t ReturnByte;
+
+ /* Check to see if the SELF TEST bit is not set */
+ if (!(CommandBlock.SCSICommandData[1] & (1 << 2)))
+ {
+ /* Only self-test supported - update SENSE key and fail the command */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,
+ SCSI_ASENSE_INVALID_FIELD_IN_CDB,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
+ return false;
+ }
+
+ /* Test first Dataflash IC is present and responding to commands */
+ Dataflash_SelectChip(DATAFLASH_CHIP1);
+ Dataflash_SendByte(DF_CMD_READMANUFACTURERDEVICEINFO);
+ ReturnByte = Dataflash_ReceiveByte();
+ Dataflash_DeselectChip();
+
+ /* If returned data is invalid, fail the command */
+ if (ReturnByte != DF_MANUFACTURER_ATMEL)
+ {
+ /* Update SENSE key with a hardware error condition and return command fail */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_HARDWARE_ERROR,
+ SCSI_ASENSE_NO_ADDITIONAL_INFORMATION,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
+ return false;
+ }
+
+ #if (DATAFLASH_TOTALCHIPS == 2)
+ /* Test second Dataflash IC is present and responding to commands */
+ Dataflash_SelectChip(DATAFLASH_CHIP2);
+ Dataflash_SendByte(DF_CMD_READMANUFACTURERDEVICEINFO);
+ ReturnByte = Dataflash_ReceiveByte();
+ Dataflash_DeselectChip();
+
+ /* If returned data is invalid, fail the command */
+ if (ReturnByte != DF_MANUFACTURER_ATMEL)
+ {
+ /* Update SENSE key with a hardware error condition and return command fail */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_HARDWARE_ERROR,
+ SCSI_ASENSE_NO_ADDITIONAL_INFORMATION,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
+ return false;
+ }
+ #endif
+
+ /* Succeed the command and update the bytes transferred counter */
+ CommandBlock.DataTransferLength = 0;
+
+ return true;
+}
+
+/** Command processing for an issued SCSI READ (10) or WRITE (10) command. This command reads in the block start address
+ * and total number of blocks to process, then calls the appropriate low-level dataflash routine to handle the actual
+ * reading and writing of the data.
+ *
+ * \param IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
+ *
+ * \return Boolean true if the command completed successfully, false otherwise.
+ */
+static bool SCSI_Command_ReadWrite_10(const bool IsDataRead)
+{
+ uint32_t BlockAddress;
+ uint16_t TotalBlocks;
+
+ /* Load in the 32-bit block address (SCSI uses big-endian, so have to do it byte-by-byte) */
+ ((uint8_t*)&BlockAddress)[3] = CommandBlock.SCSICommandData[2];
+ ((uint8_t*)&BlockAddress)[2] = CommandBlock.SCSICommandData[3];
+ ((uint8_t*)&BlockAddress)[1] = CommandBlock.SCSICommandData[4];
+ ((uint8_t*)&BlockAddress)[0] = CommandBlock.SCSICommandData[5];
+
+ /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to do it byte-by-byte) */
+ ((uint8_t*)&TotalBlocks)[1] = CommandBlock.SCSICommandData[7];
+ ((uint8_t*)&TotalBlocks)[0] = CommandBlock.SCSICommandData[8];
+
+ /* Check if the block address is outside the maximum allowable value for the LUN */
+ if (BlockAddress >= LUN_MEDIA_BLOCKS)
+ {
+ /* Block address is invalid, update SENSE key and return command fail */
+ SCSI_SET_SENSE(SCSI_SENSE_KEY_ILLEGAL_REQUEST,
+ SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
+ return false;
+ }
+
+ #if (TOTAL_LUNS > 1)
+ /* Adjust the given block address to the real media address based on the selected LUN */
+ BlockAddress += ((uint32_t)CommandBlock.LUN * LUN_MEDIA_BLOCKS);
+ #endif
+
+ /* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */
+ if (IsDataRead == DATA_READ)
+ DataflashManager_ReadBlocks(BlockAddress, TotalBlocks);
+ else
+ DataflashManager_WriteBlocks(BlockAddress, TotalBlocks);
+
+ /* Update the bytes transferred counter and succeed the command */
+ CommandBlock.DataTransferLength -= ((uint32_t)TotalBlocks * VIRTUAL_MEMORY_BLOCK_SIZE);
+
+ return true;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.h b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.h
new file mode 100644
index 00000000..a0be3900
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI.h
@@ -0,0 +1,143 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for SCSI.c.
+ */
+
+#ifndef _SCSI_H_
+#define _SCSI_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+
+ #include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+
+ #include "MassStorage.h"
+ #include "Descriptors.h"
+ #include "DataflashManager.h"
+ #include "SCSI_Codes.h"
+
+ /* Macros: */
+ /** Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This
+ * is for convenience, as it allows for all three sense values (returned upon request to the host to give information about
+ * the last command failure) in a quick and easy manner.
+ *
+ * \param key New SCSI sense key to set the sense code to
+ * \param acode New SCSI additional sense key to set the additional sense code to
+ * \param aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to
+ */
+ #define SCSI_SET_SENSE(key, acode, aqual) MACROS{ SenseData.SenseKey = key; \
+ SenseData.AdditionalSenseCode = acode; \
+ SenseData.AdditionalSenseQualifier = aqual; }MACROE
+
+ /** Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */
+ #define DATA_READ true
+
+ /** Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be written to the storage medium. */
+ #define DATA_WRITE false
+
+ /* Type Defines: */
+ /** Type define for a SCSI response structure to a SCSI INQUIRY command. For details of the
+ * structure contents, refer to the SCSI specifications.
+ */
+ typedef struct
+ {
+ unsigned int DeviceType : 5;
+ unsigned int PeripheralQualifier : 3;
+
+ unsigned int _RESERVED1 : 7;
+ unsigned int Removable : 1;
+
+ uint8_t Version;
+
+ unsigned int ResponseDataFormat : 4;
+ unsigned int _RESERVED2 : 1;
+ unsigned int NormACA : 1;
+ unsigned int TrmTsk : 1;
+ unsigned int AERC : 1;
+
+ uint8_t AdditionalLength;
+ uint8_t _RESERVED3[2];
+
+ unsigned int SoftReset : 1;
+ unsigned int CmdQue : 1;
+ unsigned int _RESERVED4 : 1;
+ unsigned int Linked : 1;
+ unsigned int Sync : 1;
+ unsigned int WideBus16Bit : 1;
+ unsigned int WideBus32Bit : 1;
+ unsigned int RelAddr : 1;
+
+ uint8_t VendorID[8];
+ uint8_t ProductID[16];
+ uint8_t RevisionID[4];
+ } SCSI_Inquiry_Response_t;
+
+ /** Type define for a SCSI sense structure to a SCSI REQUEST SENSE command. For details of the
+ * structure contents, refer to the SCSI specifications.
+ */
+ typedef struct
+ {
+ uint8_t ResponseCode;
+
+ uint8_t SegmentNumber;
+
+ unsigned int SenseKey : 4;
+ unsigned int _RESERVED1 : 1;
+ unsigned int ILI : 1;
+ unsigned int EOM : 1;
+ unsigned int FileMark : 1;
+
+ uint8_t Information[4];
+ uint8_t AdditionalLength;
+ uint8_t CmdSpecificInformation[4];
+ uint8_t AdditionalSenseCode;
+ uint8_t AdditionalSenseQualifier;
+ uint8_t FieldReplaceableUnitCode;
+ uint8_t SenseKeySpecific[3];
+ } SCSI_Request_Sense_Response_t;
+
+ /* Function Prototypes: */
+ void SCSI_DecodeSCSICommand(void);
+
+ #if defined(INCLUDE_FROM_SCSI_C)
+ static bool SCSI_Command_Inquiry(void);
+ static bool SCSI_Command_Request_Sense(void);
+ static bool SCSI_Command_Read_Capacity_10(void);
+ static bool SCSI_Command_Send_Diagnostic(void);
+ static bool SCSI_Command_ReadWrite_10(const bool IsDataRead);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI_Codes.h b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI_Codes.h
new file mode 100644
index 00000000..2b2213de
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/SCSI_Codes.h
@@ -0,0 +1,85 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header containing macros for possible SCSI commands and SENSE data. Refer to
+ * the SCSI standard documentation for more information on each SCSI command and
+ * the SENSE data.
+ */
+
+#ifndef _SCSI_CODES_H_
+#define _SCSI_CODES_H_
+
+ /* Macros: */
+ #define SCSI_CMD_INQUIRY 0x12
+ #define SCSI_CMD_REQUEST_SENSE 0x03
+ #define SCSI_CMD_TEST_UNIT_READY 0x00
+ #define SCSI_CMD_READ_CAPACITY_10 0x25
+ #define SCSI_CMD_SEND_DIAGNOSTIC 0x1D
+ #define SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
+ #define SCSI_CMD_WRITE_10 0x2A
+ #define SCSI_CMD_READ_10 0x28
+ #define SCSI_CMD_WRITE_6 0x0A
+ #define SCSI_CMD_READ_6 0x08
+ #define SCSI_CMD_VERIFY_10 0x2F
+ #define SCSI_CMD_MODE_SENSE_6 0x1A
+ #define SCSI_CMD_MODE_SENSE_10 0x5A
+
+ #define SCSI_SENSE_KEY_GOOD 0x00
+ #define SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
+ #define SCSI_SENSE_KEY_NOT_READY 0x02
+ #define SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
+ #define SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
+ #define SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
+ #define SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
+ #define SCSI_SENSE_KEY_DATA_PROTECT 0x07
+ #define SCSI_SENSE_KEY_BLANK_CHECK 0x08
+ #define SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
+ #define SCSI_SENSE_KEY_COPY_ABORTED 0x0A
+ #define SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
+ #define SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
+ #define SCSI_SENSE_KEY_MISCOMPARE 0x0E
+
+ #define SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
+ #define SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
+ #define SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
+ #define SCSI_ASENSE_WRITE_PROTECTED 0x27
+ #define SCSI_ASENSE_FORMAT_ERROR 0x31
+ #define SCSI_ASENSE_INVALID_COMMAND 0x20
+ #define SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
+ #define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
+
+ #define SCSI_ASENSEQ_NO_QUALIFIER 0x00
+ #define SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
+ #define SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
+ #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorage/makefile b/digital/avr/modules/usb/lufa/Demos/MassStorage/makefile
new file mode 100644
index 00000000..6c8bf352
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorage/makefile
@@ -0,0 +1,704 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MassStorage
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ SCSI.c \
+ DataflashManager.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.c
new file mode 100644
index 00000000..53e44875
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.c
@@ -0,0 +1,173 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a MSD interface descriptor containing bulk IN and OUT data endpoints.
+ *
+ * \return An error code from the MassStorageHost_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+ uint8_t ErrorCode;
+ uint8_t FoundEndpoints = 0;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the mass storage interface from the configuration descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextMassStorageInterface)))
+ {
+ /* Descriptor not found, error out */
+ return NoInterfaceFound;
+ }
+
+ /* Get the IN and OUT data endpoints for the mass storage interface */
+ while (FoundEndpoints != ((1 << MASS_STORE_DATA_IN_PIPE) | (1 << MASS_STORE_DATA_OUT_PIPE)))
+ {
+ /* Fetch the next bulk endpoint from the current mass storage interface */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceBulkDataEndpoint)))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Check if the endpoint is a bulk IN or bulk OUT endpoint, set appropriate globals */
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Configure the data IN pipe */
+ Pipe_ConfigurePipe(MASS_STORE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+
+ Pipe_SetInfiniteINRequests();
+
+ /* Set the flag indicating that the data IN pipe has been found */
+ FoundEndpoints |= (1 << MASS_STORE_DATA_IN_PIPE);
+ }
+ else
+ {
+ /* Configure the data OUT pipe */
+ Pipe_ConfigurePipe(MASS_STORE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+
+ /* Set the flag indicating that the data OUT pipe has been found */
+ FoundEndpoints |= (1 << MASS_STORE_DATA_OUT_PIPE);
+ }
+ }
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Mass Storage Class, Subclass and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextMassStorageInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MASS_STORE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == MASS_STORE_SUBCLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MASS_STORE_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Bulk Endpoint descriptor of the correct MSD interface, aborting the search if
+ * another interface descriptor is found before the next endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,
+ USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);
+
+ /* Check the endpoint type, break out if correct BULK type endpoint found */
+ if (EndpointType == EP_TYPE_BULK)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.h
new file mode 100644
index 00000000..908cc2ba
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/ConfigDescriptor.h
@@ -0,0 +1,77 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "MassStorageHost.h"
+
+ /* Macros: */
+ /** Interface Class value for the Mass Storage Device class */
+ #define MASS_STORE_CLASS 0x08
+
+ /** Interface Class value for the Mass Storage Device subclass */
+ #define MASS_STORE_SUBCLASS 0x06
+
+ /** Interface Protocol value for the Bulk Only transport protocol */
+ #define MASS_STORE_PROTOCOL 0x50
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum MassStorageHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoInterfaceFound = 4, /**< A compatible MSD interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< The correct MSD endpoint descriptors were not found in the device's MSD interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextMassStorageInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/Doxygen.conf
new file mode 100644
index 00000000..b154575b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mass Storage Host Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.aps b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.aps
new file mode 100644
index 00000000..9481b344
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MassStorageHost</ProjectName><Created>30-Sep-2008 14:12:43</Created><LastEdit>26-Jan-2009 16:08:24</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:12:43</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>MassStorageHost.c</SOURCEFILE><SOURCEFILE>MassStoreCommands.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>MassStorageHost.h</HEADERFILE><HEADERFILE>MassStoreCommands.h</HEADERFILE><HEADERFILE>SCSI_Codes.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MassStorageHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20081205\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20081205\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\ConfigDescriptor.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\MassStorageHost.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\MassStoreCommands.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\ConfigDescriptor.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\MassStorageHost.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\MassStorageHost\MassStoreCommands.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.c b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.c
new file mode 100644
index 00000000..ee4befd0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.c
@@ -0,0 +1,420 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MassStorageHost demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "MassStorageHost.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MS Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_MassStore_Host , TaskStatus: TASK_STOP },
+};
+
+/* Globals */
+/** Index of the highest available LUN (Logical Unit) in the attached Mass Storage Device */
+uint8_t MassStore_MaxLUNIndex;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+ HWB_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "MassStore Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop USB management and Mass Storage tasks */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_MassStore_Host, TASK_STOP);
+
+ puts_P(PSTR("\r\nDevice Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Once device is fully enumerated, start the Mass Storage Host task */
+ Scheduler_SetTaskMode(USB_MassStore_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read in blocks from
+ * the device and print them to the serial port.
+ */
+TASK(USB_MassStore_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Mass Storage Disk Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Indicate device busy via the status LEDs */
+ UpdateStatus(Status_Busy);
+
+ /* Reset the Mass Storage device interface, ready for use */
+ if ((ErrorCode = MassStore_MassStorageReset()) != HOST_SENDCONTROL_Successful)
+ {
+ ShowDiskReadError(PSTR("Mass Storage Reset"), ErrorCode);
+ break;
+ }
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = MassStore_GetMaxLUN(&MassStore_MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
+ {
+ ShowDiskReadError(PSTR("Get Max LUN"), ErrorCode);
+ break;
+ }
+
+ /* Print number of LUNs detected in the attached device */
+ printf_P(PSTR("Total LUNs: %d.\r\n"), (MassStore_MaxLUNIndex + 1));
+
+ /* Set the prevent removal flag for the device, allowing it to be accessed */
+ if ((ErrorCode = MassStore_PreventAllowMediumRemoval(0, true)) != 0)
+ {
+ ShowDiskReadError(PSTR("Prevent/Allow Medium Removal"), ErrorCode);
+ break;
+ }
+
+ /* Get sense data from the device - many devices will not accept any other commands until the sense data
+ * is read - both on startup and after a failed command */
+ SCSI_Request_Sense_Response_t SenseData;
+ if ((ErrorCode = MassStore_RequestSense(0, &SenseData)) != 0)
+ {
+ ShowDiskReadError(PSTR("Request Sense"), ErrorCode);
+ break;
+ }
+
+ puts_P(PSTR("Waiting until ready"));
+
+ /* Wait until disk ready */
+ do
+ {
+ Serial_TxByte('.');
+ MassStore_TestUnitReady(0);
+ }
+ while ((SCSICommandStatus.Status != Command_Pass) && USB_IsConnected);
+
+ /* Abort if device removed */
+ if (!(USB_IsConnected))
+ break;
+
+ puts_P(PSTR("\r\nRetrieving Capacity... "));
+
+ /* Create new structure for the disk's capacity in blocks and block size */
+ SCSI_Capacity_t DiskCapacity;
+
+ /* Retrieve disk capacity */
+ if ((ErrorCode = MassStore_ReadCapacity(0, &DiskCapacity)) != 0)
+ {
+ ShowDiskReadError(PSTR("Read Capacity"), ErrorCode);
+ break;
+ }
+
+ /* Display the disk capacity in blocks * block size bytes */
+ printf_P(PSTR("%lu blocks of %lu bytes.\r\n"), DiskCapacity.Blocks, DiskCapacity.BlockSize);
+
+ /* Create a new buffer capabable of holding a single block from the device */
+ uint8_t BlockBuffer[DiskCapacity.BlockSize];
+
+ /* Read in the first 512 byte block from the device */
+ if ((ErrorCode = MassStore_ReadDeviceBlock(0, 0x00000000, 1, DiskCapacity.BlockSize, BlockBuffer)) != 0)
+ {
+ ShowDiskReadError(PSTR("Read Device Block"), ErrorCode);
+ break;
+ }
+
+ /* Show the number of bytes not transferred in the previous command */
+ printf_P(PSTR("Transfer Residue: %lu\r\n"), SCSICommandStatus.DataTransferResidue);
+
+ puts_P(PSTR("\r\nContents of first block:\r\n"));
+
+ /* Print out the first block in both HEX and ASCII, 16 bytes per line */
+ for (uint16_t Chunk = 0; Chunk < (DiskCapacity.BlockSize >> 4); Chunk++)
+ {
+ /* Pointer to the start of the current 16-byte chunk in the read block of data */
+ uint8_t* ChunkPtr = &BlockBuffer[Chunk << 4];
+
+ /* Print out the 16 bytes of the chunk in HEX format */
+ for (uint8_t ByteOffset = 0; ByteOffset < (1 << 4); ByteOffset++)
+ {
+ char CurrByte = *(ChunkPtr + ByteOffset);
+
+ printf_P(PSTR("%.2X "), CurrByte);
+ }
+
+ puts_P(PSTR(" "));
+
+ /* Print out the 16 bytes of the chunk in ASCII format */
+ for (uint8_t ByteOffset = 0; ByteOffset < (1 << 4); ByteOffset++)
+ {
+ char CurrByte = *(ChunkPtr + ByteOffset);
+
+ putchar(isprint(CurrByte) ? CurrByte : '.');
+ }
+
+ puts_P(PSTR("\r\n"));
+ }
+
+ puts_P(PSTR("\r\n\r\nPress HWB to read entire ASCII contents of disk...\r\n\r\n"));
+
+ /* Wait for HWB to be pressed */
+ while (!(HWB_GetStatus()))
+ {
+ /* Abort if device removed */
+ if (!(USB_IsConnected))
+ break;
+ }
+
+ /* Print out the entire disk contents in ASCII format */
+ for (uint32_t CurrBlock = 0; CurrBlock < DiskCapacity.Blocks; CurrBlock++)
+ {
+ /* Read in the next block of data from the device */
+ if ((ErrorCode = MassStore_ReadDeviceBlock(0, CurrBlock, 1, DiskCapacity.BlockSize, BlockBuffer)) != 0)
+ {
+ ShowDiskReadError(PSTR("Read Device Block"), ErrorCode);
+ break;
+ }
+
+ /* Send the ASCII data in the read in block to the serial port */
+ for (uint16_t Byte = 0; Byte < DiskCapacity.BlockSize; Byte++)
+ {
+ char CurrByte = BlockBuffer[Byte];
+
+ putchar(isprint(CurrByte) ? CurrByte : '.');
+ }
+
+ /* Abort if device removed */
+ if (!(USB_IsConnected))
+ break;
+ }
+
+ /* Indicate device no longer busy */
+ UpdateStatus(Status_USBReady);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MassStorageHost_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ case Status_SCSICommandError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ case Status_Busy:
+ LEDMask = (LEDS_LED1 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Indicates that a communication error has ocurred with the attached Mass Storage Device,
+ * printing error codes to the serial port and waiting until the device is removed before
+ * continuing.
+ *
+ * \param CommandString ASCII string located in PROGMEM space indicating what operation failed
+ * \param ErrorCode Error code of the function which failed to complete successfully
+ */
+void ShowDiskReadError(char* CommandString, uint8_t ErrorCode)
+{
+ /* Display the error code */
+ printf_P(PSTR(ESC_BG_RED "Command error (%S).\r\n"), CommandString);
+ printf_P(PSTR(" -- Error Code: %d"), ErrorCode);
+
+ Pipe_Freeze();
+
+ /* Indicate device error via the status LEDs */
+ UpdateStatus(Status_SCSICommandError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.h b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.h
new file mode 100644
index 00000000..3ace6d46
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.h
@@ -0,0 +1,85 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MassStoreHost.c.
+ */
+
+#ifndef _MASS_STORE_HOST_H_
+#define _MASS_STORE_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+ #include <ctype.h>
+
+ #include "ConfigDescriptor.h"
+ #include "MassStoreCommands.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MassStorageHost_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ Status_Busy = 5, /**< Busy reading or writing to the attached Mass Storage device */
+ Status_SCSICommandError = 6, /**< Error sending or recieving a command to or from the attached SCSI device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_MassStore_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void ShowDiskReadError(char* CommandString, uint8_t ErrorCode);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.txt b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.txt
new file mode 100644
index 00000000..2defd7fe
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStorageHost.txt
@@ -0,0 +1,43 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mass Storage Host Demo
+ *
+ * Mass Storage host demonstration application. This gives a simple reference
+ * application for implementing a USB Mass Storage host, for USB storage devices
+ * using the standard Mass Storage USB profile.
+ *
+ * The first 512 bytes (boot sector) of an attached disk's memory will be dumped
+ * out of the serial port in HEX and ASCII form when it is attached to the AT90USB1287
+ * AVR. The device will then wait for HWB to be pressed, whereupon the entire ASCII contents
+ * of the disk will be dumped to the serial port.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Mass Storage Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Bulk Only</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Mass Storage Standard</td>
+ * <td>USB Bulk-Only Transport Standard</td>
+ * <td>SCSI Primary Commands Specification</td>
+ * <td>SCSI Block Commands Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.c b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.c
new file mode 100644
index 00000000..2760eaa5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.c
@@ -0,0 +1,664 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Mass Storage Device commands, to issue MSD commands to the device for
+ * reading device status, capacity, and other characteristics. This file
+ * also contains block read and write functions, so that device blocks
+ * can be read and written. In general, these functions would be chained
+ * to a FAT library to give file-level access to an attached device's contents.
+ */
+
+#define INCLUDE_FROM_MASSSTORE_COMMANDS_C
+#include "MassStoreCommands.h"
+
+/* Globals: */
+/** Current CBW to send to the device. This is automatically filled by the routines
+ * in this file and is not externally accessable.
+ */
+static CommandBlockWrapper_t SCSICommandBlock;
+
+/** Current CSW received from the device. This is automatically filled by the routines
+ * in this file and is externally accessable so that the return codes may be checked.
+ */
+CommandStatusWrapper_t SCSICommandStatus;
+
+/** Current Tag value used in issued CBWs to the device. This is automatically incremented
+ * by the routines in this file, and is not externally accessable.
+ */
+static uint32_t MassStore_Tag = 1;
+
+
+/** Routine to send the current CBW to the device, and increment the Tag value as needed.
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+static uint8_t MassStore_SendCommand(void)
+{
+ uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Each transmission should have a unique tag value, excluding valued 0 and 0xFFFFFFFF */
+ if (++MassStore_Tag == 0xFFFFFFFF)
+ MassStore_Tag = 1;
+
+ /* Select the OUT data pipe for CBW transmission */
+ Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
+
+ /* Write the CBW command to the OUT pipe */
+ if ((ErrorCode = Pipe_Write_Stream_LE(&SCSICommandBlock, sizeof(CommandBlockWrapper_t))) != PIPE_RWSTREAM_ERROR_NoError)
+ return ErrorCode;
+
+ /* Send the data in the OUT pipe to the attached device */
+ Pipe_ClearCurrentBank();
+
+ /* Some buggy devices require a delay here before the pipe freezing or they will lock up */
+ USB_Host_WaitMS(1);
+
+ /* Freeze pipe after use */
+ Pipe_Freeze();
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Waits until the attached device is ready to accept data following a CBW, checking
+ * to ensure that the device has not stalled the transaction.
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+static uint8_t MassStore_WaitForDataReceived(void)
+{
+ uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
+
+ /* Unfreeze the OUT pipe so that it can be checked */
+ Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
+
+ /* Select the IN data pipe for data reception */
+ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
+
+ /* Wait until data received in the IN pipe */
+ while (!(Pipe_ReadWriteAllowed()))
+ {
+ /* Check to see if a new frame has been issued (1ms elapsed) */
+ if (USB_INT_HasOccurred(USB_INT_HSOFI))
+ {
+ /* Clear the flag and decrement the timout period counter */
+ USB_INT_Clear(USB_INT_HSOFI);
+ TimeoutMSRem--;
+
+ /* Check to see if the timeout period for the command has elapsed */
+ if (!(TimeoutMSRem))
+ return PIPE_RWSTREAM_ERROR_Timeout;
+ }
+
+ Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+
+ /* Check if pipe stalled (command failed by device) */
+ if (Pipe_IsStalled())
+ {
+ /* Clear the stall condition on the OUT pipe */
+ MassStore_ClearPipeStall(MASS_STORE_DATA_OUT_PIPE);
+
+ return PIPE_RWSTREAM_ERROR_PipeStalled;
+ }
+
+ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+
+ /* Check if pipe stalled (command failed by device) */
+ if (Pipe_IsStalled())
+ {
+ /* Clear the stall condition on the IN pipe */
+ MassStore_ClearPipeStall(MASS_STORE_DATA_IN_PIPE);
+
+ return PIPE_RWSTREAM_ERROR_PipeStalled;
+ }
+
+ /* Check to see if the device was disconnected, if so exit function */
+ if (!(USB_IsConnected))
+ return PIPE_RWSTREAM_ERROR_DeviceDisconnected;
+ };
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Sends or receives the transaction's data stage to or from the attached device, reading or
+ * writing to the nominated buffer.
+ *
+ * \param BufferPtr Pointer to the data buffer to read from or write to
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+static uint8_t MassStore_SendReceiveData(void* BufferPtr)
+{
+ uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
+ uint16_t BytesRem = SCSICommandBlock.Header.DataTransferLength;
+
+ /* Check the direction of the SCSI command data stage */
+ if (SCSICommandBlock.Header.Flags & COMMAND_DIRECTION_DATA_IN)
+ {
+ /* Select the IN data pipe for data reception */
+ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
+
+ /* Read in the block data from the pipe */
+ if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)
+ return ErrorCode;
+ }
+ else
+ {
+ /* Select the OUT data pipe for data transmission */
+ Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
+
+ /* Write the block data to the pipe */
+ if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)
+ return ErrorCode;
+ }
+
+ /* Acknowledge the packet */
+ Pipe_ClearCurrentBank();
+
+ /* Some buggy devices require a delay here before the pipe freezing or they will lock up */
+ USB_Host_WaitMS(1);
+
+ /* Freeze used pipe after use */
+ Pipe_Freeze();
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Routine to receive the current CSW from the device.
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+static uint8_t MassStore_GetReturnedStatus(void)
+{
+ uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Select the IN data pipe for data reception */
+ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
+
+ /* Load in the CSW from the attached device */
+ if ((ErrorCode = Pipe_Read_Stream_LE(&SCSICommandStatus, sizeof(CommandStatusWrapper_t))) != PIPE_RWSTREAM_ERROR_NoError)
+ return ErrorCode;
+
+ /* Clear the data ready for next reception */
+ Pipe_ClearCurrentBank();
+
+ /* Some buggy devices require a delay here before the pipe freezing or they will lock up */
+ USB_Host_WaitMS(1);
+
+ /* Freeze the IN pipe after use */
+ Pipe_Freeze();
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Clears the stall condition in the attached device on the nominated endpoint number.
+ *
+ * \param EndpointNum Endpoint number in the attached device whose stall condition is to be cleared
+ *
+ * \return A value from the USB_Host_SendControlErrorCodes_t enum
+ */
+uint8_t MassStore_ClearPipeStall(const uint8_t EndpointNum)
+{
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
+ bRequest: REQ_ClearFeature,
+ wValue: FEATURE_ENDPOINT_HALT,
+ wIndex: EndpointNum,
+ wLength: 0,
+ };
+
+ return USB_Host_SendControlRequest(NULL);
+}
+
+/** Issues a Mass Storage class specific request to reset the attached device's Mass Storage interface,
+ * readying the device for the next CBW.
+ *
+ * \return A value from the USB_Host_SendControlErrorCodes_t enum
+ */
+uint8_t MassStore_MassStorageReset(void)
+{
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_MassStorageReset,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ return USB_Host_SendControlRequest(NULL);
+}
+
+/** Issues a Mass Storage class specific request to determine the index of the highest numbered Logical
+ * Unit in the attached device.
+ *
+ * \param MaxLUNIndex Pointer to the location that the maximum LUN index value should be stored
+ *
+ * \return A value from the USB_Host_SendControlErrorCodes_t enum
+ */
+uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex)
+{
+ uint8_t ErrorCode;
+
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_GetMaxLUN,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 1,
+ };
+
+ if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) == HOST_SENDCONTROL_SetupStalled)
+ {
+ /* Clear the pipe stall */
+ Pipe_ClearStall();
+
+ /* Some faulty Mass Storage devices don't implement the GET_MAX_LUN request, so assume a single LUN */
+ *MaxLUNIndex = 0;
+ }
+
+ return ErrorCode;
+}
+
+/** Issues a SCSI Request Sense command to the attached device, to determine the current SCSI sense information. This
+ * gives error codes for the last issued SCSI command to the device.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ * \param SensePtr Pointer to the sense data structure where the sense data from the device is to be stored
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_RequestSense(const uint8_t LUNIndex, const SCSI_Request_Sense_Response_t* const SensePtr)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to issue REQUEST SENSE command */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: sizeof(SCSI_Request_Sense_Response_t),
+ Flags: COMMAND_DIRECTION_DATA_IN,
+ LUN: LUNIndex,
+ SCSICommandLength: 6
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_REQUEST_SENSE,
+ 0x00, // Reserved
+ 0x00, // Reserved
+ 0x00, // Reserved
+ sizeof(SCSI_Request_Sense_Response_t), // Allocation Length
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Wait until data received from the device */
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read the returned sense data into the buffer */
+ if ((ReturnCode = MassStore_SendReceiveData((uint8_t*)SensePtr)) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Issues a SCSI Device Block Read command to the attached device, to read in one or more data blocks from the
+ * storage medium into a buffer.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ * \param BlockAddress Start block address to read from
+ * \param Blocks Number of blocks to read from the device
+ * \param BlockSize Size in bytes of each block to read
+ * \param BufferPtr Pointer to the buffer where the read data is to be written to
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,
+ const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to read in the given blocks from the device */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: ((uint32_t)Blocks * BlockSize),
+ Flags: COMMAND_DIRECTION_DATA_IN,
+ LUN: LUNIndex,
+ SCSICommandLength: 10
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_READ_10,
+ 0x00, // Unused (control bits, all off)
+ (BlockAddress >> 24), // MSB of Block Address
+ (BlockAddress >> 16),
+ (BlockAddress >> 8),
+ (BlockAddress & 0xFF), // LSB of Block Address
+ 0x00, // Unused (reserved)
+ 0x00, // MSB of Total Blocks to Read
+ Blocks, // LSB of Total Blocks to Read
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Wait until data received from the device */
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read the returned block data into the buffer */
+ if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Issues a SCSI Device Block Write command to the attached device, to write one or more data blocks to the
+ * storage medium from a buffer.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ * \param BlockAddress Start block address to write to
+ * \param Blocks Number of blocks to write to in the device
+ * \param BlockSize Size in bytes of each block to write
+ * \param BufferPtr Pointer to the buffer where the write data is to be sourced from
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,
+ const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to write the given blocks to the device */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: ((uint32_t)Blocks * BlockSize),
+ Flags: COMMAND_DIRECTION_DATA_OUT,
+ LUN: LUNIndex,
+ SCSICommandLength: 10
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_WRITE_10,
+ 0x00, // Unused (control bits, all off)
+ (BlockAddress >> 24), // MSB of Block Address
+ (BlockAddress >> 16),
+ (BlockAddress >> 8),
+ (BlockAddress & 0xFF), // LSB of Block Address
+ 0x00, // Unused (reserved)
+ 0x00, // MSB of Total Blocks to Write
+ Blocks, // LSB of Total Blocks to Write
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Write the data to the device from the buffer */
+ if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Issues a SCSI Device Test Unit Ready command to the attached device, to determine if the device is ready to accept
+ * other commands.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to issue TEST UNIT READY command */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: 0,
+ Flags: COMMAND_DIRECTION_DATA_IN,
+ LUN: LUNIndex,
+ SCSICommandLength: 6
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_TEST_UNIT_READY,
+ 0x00, // Reserved
+ 0x00, // Reserved
+ 0x00, // Reserved
+ 0x00, // Reserved
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Issues a SCSI Device Read Capacity command to the attached device, to determine the capacity of the
+ * given Logical Unit within the device.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ * \param CapacityPtr Device capacity structure where the capacity data is to be stored
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const CapacityPtr)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to issue READ CAPACITY command */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: 8,
+ Flags: COMMAND_DIRECTION_DATA_IN,
+ LUN: LUNIndex,
+ SCSICommandLength: 10
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_READ_CAPACITY_10,
+ 0x00, // Reserved
+ 0x00, // MSB of Logical block address
+ 0x00,
+ 0x00,
+ 0x00, // LSB of Logical block address
+ 0x00, // Reserved
+ 0x00, // Reserved
+ 0x00, // Partial Medium Indicator
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Wait until data received from the device */
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Read the returned capacity data into the buffer */
+ if ((ReturnCode = MassStore_SendReceiveData(CapacityPtr)) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ /* Endian-correct the read data */
+ CapacityPtr->Blocks = SwapEndian_32(CapacityPtr->Blocks);
+ CapacityPtr->BlockSize = SwapEndian_32(CapacityPtr->BlockSize);
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Issues a SCSI Device Prevent/Allow Medium Removal command to the attached device, to lock the physical media from
+ * being removed. This is a legacy command for SCSI disks with removable storage (such as ZIP disks), but should still
+ * be issued before the first read or write command is sent.
+ *
+ * \param LUNIndex Index of the LUN inside the device the command is being addressed to
+ * \param PreventRemoval Whether or not the LUN media should be locked to prevent removal or not
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool PreventRemoval)
+{
+ uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;
+
+ /* Create a CBW with a SCSI command to issue PREVENT ALLOW MEDIUM REMOVAL command */
+ SCSICommandBlock = (CommandBlockWrapper_t)
+ {
+ Header:
+ {
+ Signature: CBW_SIGNATURE,
+ Tag: MassStore_Tag,
+ DataTransferLength: 0,
+ Flags: COMMAND_DIRECTION_DATA_OUT,
+ LUN: LUNIndex,
+ SCSICommandLength: 6
+ },
+
+ SCSICommandData:
+ {
+ SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL,
+ 0x00, // Reserved
+ 0x00, // Reserved
+ PreventRemoval, // Prevent flag
+ 0x00, // Reserved
+ 0x00 // Unused (control)
+ }
+ };
+
+ /* Send SCSI command to the attached device */
+ MassStore_SendCommand();
+
+ /* Read in the returned CSW from the device */
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ Pipe_Freeze();
+ return ReturnCode;
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.h b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.h
new file mode 100644
index 00000000..d3ddfeeb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/MassStoreCommands.h
@@ -0,0 +1,176 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MassStoreCommands.c.
+ */
+
+#ifndef _MASS_STORE_COMMANDS_H_
+#define _MASS_STORE_COMMANDS_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "MassStorageHost.h"
+ #include "SCSI_Codes.h"
+
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+
+ /* Macros: */
+ /** Class specific request to reset the Mass Storage interface of the attached device */
+ #define REQ_MassStorageReset 0xFF
+
+ /** Class specific request to retrieve the maximum Logical Unit Number (LUN) index of the attached device */
+ #define REQ_GetMaxLUN 0xFE
+
+ /** Command Block Wrapper signature byte, for verification of valid CBW blocks */
+ #define CBW_SIGNATURE 0x43425355UL
+
+ /** Command Statuc Wrapper signature byte, for verification of valid CSW blocks */
+ #define CSW_SIGNATURE 0x53425355UL
+
+ /** Data direction mask for the Flags field of a CBW, indicating Host-to-Device transfer direction */
+ #define COMMAND_DIRECTION_DATA_OUT (0 << 7)
+
+ /** Data direction mask for the Flags field of a CBW, indicating Device-to-Host transfer direction */
+ #define COMMAND_DIRECTION_DATA_IN (1 << 7)
+
+ /** Timeout period between the issuing of a CBW to a device, and the reception of the first packet */
+ #define COMMAND_DATA_TIMEOUT_MS 500
+
+ /** Pipe number of the Mass Storage data IN pipe */
+ #define MASS_STORE_DATA_IN_PIPE 1
+
+ /** Pipe number of the Mass Storage data OUT pipe */
+ #define MASS_STORE_DATA_OUT_PIPE 2
+
+ /* Type defines: */
+ /** Type define for a Mass Storage class Command Block Wrapper, used to wrap SCSI
+ * commands for transport over the USB bulk endpoints to the device.
+ */
+ typedef struct
+ {
+ struct
+ {
+ uint32_t Signature; /**< Command block signature, always equal to CBW_SIGNATURE */
+ uint32_t Tag; /**< Current CBW tag, to positively associate a CBW with a CSW */
+ uint32_t DataTransferLength; /**< Length of data to transfer, following the CBW */
+ uint8_t Flags; /**< Block flags, equal to one of the COMMAND_DIRECTION_DATA_* macros */
+ uint8_t LUN; /**< Logical Unit Number the CBW is addressed to in the device */
+ uint8_t SCSICommandLength; /**< Length of the SCSI command in the CBW */
+ } Header;
+
+ uint8_t SCSICommandData[16]; /**< SCSI command to issue to the device */
+ } CommandBlockWrapper_t;
+
+ /** Type define for a Mass Storage class Command Status Wrapper, used to wrap SCSI
+ * responses for transport over the USB bulk endpoints from the device.
+ */
+ typedef struct
+ {
+ uint32_t Signature; /**< Command status signature, always equal to CSW_SIGNATURE */
+ uint32_t Tag; /**< Current CBW tag, to positively associate a CBW with a CSW */
+ uint32_t DataTransferResidue; /**< Length of data not transfered */
+ uint8_t Status; /**< Command status, a value from the MassStorageHost_CommandStatusCodes_t enum */
+ } CommandStatusWrapper_t;
+
+ /** Type define for a SCSI Sense structure. Structures of this type are filled out by the
+ * device via the MassStore_RequestSense() function, indicating the current sense data of the
+ * device (giving explitic error codes for the last issued command). For details of the
+ * structure contents, refer to the SCSI specifications.
+ */
+ typedef struct
+ {
+ unsigned int ReponseCode : 7;
+ unsigned int Valid : 1;
+
+ uint8_t SegmentNumber;
+
+ unsigned int SenseKey : 4;
+ unsigned int _RESERVED1 : 1;
+ unsigned int ILI : 1;
+ unsigned int EOM : 1;
+ unsigned int FileMark : 1;
+
+ uint8_t Information[4];
+ uint8_t AdditionalLength;
+ uint8_t CmdSpecificInformation[4];
+ uint8_t AdditionalSenseCode;
+ uint8_t AdditionalSenseQualifier;
+ uint8_t FieldReplaceableUnitCode;
+ uint8_t SenseKeySpecific[3];
+ } SCSI_Request_Sense_Response_t;
+
+ /** SCSI capacity structure, to hold the total capacity of the device in both the number
+ * of blocks in the current LUN, and the size of each block. This structure is filled by
+ * the device when the MassStore_ReadCapacity() function is called.
+ */
+ typedef struct
+ {
+ uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device */
+ uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN */
+ } SCSI_Capacity_t;
+
+ /* Enums: */
+ /** CSW status return codes, indicating the overall status of the issued CBW */
+ enum MassStorageHost_CommandStatusCodes_t
+ {
+ Command_Pass = 0, /**< Command completed successfully */
+ Command_Fail = 1, /**< Command failed to complete successfully */
+ Phase_Error = 2 /**< Phase error while processing the issued command */
+ };
+
+ /* External Variables: */
+ extern CommandStatusWrapper_t SCSICommandStatus;
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_MASSSTORE_COMMANDS_C)
+ static uint8_t MassStore_SendCommand(void);
+ static uint8_t MassStore_WaitForDataReceived(void);
+ static uint8_t MassStore_SendReceiveData(void* BufferPtr) ATTR_NON_NULL_PTR_ARG(1);
+ static uint8_t MassStore_GetReturnedStatus(void);
+ #endif
+
+ uint8_t MassStore_ClearPipeStall(const uint8_t EndpointNum);
+ uint8_t MassStore_MassStorageReset(void);
+ uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex);
+ uint8_t MassStore_RequestSense(const uint8_t LUNIndex, const SCSI_Request_Sense_Response_t* const SensePtr)
+ ATTR_NON_NULL_PTR_ARG(2);
+ uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,
+ const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5);
+ uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,
+ const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5);
+ uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const CapacityPtr)
+ ATTR_NON_NULL_PTR_ARG(2);
+ uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex);
+ uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool PreventRemoval);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/SCSI_Codes.h b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/SCSI_Codes.h
new file mode 100644
index 00000000..2b2213de
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/SCSI_Codes.h
@@ -0,0 +1,85 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header containing macros for possible SCSI commands and SENSE data. Refer to
+ * the SCSI standard documentation for more information on each SCSI command and
+ * the SENSE data.
+ */
+
+#ifndef _SCSI_CODES_H_
+#define _SCSI_CODES_H_
+
+ /* Macros: */
+ #define SCSI_CMD_INQUIRY 0x12
+ #define SCSI_CMD_REQUEST_SENSE 0x03
+ #define SCSI_CMD_TEST_UNIT_READY 0x00
+ #define SCSI_CMD_READ_CAPACITY_10 0x25
+ #define SCSI_CMD_SEND_DIAGNOSTIC 0x1D
+ #define SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
+ #define SCSI_CMD_WRITE_10 0x2A
+ #define SCSI_CMD_READ_10 0x28
+ #define SCSI_CMD_WRITE_6 0x0A
+ #define SCSI_CMD_READ_6 0x08
+ #define SCSI_CMD_VERIFY_10 0x2F
+ #define SCSI_CMD_MODE_SENSE_6 0x1A
+ #define SCSI_CMD_MODE_SENSE_10 0x5A
+
+ #define SCSI_SENSE_KEY_GOOD 0x00
+ #define SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
+ #define SCSI_SENSE_KEY_NOT_READY 0x02
+ #define SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
+ #define SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
+ #define SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
+ #define SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
+ #define SCSI_SENSE_KEY_DATA_PROTECT 0x07
+ #define SCSI_SENSE_KEY_BLANK_CHECK 0x08
+ #define SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
+ #define SCSI_SENSE_KEY_COPY_ABORTED 0x0A
+ #define SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
+ #define SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
+ #define SCSI_SENSE_KEY_MISCOMPARE 0x0E
+
+ #define SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
+ #define SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
+ #define SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
+ #define SCSI_ASENSE_WRITE_PROTECTED 0x27
+ #define SCSI_ASENSE_FORMAT_ERROR 0x31
+ #define SCSI_ASENSE_INVALID_COMMAND 0x20
+ #define SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
+ #define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
+
+ #define SCSI_ASENSEQ_NO_QUALIFIER 0x00
+ #define SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
+ #define SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
+ #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MassStorageHost/makefile b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/makefile
new file mode 100644
index 00000000..c7853e81
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MassStorageHost/makefile
@@ -0,0 +1,706 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MassStorageHost
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ MassStoreCommands.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.c
new file mode 100644
index 00000000..dac048b9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.c
@@ -0,0 +1,251 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x02, /* Usage (Mouse) */
+ 0xA1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xA1, 0x00, /* Collection (Application) */
+ 0x95, 0x03, /* Report Count (3) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x09, /* Usage Page (Button) */
+ 0x19, 0x01, /* Usage Minimum (Button 1) */
+ 0x29, 0x03, /* Usage Maximum (Button 3) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x05, /* Report Size (5) */
+ 0x81, 0x01, /* Input (Constant) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x05, 0x01, /* Usage Page (Generic Desktop Control) */
+ 0x09, 0x30, /* Usage X */
+ 0x09, 0x31, /* Usage Y */
+ 0x15, 0x81, /* Logical Minimum (-127) */
+ 0x25, 0x7F, /* Logical Maximum (127) */
+ 0x81, 0x06, /* Input (Data, Variable, Relative) */
+ 0xC0, /* End Collection */
+ 0xC0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2041,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ MouseHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(MouseReport)
+ },
+
+ MouseEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: MOUSE_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Mouse Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(MouseReport);
+ Size = sizeof(MouseReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
+
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.h
new file mode 100644
index 00000000..1fcee721
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Descriptors.h
@@ -0,0 +1,93 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t MouseHID;
+ USB_Descriptor_Endpoint_t MouseEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPNUM 1
+
+ /** Size in bytes of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/Mouse/Doxygen.conf
new file mode 100644
index 00000000..62c4db11
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.aps b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.aps
new file mode 100644
index 00000000..3ae16379
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>Mouse</ProjectName><Created>30-Sep-2008 14:13:52</Created><LastEdit>30-Sep-2008 14:14:08</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:13:52</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\Mouse\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>Mouse.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>Mouse.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>Mouse.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.c b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.c
new file mode 100644
index 00000000..9080efba
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.c
@@ -0,0 +1,376 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the Mouse demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "Mouse.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Mouse App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Mouse_Report , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and Mouse reporting tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running mouse reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the mouse reporting task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Mouse Report Endpoint */
+ Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, MOUSE_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+
+ /* Start running mouse reporting task */
+ Scheduler_SetTaskMode(USB_Mouse_Report, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_MouseReport_Data_t MouseReportData;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(MouseReportData))
+ wLength = sizeof(MouseReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&MouseReportData, wLength);
+
+ /* Clear the report data afterwards */
+ memset(&MouseReportData, 0, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_MouseReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ static bool PrevHWBStatus = false;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_MouseReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->Y = -1;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->Y = 1;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 1;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->X = -1;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->Button = (1 << 0);
+
+ if (HWB_GetStatus())
+ ReportData->Button |= (1 << 1);
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = ((uint8_t)(PrevJoyStatus ^ JoyStatus_LCL) | (uint8_t)(HWB_GetStatus() ^ PrevHWBStatus));
+
+ /* Save the current joystick and HWB status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+ PrevHWBStatus = HWB_GetStatus();
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the Mouse_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to manage HID report generation and transmission to the host, when in report mode. */
+TASK(USB_Mouse_Report)
+{
+ USB_MouseReport_Data_t MouseReportData;
+ bool SendReport = true;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Check if the idle period is set*/
+ if (IdleCount)
+ {
+ /* Determine if the idle period has elapsed */
+ if (!(IdleMSRemaining))
+ {
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+ else
+ {
+ /* Idle period not elapsed, indicate that a report must not be sent */
+ SendReport = false;
+ }
+ }
+
+ /* Check if the USB system is connected to a host */
+ if (USB_IsConnected)
+ {
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
+
+ /* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */
+ if (Endpoint_ReadWriteAllowed() && SendReport)
+ {
+ /* Write Mouse Report Data */
+ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.h b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.h
new file mode 100644
index 00000000..1c7b5888
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.h
@@ -0,0 +1,115 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Mouse.c.
+ */
+
+#ifndef _MOUSE_H_
+#define _MOUSE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Task Definitions: */
+ TASK(USB_Mouse_Report);
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Button; /**< Bit mask of the currently pressed mouse buttons */
+ int8_t X; /**< Current mouse delta X movement, as a signed 8-bit integer */
+ int8_t Y; /**< Current mouse delta Y movement, as a signed 8-bit integer */
+ } USB_MouseReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum Mouse_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_MouseReport_Data_t* ReportData);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.txt b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.txt
new file mode 100644
index 00000000..7b7360f0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/Mouse.txt
@@ -0,0 +1,43 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mouse Device Demo
+ *
+ * Mouse demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse using the basic USB HID
+ * drivers in all modern OSes (i.e. no special drivers required). It is
+ * boot protocol compatible, and thus works under compatible BIOS as if
+ * it was a native mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a mouse when the USB connection to a host is present. To use
+ * the mouse, move the joystick to move the pointer, and push the
+ * joystick inwards to simulate a left-button click. The HWB serves as
+ * the right mouse button.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/Mouse/makefile b/digital/avr/modules/usb/lufa/Demos/Mouse/makefile
new file mode 100644
index 00000000..5f851f3b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/Mouse/makefile
@@ -0,0 +1,703 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = Mouse
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+#CFLAGS += -mshort-calls
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.c
new file mode 100644
index 00000000..6a139bc9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.c
@@ -0,0 +1,250 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x02, /* Usage (Mouse) */
+ 0xA1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xA1, 0x00, /* Collection (Application) */
+ 0x95, 0x03, /* Report Count (3) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x09, /* Usage Page (Button) */
+ 0x19, 0x01, /* Usage Minimum (Button 1) */
+ 0x29, 0x03, /* Usage Maximum (Button 3) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x05, /* Report Size (5) */
+ 0x81, 0x01, /* Input (Constant) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x05, 0x01, /* Usage Page (Generic Desktop Control) */
+ 0x09, 0x30, /* Usage X */
+ 0x09, 0x31, /* Usage Y */
+ 0x15, 0x81, /* Logical Minimum (-127) */
+ 0x25, 0x7F, /* Logical Maximum (127) */
+ 0x81, 0x06, /* Input (Data, Variable, Relative) */
+ 0xC0, /* End Collection */
+ 0xC0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2041,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x02,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ MouseHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(MouseReport)
+ },
+
+ MouseEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: MOUSE_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Mouse Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(MouseReport);
+ Size = sizeof(MouseReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.h
new file mode 100644
index 00000000..3aea3164
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Descriptors.h
@@ -0,0 +1,93 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t MouseHID;
+ USB_Descriptor_Endpoint_t MouseEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPNUM 1
+
+ /** Size in bytes of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Doxygen.conf
new file mode 100644
index 00000000..1ebd12da
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Device Demo (Fully Interrupt Driven)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.aps b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.aps
new file mode 100644
index 00000000..ff9750a4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MouseFullInt</ProjectName><Created>30-Sep-2008 14:14:25</Created><LastEdit>30-Sep-2008 14:14:39</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:14:25</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MouseFullInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>MouseFullInt.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>MouseFullInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MouseFullInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.c b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.c
new file mode 100644
index 00000000..c21959a2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.c
@@ -0,0 +1,399 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MouseFullInt demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "MouseFullInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MouseFI App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Main program code loop */
+ for (;;)
+ {
+ /* No main code -- all USB code is interrupt driven */
+ }
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+}
+
+/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the
+ * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled
+ * asynchronously when they arrive rather than when the control endpoint is polled manually.
+ */
+EVENT_HANDLER(USB_Reset)
+{
+ /* Select the control endpoint */
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+
+ /* Enable the endpoint SETUP interrupt ISR for the control endpoint */
+ USB_INT_Enable(ENDPOINT_INT_SETUP);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the mouse device endpoints.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Mouse Report Endpoint */
+ Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, MOUSE_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint IN interrupt ISR for the report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_IN);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_MouseReport_Data_t MouseReportData;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(MouseReportData))
+ wLength = sizeof(MouseReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&MouseReportData, wLength);
+
+ /* Clear the report data afterwards */
+ memset(&MouseReportData, 0, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_MouseReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ static bool PrevHWBStatus = false;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_MouseReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->Y = -1;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->Y = 1;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 1;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->X = -1;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->Button = (1 << 0);
+
+ if (HWB_GetStatus())
+ ReportData->Button |= (1 << 1);
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = ((uint8_t)(PrevJoyStatus ^ JoyStatus_LCL) | (uint8_t)(HWB_GetStatus() ^ PrevHWBStatus));
+
+ /* Save the current joystick and HWB status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+ PrevHWBStatus = HWB_GetStatus();
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MouseFullInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as
+ * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send
+ * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB
+ * controller. It is also used to respond to standard and class specific requests send to the device on the control
+ * endpoint, by handing them off to the LUFA library when they are received.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ /* Check if the control endpoint has received a request */
+ if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))
+ {
+ /* Clear the endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(ENDPOINT_CONTROLEP);
+
+ /* Process the control request */
+ USB_USBTask();
+
+ /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */
+ USB_INT_Clear(ENDPOINT_INT_SETUP);
+ }
+
+ /* Check if mouse endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(MOUSE_EPNUM))
+ {
+ USB_MouseReport_Data_t MouseReportData;
+ bool SendReport = true;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Check if the idle period is set*/
+ if (IdleCount)
+ {
+ /* Determine if the idle period has elapsed */
+ if (!(IdleMSRemaining))
+ {
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+ else
+ {
+ /* Idle period not elapsed, indicate that a report must not be sent */
+ SendReport = false;
+ }
+ }
+
+ /* Check to see if a report should be issued */
+ if (SendReport)
+ {
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
+
+ /* Write Mouse Report Data */
+ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.h b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.h
new file mode 100644
index 00000000..9fdc51d3
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.h
@@ -0,0 +1,114 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MouseFullInt.c.
+ */
+
+#ifndef _MOUSE_H_
+#define _MOUSE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Button; /**< Bit mask of the currently pressed mouse buttons */
+ int8_t X; /**< Current mouse delta X movement, as a signed 8-bit integer */
+ int8_t Y; /**< Current mouse delta Y movement, as a signed 8-bit integer */
+ } USB_MouseReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MouseFullInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
+ HANDLES_EVENT(USB_Reset);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_MouseReport_Data_t* ReportData);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.txt b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.txt
new file mode 100644
index 00000000..460a8dd7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/MouseFullInt.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Fully Interrupt Driven Mouse Device Demo
+ *
+ * Mouse demonstration application, using endpoint interrupts for the
+ * exchange of data to the USB host, and control requests on the control
+ * endpoint. This gives a simple reference application for implementing a
+ * USB Mouse using the basic USB HID drivers in all modern OSes (i.e. no
+ * special drivers required). It is boot protocol compatible, and thus works
+ * under compatible BIOS as if it was a native mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a mouse when the USB connection to a host is present. To use
+ * the mouse, move the joystick to move the pointer, and push the
+ * joystick inwards to simulate a left-button click. The HWB serves as
+ * the right mouse button.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseFullInt/makefile b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/makefile
new file mode 100644
index 00000000..f781ea90
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseFullInt/makefile
@@ -0,0 +1,703 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MouseFullInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+#CFLAGS += -mshort-calls
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.c
new file mode 100644
index 00000000..645f6c80
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.c
@@ -0,0 +1,155 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint.
+ *
+ * \return An error code from the MouseHost_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the mouse interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the mouse interface's data endpoint descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceMouseDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the mouse data pipe */
+ Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_Unfreeze();
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Mouse HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextMouseInterface)
+{
+ /* Determine if the current descriptor is an interface descriptor */
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL))
+ {
+ /* Indicate that the descriptor being searched for has been found */
+ return Descriptor_Search_Found;
+ }
+ }
+
+ /* Current descriptor does not match what this comparator is looking for */
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
+{
+ /* Determine the type of the current descriptor */
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ /* Check if the current Endpoint descriptor is of type IN */
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Indicate that the descriptor being searched for has been found */
+ return Descriptor_Search_Found;
+ }
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Indicate that the search has failed prematurely and should be aborted */
+ return Descriptor_Search_Fail;
+ }
+
+ /* Current descriptor does not match what this comparator is looking for */
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.h
new file mode 100644
index 00000000..22e73371
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/ConfigDescriptor.h
@@ -0,0 +1,74 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "MouseHost.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define MOUSE_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Mouse compliant device */
+ #define MOUSE_PROTOCOL 0x02
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum MouseHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextMouseInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MouseHost/Doxygen.conf
new file mode 100644
index 00000000..5194af37
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Host Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.aps b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.aps
new file mode 100644
index 00000000..1e40b0c6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MouseHost</ProjectName><Created>30-Sep-2008 14:14:56</Created><LastEdit>30-Sep-2008 14:15:10</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:14:56</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MouseHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>MouseHost.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>MouseHost.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MouseHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.c b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.c
new file mode 100644
index 00000000..2bc13a90
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.c
@@ -0,0 +1,310 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MouseHost demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "MouseHost.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Mouse Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Mouse_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Mouse Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop mouse and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_STOP);
+
+ puts_P(PSTR("Device Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Mouse Host task */
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MouseHost_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read and process
+ * HID reports from the device and display the results onto the board LEDs.
+ */
+TASK(USB_Mouse_Host)
+{
+ uint8_t ErrorCode;
+
+ /* Switch to determine what user-application handled host state the host state machine is in */
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ /* HID class request to set the mouse protocol to the Boot Protocol */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_SetProtocol,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Protocol).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Mouse Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Select and unfreeze mouse data pipe */
+ Pipe_SelectPipe(MOUSE_DATAPIPE);
+ Pipe_Unfreeze();
+
+ /* Check if data has been received from the attached mouse */
+ if (Pipe_ReadWriteAllowed())
+ {
+ USB_MouseReport_Data_t MouseReport;
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Read in mouse report data */
+ Pipe_Read_Stream_LE(&MouseReport, sizeof(MouseReport));
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+
+ /* Alter status LEDs according to mouse X movement */
+ if (MouseReport.X > 0)
+ LEDMask |= LEDS_LED1;
+ else if (MouseReport.X < 0)
+ LEDMask |= LEDS_LED2;
+
+ /* Alter status LEDs according to mouse Y movement */
+ if (MouseReport.Y > 0)
+ LEDMask |= LEDS_LED3;
+ else if (MouseReport.Y < 0)
+ LEDMask |= LEDS_LED4;
+
+ /* Alter status LEDs according to mouse button position */
+ if (MouseReport.Button)
+ LEDMask = LEDS_ALL_LEDS;
+
+ LEDs_SetAllLEDs(LEDMask);
+
+ /* Print mouse report data through the serial port */
+ printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
+ MouseReport.Y,
+ MouseReport.Button);
+ }
+
+ /* Freeze mouse data pipe */
+ Pipe_Freeze();
+ break;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.h b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.h
new file mode 100644
index 00000000..9e474956
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.h
@@ -0,0 +1,95 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MouseHost.c.
+ */
+
+#ifndef _MOUSE_HOST_H_
+#define _MOUSE_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+
+ /* Macros: */
+ /** Pipe number for the mouse data IN pipe */
+ #define MOUSE_DATAPIPE 1
+
+ /** HID Class Specific request to set the report protocol mode */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for a standard Boot Protocol Mouse report */
+ typedef struct
+ {
+ uint8_t Button; /**< Button mask for currently pressed buttons in the mouse */
+ int8_t X; /**< Current delta X movement of the mouse */
+ int8_t Y; /**< Current delta Y movement on the mouse */
+ } USB_MouseReport_Data_t;
+
+ /* Task Definitions: */
+ TASK(USB_Mouse_Host);
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MouseHost_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ };
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.txt b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.txt
new file mode 100644
index 00000000..11c434c6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/MouseHost.txt
@@ -0,0 +1,47 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mouse Host Demo
+ *
+ * Mouse host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse host, for USB mice using
+ * the standard mouse HID profile.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs,
+ * as well as printed out the serial terminal as formatted dY, dY and
+ * button status information.
+ *
+ * This uses a naive method where the mouse is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * MouseHostWithParser demo application.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHost/makefile b/digital/avr/modules/usb/lufa/Demos/MouseHost/makefile
new file mode 100644
index 00000000..b812428d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHost/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MouseHost
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.c
new file mode 100644
index 00000000..cb629d48
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.c
@@ -0,0 +1,149 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint.
+ *
+ * \return An error code from the MouseHostViaInt_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the mouse interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the mouse interface's data endpoint descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceMouseDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the mouse data pipe */
+ Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
+ Pipe_Unfreeze();
+
+ /* Enable the pipe IN interrupt for the data pipe */
+ USB_INT_Enable(PIPE_INT_IN);
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Mouse HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextMouseInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.h
new file mode 100644
index 00000000..4328646a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/ConfigDescriptor.h
@@ -0,0 +1,74 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "MouseHostViaInt.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define MOUSE_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Mouse compliant device */
+ #define MOUSE_PROTOCOL 0x02
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum KeyboardHostViaInt_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextMouseInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/Doxygen.conf
new file mode 100644
index 00000000..ee9bcd5f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Host Demo (Via Pipe Interrupts)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.aps b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.aps
new file mode 100644
index 00000000..adf632fc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MouseHostViaInt</ProjectName><Created>30-Sep-2008 14:15:26</Created><LastEdit>30-Sep-2008 14:15:40</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:15:26</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MouseHostViaInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>MouseHostViaInt.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>MouseHostViaInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MouseHostViaInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.c b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.c
new file mode 100644
index 00000000..c4c37785
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.c
@@ -0,0 +1,320 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MouseHostViaInt demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+ #include "MouseHostViaInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Mouse Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Mouse_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Mouse Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop mouse and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_STOP);
+
+ puts_P(PSTR("Device Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Mouse Host task */
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MouseHostViaInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to enable the pipe
+ * interrupts so that reports can be processed as they arrive from the device.
+ */
+TASK(USB_Mouse_Host)
+{
+ uint8_t ErrorCode;
+
+ /* Switch to determine what user-application handled host state the host state machine is in */
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ /* HID class request to set the mouse protocol to the Boot Protocol */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
+ bRequest: REQ_SetProtocol,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Protocol).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error status */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Mouse Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ }
+}
+
+/** Interrupt handler for the Endpoint/Pipe interrupt vector. This interrupt fires each time an enabled
+ * pipe interrupt occurs on a pipe which has had that interrupt enabled.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ USB_MouseReport_Data_t MouseReport;
+
+ /* Check to see if the mouse data pipe has caused the interrupt */
+ if (Pipe_HasPipeInterrupted(MOUSE_DATAPIPE))
+ {
+ /* Clear the pipe interrupt, and select the mouse pipe */
+ Pipe_ClearPipeInterrupt(MOUSE_DATAPIPE);
+ Pipe_SelectPipe(MOUSE_DATAPIPE);
+
+ /* Check to see if the pipe IN interrupt has fired */
+ if (USB_INT_HasOccurred(PIPE_INT_IN) && USB_INT_IsEnabled(PIPE_INT_IN))
+ {
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Clear interrupt flag */
+ USB_INT_Clear(PIPE_INT_IN);
+
+ /* Read in mouse report data */
+ Pipe_Read_Stream_LE(&MouseReport, sizeof(MouseReport));
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+
+ /* Alter status LEDs according to mouse X movement */
+ if (MouseReport.X > 0)
+ LEDMask |= LEDS_LED1;
+ else if (MouseReport.X < 0)
+ LEDMask |= LEDS_LED2;
+
+ /* Alter status LEDs according to mouse Y movement */
+ if (MouseReport.Y > 0)
+ LEDMask |= LEDS_LED3;
+ else if (MouseReport.Y < 0)
+ LEDMask |= LEDS_LED4;
+
+ /* Alter status LEDs according to mouse button position */
+ if (MouseReport.Button)
+ LEDMask = LEDS_ALL_LEDS;
+
+ LEDs_SetAllLEDs(LEDMask);
+
+ /* Print mouse report data through the serial port */
+ printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
+ MouseReport.Y,
+ MouseReport.Button);
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.h b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.h
new file mode 100644
index 00000000..c4238c80
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.h
@@ -0,0 +1,96 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MouseHostViaInt.c.
+ */
+
+#ifndef _MOUSE_HOST_VIA_INT_H_
+#define _MOUSE_HOST_VIA_INT_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+ #include <avr/interrupt.h>
+ #include <avr/wdt.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+
+ /* Macros: */
+ /** Pipe number for the mouse data IN pipe */
+ #define MOUSE_DATAPIPE 1
+
+ /** HID Class Specific request to set the report protocol mode */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for a standard Boot Protocol Mouse report */
+ typedef struct
+ {
+ uint8_t Button; /**< Button mask for currently pressed buttons in the mouse */
+ int8_t X; /**< Current delta X movement of the mouse */
+ int8_t Y; /**< Current delta Y movement on the mouse */
+ } USB_MouseReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MouseHostViaInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Mouse_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.txt b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.txt
new file mode 100644
index 00000000..72ee1dbe
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/MouseHostViaInt.txt
@@ -0,0 +1,48 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mouse Host Demo
+ *
+ * Mouse host demonstration application, using pipe interrupts. This
+ * gives a simple reference application for implementing a USB Mouse
+ * host utilizing the LUFA pipe interrupt system, for USB mice using
+ * the standard mouse HID profile.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs,
+ * as well as printed out the serial terminal as formatted dY, dY and
+ * button status information.
+ *
+ * This uses a naive method where the mouse is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * MouseHostWithParser demo application.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/makefile b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/makefile
new file mode 100644
index 00000000..65495347
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostViaInt/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MouseHostViaInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.c
new file mode 100644
index 00000000..31e1aa13
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.c
@@ -0,0 +1,171 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a HID interface descriptor containing at least one Interrupt type IN endpoint and HID descriptor.
+ *
+ * \return An error code from the MouseHostWithParser_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+ uint8_t ErrorCode;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the mouse interface from the configuration descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface)))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDInterfaceFound;
+ }
+
+ /* Get the mouse interface's HID descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))
+ {
+ /* Descriptor not found, error out */
+ return NoHIDDescriptorFound;
+ }
+
+ /* Save the HID report size for later use */
+ HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;
+
+ /* Get the mouse interface's data endpoint descriptor */
+ if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceMouseDataEndpoint)))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ /* Retrieve the endpoint address from the endpoint descriptor */
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Configure the mouse data pipe */
+ Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+
+ Pipe_SetInfiniteINRequests();
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Mouse HID Class and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextMouseInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next IN Endpoint descriptor inside the current interface descriptor,
+ * aborting the search if another interface descriptor is found before the required endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next HID descriptor within the current HID interface descriptor.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextHID)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)
+ return Descriptor_Search_Found;
+ else
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.h
new file mode 100644
index 00000000..971bdfee
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/ConfigDescriptor.h
@@ -0,0 +1,82 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "HIDReport.h"
+
+ /* Macros: */
+ /** Interface Class value for the Human Interface Device class */
+ #define MOUSE_CLASS 0x03
+
+ /** Interface Protocol value for a Boot Protocol Mouse compliant device */
+ #define MOUSE_PROTOCOL 0x02
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /** Descriptor header type constant for a HID descriptor */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type constant for a HID report descriptor */
+ #define DTYPE_Report 0x22
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum CDCHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoHIDInterfaceFound = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
+ NoHIDDescriptorFound = 5, /**< A compatible HID descriptor was not found in the device's HID interface */
+ NoEndpointFound = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextMouseInterface);
+ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint);
+ DESCRIPTOR_COMPARATOR(NextHID);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/Doxygen.conf
new file mode 100644
index 00000000..f3f45e31
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Host (Using Mouse Descriptor Parser)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.c b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.c
new file mode 100644
index 00000000..4e9bdadc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.c
@@ -0,0 +1,119 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "HIDReport.h"
+
+/** Size in bytes of the attached device's HID report descriptor */
+uint16_t HIDReportSize;
+
+/** Processed HID report descriptor items structure, containing information on each HID report element */
+HID_ReportInfo_t HIDReportInfo;
+
+
+/** Function to read in the HID report descriptor from the attached device, and process it into easy-to-read
+ * structures via the HID parser routines in the LUFA library.
+ *
+ * \return A value from the MouseHostWithParser_GetHIDReportDataCodes_t enum
+ */
+uint8_t GetHIDReportData(void)
+{
+ /* Create a buffer big enough to hold the entire returned HID report */
+ uint8_t HIDReportData[HIDReportSize];
+
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
+ bRequest: REQ_GetDescriptor,
+ wValue: (DTYPE_Report << 8),
+ wIndex: 0,
+ wLength: HIDReportSize,
+ };
+
+ /* Send control request to retrieve the HID report from the attached device */
+ if (USB_Host_SendControlRequest(HIDReportData) != HOST_SENDCONTROL_Successful)
+ return ParseControlError;
+
+ /* Send the HID report to the parser for processing */
+ if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)
+ return ParseError;
+
+ return ParseSuccessful;
+}
+
+/** Function to print out the attached device's HID descriptor elements in human readable form
+ * through the serial port. This is good for examining a device's HID descriptors, however it
+ * can cause noticible delays as there is generally a lot of data to be sent.
+ */
+void DumpHIDReportItems(void)
+{
+ /* Loop through each of the loaded HID report items in the processed item structure */
+ for (uint8_t ItemIndex = 0; ItemIndex < HIDReportInfo.TotalReportItems; ItemIndex++)
+ {
+ /* Create pointer to the current report info structure */
+ HID_ReportItem_t* RItem = &HIDReportInfo.ReportItems[ItemIndex];
+
+ /* Print out each report item's details */
+ printf_P(PSTR(" Item %d:\r\n"
+ " Type: %s\r\n"
+ " Flags: %d\r\n"
+ " BitOffset: %d\r\n"
+ " BitSize: %d\r\n"
+ " Coll Ptr: %d\r\n"
+ " Coll Usage: %d\r\n"
+ " Coll Prnt: %d\r\n"
+ " Usage Page: %d\r\n"
+ " Usage: %d\r\n"
+ " Usage Min: %d\r\n"
+ " Usage Max: %d\r\n"
+ " Unit Type: %d\r\n"
+ " Unit Exp: %d\r\n"
+ " Log Min: %d\r\n"
+ " Log Max: %d\r\n"
+ " Phy Min: %d\r\n"
+ " Phy Max: %d\r\n"), ItemIndex,
+ ((RItem->ItemType == REPORT_ITEM_TYPE_In) ? "IN" : "OUT"),
+ RItem->ItemFlags,
+ RItem->BitOffset,
+ RItem->Attributes.BitSize,
+ RItem->CollectionPath,
+ RItem->CollectionPath->Usage,
+ RItem->CollectionPath->Parent,
+ RItem->Attributes.Usage.Page,
+ RItem->Attributes.Usage.Usage,
+ RItem->Attributes.Usage.MinMax.Minimum,
+ RItem->Attributes.Usage.MinMax.Maximum,
+ RItem->Attributes.Unit.Type,
+ RItem->Attributes.Unit.Exponent,
+ RItem->Attributes.Logical.Minimum,
+ RItem->Attributes.Logical.Maximum,
+ RItem->Attributes.Physical.Minimum,
+ RItem->Attributes.Physical.Maximum);
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.h b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.h
new file mode 100644
index 00000000..9381273d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/HIDReport.h
@@ -0,0 +1,89 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for HIDReport.c.
+ */
+
+#ifndef _HID_REPORT_H_
+#define _HID_REPORT_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/Class/HIDParser.h> // HID Class Report Parser
+
+ #include "MouseHostWithParser.h"
+
+ /* Macros: */
+ /** HID Report Descriptor Usage Page value for a toggle button */
+ #define USAGE_PAGE_BUTTON 0x09
+
+ /** HID Report Descriptor Usage Page value for a Generic Desktop Control */
+ #define USAGE_PAGE_GENERIC_DCTRL 0x01
+
+ /** HID Report Descriptor Usage value for a X axis movement */
+ #define USAGE_X 0x30
+
+ /** HID Report Descriptor Usage value for a Y axis movement */
+ #define USAGE_Y 0x31
+
+ /* Enums: */
+ /** Enum for the possible return codes of the GetHIDReportData() function. */
+ enum MouseHostWithParser_GetHIDReportDataCodes_t
+ {
+ ParseSuccessful = 0, /**< HID report descriptor parsed successfully */
+ ParseError = 1, /**< Failed to fully process the HID report descriptor */
+ ParseControlError = 2, /**< Control error occured while trying to read the device HID descriptor */
+ };
+
+ /* Type Defines: */
+ /** Type define for a HID descriptor. */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
+
+ uint16_t HIDSpec; /**< Implemented HID class specification, in BCD encoded format */
+ uint8_t CountryCode; /**< Country code value for localized hardware */
+
+ uint8_t TotalHIDReports; /**< Total number of HID report descriptors in the current interface */
+
+ uint8_t HIDReportType; /**< HID report type of the first HID report descriptor */
+ uint16_t HIDReportLength; /**< Total size in bytes of the first HID report descriptor */
+ } USB_Descriptor_HID_t;
+
+ /* External Variables: */
+ extern uint16_t HIDReportSize;
+ extern HID_ReportInfo_t HIDReportInfo;
+
+ /* Function Prototypes: */
+ uint8_t GetHIDReportData(void);
+ void DumpHIDReportItems(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.aps b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.aps
new file mode 100644
index 00000000..81d82eba
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MouseHostWithParser</ProjectName><Created>30-Sep-2008 14:15:57</Created><LastEdit>30-Sep-2008 14:16:12</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:15:57</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MouseHostWithParser\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>HIDReport.c</SOURCEFILE><SOURCEFILE>MouseHostWithParser.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>HIDReport.h</HEADERFILE><HEADERFILE>MouseHostWithParser.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MouseHostWithParser.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.c b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.c
new file mode 100644
index 00000000..dde6e852
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.c
@@ -0,0 +1,352 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MouseHostWithParser demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "MouseHostWithParser.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Mouse Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Mouse_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Mouse Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop mouse and USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_STOP);
+
+ puts_P(PSTR("Device Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Start Mouse Host task */
+ Scheduler_SetTaskMode(USB_Mouse_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MouseHostWithParser_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ case Status_Busy:
+ LEDMask = (LEDS_LED1 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to read and process
+ * the HID report descriptor and HID reports from the device and display the results onto the board LEDs.
+ */
+TASK(USB_Mouse_Host)
+{
+ uint8_t ErrorCode;
+
+ /* Switch to determine what user-application handled host state the host state machine is in */
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control Error (Set Configuration).\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Processing HID Report.\r\n"));
+
+ /* LEDs one and two on to indicate busy processing */
+ UpdateStatus(Status_Busy);
+
+ /* Get and process the device's first HID report descriptor */
+ if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)
+ {
+ puts_P(PSTR("Report Parse Error.\r\n"));
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Dumping HID Report Items.\r\n"));
+
+ /* Dump the HID report items to the serial port */
+ DumpHIDReportItems();
+
+ /* All LEDs off - ready to indicate keypresses */
+ UpdateStatus(Status_USBReady);
+
+ puts_P(PSTR("Mouse Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Select and unfreeze mouse data pipe */
+ Pipe_SelectPipe(MOUSE_DATAPIPE);
+ Pipe_Unfreeze();
+
+ /* Check if data has been received from the attached mouse */
+ if (Pipe_ReadWriteAllowed())
+ {
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Create buffer big enough for the report */
+ uint8_t MouseReport[Pipe_BytesInPipe()];
+
+ /* Load in the mouse report */
+ Pipe_Read_Stream_LE(MouseReport, Pipe_BytesInPipe());
+
+ /* Check each HID report item in turn, looking for mouse X/Y/button reports */
+ for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
+ {
+ /* Create a tempoary item pointer to the next report item */
+ HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
+
+ bool FoundData;
+
+ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Get the mouse button value */
+ FoundData = GetReportItemInfo(MouseReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ /* If button is pressed, all LEDs are turned on */
+ if (ReportItem->Value)
+ LEDMask = LEDS_ALL_LEDS;
+ }
+ else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
+ ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
+ (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Get the mouse relative position value */
+ FoundData = GetReportItemInfo(MouseReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ /* Value is a signed 8-bit value, cast as appropriate */
+ int8_t DeltaMovement = (int8_t)ReportItem->Value;
+
+ /* Determine if the report is for the X or Y delta movement */
+ if (ReportItem->Attributes.Usage.Usage == USAGE_X)
+ {
+ /* Turn on the appropriate LED according to direction if the delta is non-zero */
+ if (DeltaMovement)
+ LEDMask |= ((DeltaMovement > 0) ? LEDS_LED1 : LEDS_LED2);
+ }
+ else
+ {
+ /* Turn on the appropriate LED according to direction if the delta is non-zero */
+ if (DeltaMovement)
+ LEDMask |= ((DeltaMovement > 0) ? LEDS_LED3 : LEDS_LED4);
+ }
+ }
+ }
+
+ /* Display the button information on the board LEDs */
+ LEDs_SetAllLEDs(LEDMask);
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearCurrentBank();
+ }
+
+ /* Freeze mouse data pipe */
+ Pipe_Freeze();
+ break;
+ }
+}
+
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.h b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.h
new file mode 100644
index 00000000..6d1ce32d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.h
@@ -0,0 +1,80 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#ifndef _MOUSE_HOST_H_
+#define _MOUSE_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/pgmspace.h>
+ #include <stdio.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include "ConfigDescriptor.h"
+ #include "HIDReport.h"
+
+ /* Macros: */
+ /** Pipe number for the mouse report data pipe */
+ #define MOUSE_DATAPIPE 1
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MouseHostWithParser_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ Status_Busy = 5, /**< Busy dumping HID report items to the serial port */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_Mouse_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.txt b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.txt
new file mode 100644
index 00000000..97ee8bfb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/MouseHostWithParser.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mouse Host With HID Descriptor Parser Demo
+ *
+ * Mouse host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse host, for USB mice using
+ * the standard mouse HID profile. It uses a HID parser for the HID
+ * reports, allowing for correct operation across all USB mice. This
+ * demo supports mice with a single HID report.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs.
+ * On connection to a USB mouse, the report items will be processed and
+ * printed as a formatted list through the USART before the mouse is
+ * fully enumerated.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/makefile b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/makefile
new file mode 100644
index 00000000..3f32c756
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseHostWithParser/makefile
@@ -0,0 +1,707 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MouseHostWithParser
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ HIDReport.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/Class/HIDParser.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.c
new file mode 100644
index 00000000..8f099692
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.c
@@ -0,0 +1,250 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID class report descriptor. This is a special descriptor constructed with values from the
+ * USBIF HID class specification to describe the reports and capabilities of the HID device. This
+ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
+ * the device will send, and what it may be sent back from the host. Refer to the HID specification for
+ * more details on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x02, /* Usage (Mouse) */
+ 0xA1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xA1, 0x00, /* Collection (Application) */
+ 0x95, 0x03, /* Report Count (3) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x05, 0x09, /* Usage Page (Button) */
+ 0x19, 0x01, /* Usage Minimum (Button 1) */
+ 0x29, 0x03, /* Usage Maximum (Button 3) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x05, /* Report Size (5) */
+ 0x81, 0x01, /* Input (Constant) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x95, 0x02, /* Report Count (2) */
+ 0x05, 0x01, /* Usage Page (Generic Desktop Control) */
+ 0x09, 0x30, /* Usage X */
+ 0x09, 0x31, /* Usage Y */
+ 0x15, 0x81, /* Logical Minimum (-127) */
+ 0x25, 0x7F, /* Logical Maximum (127) */
+ 0x81, 0x06, /* Input (Data, Variable, Relative) */
+ 0xC0, /* End Collection */
+ 0xC0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2041,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x02,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ MouseHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(MouseReport)
+ },
+
+ MouseEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: MOUSE_EPSIZE,
+ PollingIntervalMS: 0x02
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Mouse Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(MouseReport);
+ Size = sizeof(MouseReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.h
new file mode 100644
index 00000000..3aea3164
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Descriptors.h
@@ -0,0 +1,93 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
+ * specification for details on the structure elements.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header;
+
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
+
+ uint8_t TotalHIDReports;
+
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used to store HID report descriptor elements. */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t Interface;
+ USB_Descriptor_HID_t MouseHID;
+ USB_Descriptor_Endpoint_t MouseEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPNUM 1
+
+ /** Size in bytes of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPSIZE 8
+
+ /** Descriptor header type value, to indicate a HID class HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor header type value, to indicate a HID class HID report descriptor. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Doxygen.conf
new file mode 100644
index 00000000..3a36c211
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Mouse Device Demo (Via Endpoint Interrupts)"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.aps b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.aps
new file mode 100644
index 00000000..02f8890e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>MouseViaInt</ProjectName><Created>30-Sep-2008 14:16:28</Created><LastEdit>30-Sep-2008 14:16:44</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:16:28</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\MouseViaInt\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>MouseViaInt.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>MouseViaInt.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>MouseViaInt.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.c b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.c
new file mode 100644
index 00000000..77e4c565
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.c
@@ -0,0 +1,389 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MouseViaInt demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "MouseViaInt.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA MouseI App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Indicates what report mode the host has requested, true for normal HID reporting mode, false for special boot
+ * protocol reporting mode.
+ */
+bool UsingReportProtocol = true;
+
+/** Current Idle period. This is set by the host via a Set Idle HID class request to silence the device's reports
+ * for either the entire idle duration, or until the report status changes (e.g. the user moves the mouse).
+ */
+uint8_t IdleCount = 0;
+
+/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle
+ * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request
+ * the current idle period via a Get Idle HID class request, thus its value must be preserved.
+ */
+uint16_t IdleMSRemaining = 0;
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management task.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running mouse reporting and USB management tasks */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the mouse device endpoints.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Mouse Report Endpoint */
+ Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, MOUSE_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Enable the endpoint IN interrupt ISR for the report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_IN);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the HID commands, which are
+ * all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_MouseReport_Data_t MouseReportData;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(MouseReportData))
+ wLength = sizeof(MouseReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&MouseReportData, wLength);
+
+ /* Clear the report data afterwards */
+ memset(&MouseReportData, 0, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler elapsed idle period counter when the host has set an idle period.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+}
+
+/** Fills the given HID report data structure with the next HID report to send to the host.
+ *
+ * \param ReportData Pointer to a HID report data structure to be filled
+ *
+ * \return Boolean true if the new report differs from the last report, false otherwise
+ */
+bool GetNextReport(USB_MouseReport_Data_t* ReportData)
+{
+ static uint8_t PrevJoyStatus = 0;
+ static bool PrevHWBStatus = false;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ bool InputChanged = false;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_MouseReport_Data_t));
+
+ if (JoyStatus_LCL & JOY_UP)
+ ReportData->Y = -1;
+ else if (JoyStatus_LCL & JOY_DOWN)
+ ReportData->Y = 1;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 1;
+ else if (JoyStatus_LCL & JOY_LEFT)
+ ReportData->X = -1;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ ReportData->Button = (1 << 0);
+
+ if (HWB_GetStatus())
+ ReportData->Button |= (1 << 1);
+
+ /* Check if the new report is different to the previous report */
+ InputChanged = ((uint8_t)(PrevJoyStatus ^ JoyStatus_LCL) | (uint8_t)(HWB_GetStatus() ^ PrevHWBStatus));
+
+ /* Save the current joystick and HWB status for later comparison */
+ PrevJoyStatus = JoyStatus_LCL;
+ PrevHWBStatus = HWB_GetStatus();
+
+ /* Return whether the new report is different to the previous report or not */
+ return InputChanged;
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the MouseViaInt_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as
+ * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send
+ * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB
+ * controller.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ /* Save previously selected endpoint before selecting a new endpoint */
+ uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();
+
+ /* Check if mouse endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(MOUSE_EPNUM))
+ {
+ USB_MouseReport_Data_t MouseReportData;
+ bool SendReport = true;
+
+ /* Create the next mouse report for transmission to the host */
+ GetNextReport(&MouseReportData);
+
+ /* Check if the idle period is set*/
+ if (IdleCount)
+ {
+ /* Determine if the idle period has elapsed */
+ if (!(IdleMSRemaining))
+ {
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+ else
+ {
+ /* Idle period not elapsed, indicate that a report must not be sent */
+ SendReport = false;
+ }
+ }
+
+ /* Check to see if a report should be issued */
+ if (SendReport)
+ {
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
+
+ /* Write Mouse Report Data */
+ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
+ }
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Restore previously selected endpoint */
+ Endpoint_SelectEndpoint(PrevSelectedEndpoint);
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.h b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.h
new file mode 100644
index 00000000..6f4b9abe
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.h
@@ -0,0 +1,111 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for MouseViaInt.c.
+ */
+
+#ifndef _MOUSE_H_
+#define _MOUSE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+
+ /* Macros: */
+ /** HID Class specific request to get the next HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class specific request to get the idle timeout period of the device. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class specific request to send the next HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class specific request to set the idle timeout period of the device. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class specific request to get the current HID protocol in use, either report or boot. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class specific request to set the current HID protocol in use, either report or boot. */
+ #define REQ_SetProtocol 0x0B
+
+ /* Type Defines: */
+ /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.
+ * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
+ */
+ typedef struct
+ {
+ uint8_t Button; /**< Bit mask of the currently pressed mouse buttons */
+ int8_t X; /**< Current mouse delta X movement, as a signed 8-bit integer */
+ int8_t Y; /**< Current mouse delta Y movement, as a signed 8-bit integer */
+ } USB_MouseReport_Data_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum MouseViaInt_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_MouseReport_Data_t* ReportData);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.txt b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.txt
new file mode 100644
index 00000000..f42c2b33
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/MouseViaInt.txt
@@ -0,0 +1,44 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Partially Interrupt Driven Mouse Device Demo
+ *
+ * Mouse demonstration application, using endpoint interrupts for the
+ * exchange of data to the USB host. This gives a simple reference
+ * application for implementing a USB Mouse using the basic USB HID
+ * drivers in all modern OSes (i.e. no special drivers required). It is
+ * boot protocol compatible, and thus works under compatible BIOS as if
+ * it was a native mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a mouse when the USB connection to a host is present. To use
+ * the mouse, move the joystick to move the pointer, and push the
+ * joystick inwards to simulate a left-button click. The HWB serves as
+ * the right mouse button.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/MouseViaInt/makefile b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/makefile
new file mode 100644
index 00000000..1a835161
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/MouseViaInt/makefile
@@ -0,0 +1,703 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = MouseViaInt
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+#CFLAGS += -mshort-calls
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.c
new file mode 100644
index 00000000..3560403f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.c
@@ -0,0 +1,85 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Address Resolution Protocol (ARP) packet handling routines. This protocol handles the
+ * conversion of physical MAC addresses to protocol IP addresses between the host and the
+ * device.
+ */
+
+#include "ARP.h"
+
+/** Processes an ARP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if the host is requesting the IP or MAC address of the
+ * virtual server device on the network.
+ *
+ * \param InDataStart Pointer to the start of the incomming packet's ARP header
+ * \param OutDataStart Pointer to the start of the outgoing packet's ARP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
+ */
+int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart)
+{
+ DecodeARPHeader(InDataStart);
+
+ ARP_Header_t* ARPHeaderIN = (ARP_Header_t*)InDataStart;
+ ARP_Header_t* ARPHeaderOUT = (ARP_Header_t*)OutDataStart;
+
+ /* Ensure that the ARP request is a IPv4 request packet */
+ if ((SwapEndian_16(ARPHeaderIN->ProtocolType) == ETHERTYPE_IPV4) &&
+ (SwapEndian_16(ARPHeaderIN->Operation) == ARP_OPERATION_REQUEST))
+ {
+ /* If the ARP packet is requesting the MAC or IP of the virtual webserver, return the response */
+ if (IP_COMPARE(&ARPHeaderIN->TPA, &ServerIPAddress) ||
+ MAC_COMPARE(&ARPHeaderIN->THA, &ServerMACAddress))
+ {
+ /* Fill out the ARP response header */
+ ARPHeaderOUT->HardwareType = ARPHeaderIN->HardwareType;
+ ARPHeaderOUT->ProtocolType = ARPHeaderIN->ProtocolType;
+ ARPHeaderOUT->HLEN = ARPHeaderIN->HLEN;
+ ARPHeaderOUT->PLEN = ARPHeaderIN->PLEN;
+ ARPHeaderOUT->Operation = SwapEndian_16(ARP_OPERATION_REPLY);
+
+ /* Copy over the sender MAC/IP to the target fields for the response */
+ ARPHeaderOUT->THA = ARPHeaderIN->SHA;
+ ARPHeaderOUT->TPA = ARPHeaderIN->SPA;
+
+ /* Copy over the new sender MAC/IP - MAC and IP addresses of the virtual webserver */
+ ARPHeaderOUT->SHA = ServerMACAddress;
+ ARPHeaderOUT->SPA = ServerIPAddress;
+
+ /* Return the size of the response so far */
+ return sizeof(ARP_Header_t);
+ }
+ }
+
+ return NO_RESPONSE;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.h
new file mode 100644
index 00000000..8551df85
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ARP.h
@@ -0,0 +1,76 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ARP.c.
+ */
+
+#ifndef _ARP_H_
+#define _ARP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <string.h>
+
+ #include <LUFA/Scheduler/Scheduler.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** ARP header operation constant, indicating a request from a host for an address translation */
+ #define ARP_OPERATION_REQUEST 1
+
+ /** ARP header operation constant, indicating a reply from a host giving an address translation */
+ #define ARP_OPERATION_REPLY 2
+
+ /* Type Defines: */
+ /** Type define for an ARP packet inside an Ethernet frame. */
+ typedef struct
+ {
+ uint16_t HardwareType; /**< Hardware type constant, indicating the hardware used */
+ uint16_t ProtocolType; /**< Protocol being resolved, usually ETHERTYPE_IPV4 */
+
+ uint8_t HLEN; /**< Length in bytes of the source/destination hardware addresses */
+ uint8_t PLEN; /**< Length in bytes of the source/destination protocol addresses */
+ uint16_t Operation; /**< Type of operation, either ARP_OPERATION_REQUEST or ARP_OPERATION_REPLY */
+
+ MAC_Address_t SHA; /**< Sender's hardware address */
+ IP_Address_t SPA; /**< Sender's protocol address */
+ MAC_Address_t THA; /**< Target's hardware address */
+ IP_Address_t TPA; /**< Target's protocol address */
+ } ARP_Header_t;
+
+ /* Function Prototypes: */
+ int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.c
new file mode 100644
index 00000000..7f220c42
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.c
@@ -0,0 +1,118 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Dynamic Host Configuration Protocol (DHCP) packet handling routines. This protocol
+ * handles the automatic IP negotiation to the host, so that the host will use the provided
+ * IP address given to it by the device.
+ */
+
+#include "DHCP.h"
+
+/** Processes a DHCP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if the host is requesting or accepting an IP address.
+ *
+ * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
+ * \param DHCPHeaderInStart Pointer to the start of the incomming packet's DHCP header
+ * \param DHCPHeaderOutStart Pointer to the start of the outgoing packet's DHCP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
+ */
+int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart)
+{
+ IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
+ DHCP_Header_t* DHCPHeaderIN = (DHCP_Header_t*)DHCPHeaderInStart;
+ DHCP_Header_t* DHCPHeaderOUT = (DHCP_Header_t*)DHCPHeaderOutStart;
+
+ uint8_t* DHCPOptionsINStart = (uint8_t*)(DHCPHeaderInStart + sizeof(DHCP_Header_t));
+ uint8_t* DHCPOptionsOUTStart = (uint8_t*)(DHCPHeaderOutStart + sizeof(DHCP_Header_t));
+
+ DecodeDHCPHeader(DHCPHeaderInStart);
+
+ /* Zero out the response DHCP packet, as much of it legacy and left at 0 */
+ memset(DHCPHeaderOUT, 0, sizeof(DHCP_Header_t));
+
+ /* Fill out the response DHCP packet */
+ DHCPHeaderOUT->HardwareType = DHCPHeaderIN->HardwareType;
+ DHCPHeaderOUT->Operation = DHCP_OP_BOOTREPLY;
+ DHCPHeaderOUT->HardwareAddressLength = DHCPHeaderIN->HardwareAddressLength;
+ DHCPHeaderOUT->Hops = 0;
+ DHCPHeaderOUT->TransactionID = DHCPHeaderIN->TransactionID;
+ DHCPHeaderOUT->ElapsedSeconds = 0;
+ DHCPHeaderOUT->Flags = DHCPHeaderIN->Flags;
+ DHCPHeaderOUT->YourIP = ClientIPAddress;
+ memcpy(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t));
+ DHCPHeaderOUT->Cookie = SwapEndian_32(DHCP_MAGIC_COOKIE);
+
+ /* Alter the incomming IP packet header so that the corrected IP source and destinations are used - this means that
+ when the response IP header is generated, it will use the corrected addresses and not the null/broatcast addresses */
+ IPHeaderIN->SourceAddress = ClientIPAddress;
+ IPHeaderIN->DestinationAddress = ServerIPAddress;
+
+ /* Process the incomming DHCP packet options */
+ while (DHCPOptionsINStart[0] != DHCP_OPTION_END)
+ {
+ /* Find the Message Type DHCP option, to determine the type of DHCP packet */
+ if (DHCPOptionsINStart[0] == DHCP_OPTION_MESSAGETYPE)
+ {
+ if ((DHCPOptionsINStart[2] == DHCP_MESSAGETYPE_DISCOVER) || (DHCPOptionsINStart[2] == DHCP_MESSAGETYPE_REQUEST))
+ {
+ /* Fill out the response DHCP packet options for a DHCP OFFER or ACK response */
+
+ *(DHCPOptionsOUTStart++) = DHCP_OPTION_MESSAGETYPE;
+ *(DHCPOptionsOUTStart++) = 1;
+ *(DHCPOptionsOUTStart++) = (DHCPOptionsINStart[2] == DHCP_MESSAGETYPE_DISCOVER) ? DHCP_MESSAGETYPE_OFFER
+ : DHCP_MESSAGETYPE_ACK;
+
+ *(DHCPOptionsOUTStart++) = DHCP_OPTION_SUBNETMASK;
+ *(DHCPOptionsOUTStart++) = 4;
+ *(DHCPOptionsOUTStart++) = 0xFF;
+ *(DHCPOptionsOUTStart++) = 0xFF;
+ *(DHCPOptionsOUTStart++) = 0xFF;
+ *(DHCPOptionsOUTStart++) = 0x00;
+
+ *(DHCPOptionsOUTStart++) = DHCP_OPTION_DHCPSERVER;
+ *(DHCPOptionsOUTStart++) = sizeof(IP_Address_t);
+ memcpy(DHCPOptionsOUTStart, &ServerIPAddress, sizeof(IP_Address_t));
+ DHCPOptionsOUTStart += sizeof(IP_Address_t);
+
+ *(DHCPOptionsOUTStart++) = DHCP_OPTION_END;
+
+ return (sizeof(DHCP_Header_t) + 12 + sizeof(IP_Address_t));
+ }
+ }
+
+ /* Go to the next DHCP option - skip one byte if option is a padding byte, else skip the complete option's size */
+ DHCPOptionsINStart += ((DHCPOptionsINStart[0] == DHCP_OPTION_PAD) ? 1 : (DHCPOptionsINStart[1] + 2));
+ }
+
+ return NO_RESPONSE;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.h
new file mode 100644
index 00000000..f1e14e19
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/DHCP.h
@@ -0,0 +1,125 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for DHCP.c.
+ */
+
+#ifndef _DHCP_H_
+#define _DHCP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <string.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** DHCP operation constant, indicating a request from a host to a DHCP server */
+ #define DHCP_OP_BOOTREQUEST 0x01
+
+ /** DHCP operation constant, indicating a reply from a DHCP server to a host */
+ #define DHCP_OP_BOOTREPLY 0x02
+
+ /** Hardware type constant, indicating Ethernet as a carrier */
+ #define DHCP_HTYPE_ETHERNET 0x01
+
+ /** Magic boot protocol "cookie", inserted into all BOOTP packets (BOOTP is the carrier of DHCP) */
+ #define DHCP_MAGIC_COOKIE 0x63825363
+
+ /** DHCP option list entry header, indicating that a subnet mask will follow */
+ #define DHCP_OPTION_SUBNETMASK 1
+
+ /** DHCP option list entry header, indicating that the DHCP message type constant will follow */
+ #define DHCP_OPTION_MESSAGETYPE 53
+
+ /** DHCP option list entry header, indicating that the IP address of the DHCP server will follow */
+ #define DHCP_OPTION_DHCPSERVER 54
+
+ /** DHCP option list entry header, used to pad out option data */
+ #define DHCP_OPTION_PAD 0
+
+ /** DHCP option list entry header, indicating the end of option data */
+ #define DHCP_OPTION_END 255
+
+ /** Message type constant, used in the DHCP option data field, requesting that a DHCP server offer an IP address */
+ #define DHCP_MESSAGETYPE_DISCOVER 1
+
+ /** Message type constant, used in the DHCP option data field, indicating that a DHCP server is offering an IP address */
+ #define DHCP_MESSAGETYPE_OFFER 2
+
+ /** Message type constant, used in the DHCP option data field, requesting that a DHCP server lease a given IP address */
+ #define DHCP_MESSAGETYPE_REQUEST 3
+
+ /** Message type constant, used in the DHCP option data field, declining an offered DHCP server IP address lease */
+ #define DHCP_MESSAGETYPE_DECLINE 4
+
+ /** Message type constant, used in the DHCP option data field, ACKing a host IP lease request */
+ #define DHCP_MESSAGETYPE_ACK 5
+
+ /** Message type constant, used in the DHCP option data field, NACKing a host IP lease request */
+ #define DHCP_MESSAGETYPE_NACK 6
+
+ /** Message type constant, used in the DHCP option data field, indicating that a host is releasing a leased IP address */
+ #define DHCP_MESSAGETYPE_RELEASE 7
+
+ /* Type Defines: */
+ /** Type define for a DHCP packet inside an Ethernet frame. */
+ typedef struct
+ {
+ uint8_t Operation; /**< DHCP operation, either DHCP_OP_BOOTREQUEST or DHCP_OP_BOOTREPLY */
+ uint8_t HardwareType; /**< Hardware carrier type constant */
+ uint8_t HardwareAddressLength; /**< Length in bytes of a hardware (MAC) address on the network */
+ uint8_t Hops; /**< Number of hops required to reach the server, unused */
+
+ uint32_t TransactionID; /**< Unique ID of the DHCP packet, for postive matching between sent and recieved packets */
+
+ uint16_t ElapsedSeconds; /**< Elapsed seconds since the request was made */
+ uint16_t Flags; /**< BOOTP packet flags */
+
+ IP_Address_t ClientIP; /**< Client IP address, if already leased an IP */
+ IP_Address_t YourIP; /**< Client IP address */
+ IP_Address_t NextServerIP; /**< Legacy BOOTP protocol field, unused for DHCP */
+ IP_Address_t RelayAgentIP; /**< Legacy BOOTP protocol field, unused for DHCP */
+
+ uint8_t ClientHardwareAddress[16]; /**< Hardware (MAC) address of the client making a request to the DHCP server */
+ uint8_t ServerHostnameString[64]; /**< Legacy BOOTP protocol field, unused for DHCP */
+ uint8_t BootFileName[128]; /**< Legacy BOOTP protocol field, unused for DHCP */
+
+ uint32_t Cookie; /**< Magic BOOTP protocol cookie to indicate a valid packet */
+ } DHCP_Header_t;
+
+ /* Function Prototypes: */
+ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.c
new file mode 100644
index 00000000..1994c601
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.c
@@ -0,0 +1,263 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x02,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x204C,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0xFF,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC_Functional_Header:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x00, 0x00}
+ },
+
+ CDC_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x00}
+ },
+
+ CDC_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+
+ DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA RNDIS CDC Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.h
new file mode 100644
index 00000000..070c118d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
+ * uniform structure but variable sized data payloads, thus cannot be represented accurately by
+ * a single typedef struct. A macro is used instead so that functional descriptors can be created
+ * easily by specifying the size of the payload. This allows sizeof() to work correctly.
+ *
+ * \param DataSize Size in bytes of the CDC functional descriptor's data payload
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPNUM 3
+
+ /** Endpoint number of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPNUM 1
+
+ /** Endpoint number of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPNUM 2
+
+ /** Size in bytes of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Size in bytes of the CDC data IN and OUT endpoints. */
+ #define CDC_TXRX_EPSIZE 64
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Header;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t ManagementEndpoint;
+ USB_Descriptor_Interface_t DCI_Interface;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Doxygen.conf
new file mode 100644
index 00000000..9d7973b7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - RNDIS Ethernet Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.c
new file mode 100644
index 00000000..b8d56150
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.c
@@ -0,0 +1,136 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Ethernet frame packet handling routines. This protocol handles the processing of raw Ethernet
+ * frames sent and receieved, deferring the processing of subpacket protocols to the appropriate
+ * protocol handlers, such as DHCP or ARP.
+ */
+
+#include "Ethernet.h"
+
+/* Global Variables: */
+/** Ethernet Frame buffer structure, to hold the incomming Ethernet frame from the host. */
+Ethernet_Frame_Info_t FrameIN;
+
+/** Ethernet Frame buffer structure, to hold the outgoing Ethernet frame to the host. */
+Ethernet_Frame_Info_t FrameOUT;
+
+/** Constant for convenience when checking against or setting a MAC address to the virtual server MAC address. */
+const MAC_Address_t ServerMACAddress = {SERVER_MAC_ADDRESS};
+
+/** Constant for convenience when checking against or setting an IP address to the virtual server IP address. */
+const IP_Address_t ServerIPAddress = {SERVER_IP_ADDRESS};
+
+/** Constant for convenience when checking against or setting a MAC address to the broadcast MAC address. */
+const MAC_Address_t BroadcastMACAddress = {BROADCAST_MAC_ADDRESS};
+
+/** Constant for convenience when checking against or setting a IP address to the broadcast IP address. */
+const IP_Address_t BroadcastIPAddress = {BROADCAST_IP_ADDRESS};
+
+/** Constant for convenience when checking against or setting an IP address to the client (host) IP address. */
+const IP_Address_t ClientIPAddress = {CLIENT_IP_ADDRESS};
+
+
+/** Processes an incomming Ethernet frame, and writes the appropriate response to the output Ethernet
+ * frame buffer if the sub protocol handlers create a valid response.
+ */
+void Ethernet_ProcessPacket(void)
+{
+ DecodeEthernetFrameHeader(FrameIN.FrameData);
+
+ /* Cast the incomming Ethernet frame to the Ethernet header type */
+ Ethernet_Frame_Header_t* FrameINHeader = (Ethernet_Frame_Header_t*)&FrameIN.FrameData;
+ Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData;
+
+ int16_t RetSize = NO_RESPONSE;
+
+ /* Ensure frame is addressed to either all (broadcast) or the virtual webserver, and is a type II frame */
+ if ((MAC_COMPARE(&FrameINHeader->Destination, &ServerMACAddress) ||
+ MAC_COMPARE(&FrameINHeader->Destination, &BroadcastMACAddress)) &&
+ (SwapEndian_16(FrameIN.FrameLength) > ETHERNET_VER2_MINSIZE))
+ {
+ /* Process the packet depending on its protocol */
+ switch (SwapEndian_16(FrameINHeader->EtherType))
+ {
+ case ETHERTYPE_ARP:
+ RetSize = ARP_ProcessARPPacket(&FrameIN.FrameData[sizeof(Ethernet_Frame_Header_t)],
+ &FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)]);
+ break;
+ case ETHERTYPE_IPV4:
+ RetSize = IP_ProcessIPPacket(&FrameIN.FrameData[sizeof(Ethernet_Frame_Header_t)],
+ &FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)]);
+ break;
+ }
+
+ /* Protcol processing routine has filled a response, complete the ethernet frame header */
+ if (RetSize > 0)
+ {
+ /* Fill out the response Ethernet frame header */
+ FrameOUTHeader->Source = ServerMACAddress;
+ FrameOUTHeader->Destination = FrameINHeader->Source;
+ FrameOUTHeader->EtherType = FrameINHeader->EtherType;
+
+ /* Set the response length in the buffer and indicate that a response is ready to be sent */
+ FrameOUT.FrameLength = (sizeof(Ethernet_Frame_Header_t) + RetSize);
+ FrameOUT.FrameInBuffer = true;
+ }
+ }
+
+ /* Check if the packet was processed */
+ if (RetSize != NO_PROCESS)
+ {
+ /* Clear the frame buffer */
+ FrameIN.FrameInBuffer = false;
+ }
+}
+
+/** Calculates the appropriate ethernet checksum, consisting of the addition of the one's
+ * compliment of each word, complimented.
+ *
+ * \param Data Pointer to the packet buffer data whose checksum must be calculated
+ * \param Bytes Number of bytes in the data buffer to process
+ *
+ * \return A 16-bit Ethernet checksum value
+ */
+uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes)
+{
+ uint16_t* Words = (uint16_t*)Data;
+ uint32_t Checksum = 0;
+
+ for (uint8_t CurrWord = 0; CurrWord < (Bytes >> 1); CurrWord++)
+ Checksum += Words[CurrWord];
+
+ while (Checksum & 0xFFFF0000)
+ Checksum = ((Checksum & 0xFFFF) + (Checksum >> 16));
+
+ return ~Checksum;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.h
new file mode 100644
index 00000000..23fc325a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Ethernet.h
@@ -0,0 +1,116 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Ethernet.c.
+ */
+
+#ifndef _ETHERNET_H_
+#define _ETHERNET_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <string.h>
+
+ #include "EthernetProtocols.h"
+ #include "ProtocolDecoders.h"
+ #include "ICMP.h"
+ #include "TCP.h"
+ #include "UDP.h"
+ #include "DHCP.h"
+ #include "ARP.h"
+ #include "IP.h"
+
+ /* Macros: */
+ /** Physical MAC address of the virtual server on the network */
+ #define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01}
+
+ /** Physical MAC address of the network broadcast address */
+ #define BROADCAST_MAC_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
+
+ /** Performs a comparison between two MAC addresses, indicating if they are identical.
+ *
+ * \param MAC1 First MAC address
+ * \param MAC2 Second MAC address
+ *
+ * \return True if the addresses match, false otherwise
+ */
+ #define MAC_COMPARE(MAC1, MAC2) (memcmp(MAC1, MAC2, sizeof(MAC_Address_t)) == 0)
+
+ /** Maximum size of an incomming or outgoing Ethernet frame in bytes */
+ #define ETHERNET_FRAME_SIZE_MAX 1500
+
+ /** Minimum size of an Ethernet packet in bytes, to conform to the Ethernet V2 packet standard */
+ #define ETHERNET_VER2_MINSIZE 0x0600
+
+ /** Return value for all sub protocol handling routines, indicating that no response packet has been generated */
+ #define NO_RESPONSE 0
+
+ /** Return value for all sub protocol handling routines, indicating that the packet has not yet been handled */
+ #define NO_PROCESS -1
+
+ /* Type Defines: */
+ /** Type define for an Ethernet frame buffer. */
+ typedef struct
+ {
+ uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */
+ uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer */
+ bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */
+ } Ethernet_Frame_Info_t;
+
+ /** Type define for an Ethernet frame header */
+ typedef struct
+ {
+ MAC_Address_t Destination; /**< Physical MAC address of the packet recipient */
+ MAC_Address_t Source; /**< Physics MAC address of the packet source */
+
+ union
+ {
+ uint16_t EtherType; /**< Ethernet packet subprotocol type, for Ethernet V2 packets */
+ uint16_t Length; /**< Ethernet frame length, for Ethernet V1 packets */
+ };
+ } Ethernet_Frame_Header_t;
+
+ /* External Variables: */
+ extern Ethernet_Frame_Info_t FrameIN;
+ extern Ethernet_Frame_Info_t FrameOUT;
+
+ extern const MAC_Address_t ServerMACAddress;
+ extern const IP_Address_t ServerIPAddress;
+ extern const MAC_Address_t BroadcastMACAddress;
+ extern const IP_Address_t BroadcastIPAddress;
+ extern const IP_Address_t ClientIPAddress;
+
+ /* Function Prototypes: */
+ void Ethernet_ProcessPacket(void);
+ uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/EthernetProtocols.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/EthernetProtocols.h
new file mode 100644
index 00000000..3ff3433a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/EthernetProtocols.h
@@ -0,0 +1,87 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * General Ethernet protocol constants and type defines, for use by
+ * all network protocol portions of the TCP/IP stack.
+ */
+
+#ifndef _ETHERNET_PROTOCOLS_H_
+#define _ETHERNET_PROTOCOLS_H_
+
+ /* Macros: */
+ #define ETHERTYPE_IPV4 0x0800
+ #define ETHERTYPE_ARP 0x0806
+ #define ETHERTYPE_RARP 0x8035
+ #define ETHERTYPE_APPLETALK 0x809b
+ #define ETHERTYPE_APPLETALKARP 0x80f3
+ #define ETHERTYPE_IEEE8021Q 0x8100
+ #define ETHERTYPE_NOVELLIPX 0x8137
+ #define ETHERTYPE_NOVELL 0x8138
+ #define ETHERTYPE_IPV6 0x86DD
+ #define ETHERTYPE_COBRANET 0x8819
+ #define ETHERTYPE_PROVIDERBRIDGING 0x88a8
+ #define ETHERTYPE_MPLSUNICAST 0x8847
+ #define ETHERTYPE_MPLSMULTICAST 0x8848
+ #define ETHERTYPE_PPPoEDISCOVERY 0x8863
+ #define ETHERTYPE_PPPoESESSION 0x8864
+ #define ETHERTYPE_EAPOVERLAN 0x888E
+ #define ETHERTYPE_HYPERSCSI 0x889A
+ #define ETHERTYPE_ATAOVERETHERNET 0x88A2
+ #define ETHERTYPE_ETHERCAT 0x88A4
+ #define ETHERTYPE_SERCOSIII 0x88CD
+ #define ETHERTYPE_CESoE 0x88D8
+ #define ETHERTYPE_MACSECURITY 0x88E5
+ #define ETHERTYPE_FIBRECHANNEL 0x8906
+ #define ETHERTYPE_QINQ 0x9100
+ #define ETHERTYPE_VLLT 0xCAFE
+
+ #define PROTOCOL_ICMP 1
+ #define PROTOCOL_IGMP 2
+ #define PROTOCOL_TCP 6
+ #define PROTOCOL_UDP 17
+ #define PROTOCOL_OSPF 89
+ #define PROTOCOL_SCTP 132
+
+ /* Type Defines: */
+ /** Type define for a physical MAC address of a device on a network */
+ typedef struct
+ {
+ uint8_t Octets[6]; /**< Individual bytes of a MAC address */
+ } MAC_Address_t;
+
+ /** Type define for a protocol IP address of a device on a network */
+ typedef struct
+ {
+ uint8_t Octets[4]; /**< Individual bytes of an IP address */
+ } IP_Address_t;
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.c
new file mode 100644
index 00000000..a1556405
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.c
@@ -0,0 +1,79 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Internet Control Message Protocol (ICMP) packet handling routines. This protocol handles
+ * Echo requests from the host, to indicate a successful network connection between the host
+ * and the virtual server.
+ */
+
+#include "ICMP.h"
+
+/** Processes an ICMP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if the host is issuing a ICMP ECHO request.
+ *
+ * \param InDataStart Pointer to the start of the incomming packet's ICMP header
+ * \param OutDataStart Pointer to the start of the outgoing packet's ICMP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
+ */
+int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart)
+{
+ ICMP_Header_t* ICMPHeaderIN = (ICMP_Header_t*)InDataStart;
+ ICMP_Header_t* ICMPHeaderOUT = (ICMP_Header_t*)OutDataStart;
+
+ DecodeICMPHeader(InDataStart);
+
+ /* Determine if the ICMP packet is an echo request (ping) */
+ if (ICMPHeaderIN->Type == ICMP_TYPE_ECHOREQUEST)
+ {
+ /* Fill out the ICMP response packet */
+ ICMPHeaderOUT->Type = ICMP_TYPE_ECHOREPLY;
+ ICMPHeaderOUT->Code = 0;
+ ICMPHeaderOUT->Checksum = 0;
+ ICMPHeaderOUT->Id = ICMPHeaderIN->Id;
+ ICMPHeaderOUT->Sequence = ICMPHeaderIN->Sequence;
+
+ uint16_t DataSize = FrameIN.FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN.FrameData));
+
+ /* Copy the remaining payload to the response - echo requests should echo back any sent data */
+ memcpy(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)],
+ &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)],
+ DataSize);
+
+ ICMPHeaderOUT->Checksum = Ethernet_Checksum16(ICMPHeaderOUT, (DataSize + sizeof(ICMP_Header_t)));
+
+ /* Return the size of the response so far */
+ return (DataSize + sizeof(ICMP_Header_t));
+ }
+
+ return NO_RESPONSE;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.h
new file mode 100644
index 00000000..b20a557e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ICMP.h
@@ -0,0 +1,80 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ICMP.c.
+ */
+
+#ifndef _ICMP_H_
+#define _ICMP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <string.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** ICMP message type constant, indicating an ICMP ECHO Reply message */
+ #define ICMP_TYPE_ECHOREPLY 0
+
+ /** ICMP message type constant, indicating a packet destination is unreachable */
+ #define ICMP_TYPE_DESTINATIONUNREACHABLE 3
+
+ /** ICMP message type constant, indicating an ICMP Source Quench message */
+ #define ICMP_TYPE_SOURCEQUENCH 4
+
+ /** ICMP message type constant, indicating an ICMP Redirect message */
+ #define ICMP_TYPE_REDIRECTMESSAGE 5
+
+ /** ICMP message type constant, indicating an ICMP ECHO Request message */
+ #define ICMP_TYPE_ECHOREQUEST 8
+
+ /** ICMP message type constant, indicating an ICMP Time Exceeded message */
+ #define ICMP_TYPE_TIMEEXCEEDED 11
+
+ /* Type Defines: */
+ /** Type define for an ICMP message header. */
+ typedef struct
+ {
+ uint8_t Type; /**< ICMP message type, a ICMP_TYPE_* constant */
+ uint8_t Code; /**< ICMP message code, indicating the message value */
+ uint16_t Checksum; /**< Ethernet checksum of the ICMP message */
+ uint16_t Id; /**< Id of the ICMP message */
+ uint16_t Sequence; /**< Sequence number of the ICMP message, to link together message responses */
+ } ICMP_Header_t;
+
+ /* Function Prototypes: */
+ int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.c
new file mode 100644
index 00000000..65875bb0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.c
@@ -0,0 +1,111 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Internet Protocol (IP) packet handling routines. This protocol handles IP packets from the
+ * host which typically encapsulate other protocols such as ICMP, UDP and TCP.
+ */
+
+#include "IP.h"
+
+/** Processes an IP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if one is created by a subprotocol handler.
+ *
+ * \param InDataStart Pointer to the start of the incomming packet's IP header
+ * \param OutDataStart Pointer to the start of the outgoing packet's IP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no
+ * response was generated, NO_PROCESS if the packet processing was deferred until the
+ * next Ethernet packet handler iteration
+ */
+int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart)
+{
+ DecodeIPHeader(InDataStart);
+
+ IP_Header_t* IPHeaderIN = (IP_Header_t*)InDataStart;
+ IP_Header_t* IPHeaderOUT = (IP_Header_t*)OutDataStart;
+
+ /* Header length is specified in number of longs in the packet header, convert to bytes */
+ uint16_t HeaderLengthBytes = (IPHeaderIN->HeaderLength * sizeof(uint32_t));
+
+ int16_t RetSize = NO_RESPONSE;
+
+ /* Check to ensure the IP packet is addressed to the virtual webserver's IP or the broadcast IP address */
+ if (!(IP_COMPARE(&IPHeaderIN->DestinationAddress, &ServerIPAddress)) &&
+ !(IP_COMPARE(&IPHeaderIN->DestinationAddress, &BroadcastIPAddress)))
+ {
+ return NO_RESPONSE;
+ }
+
+ /* Pass off the IP payload to the appropriate protocol processing routine */
+ switch (IPHeaderIN->Protocol)
+ {
+ case PROTOCOL_ICMP:
+ RetSize = ICMP_ProcessICMPPacket(&((uint8_t*)InDataStart)[HeaderLengthBytes],
+ &((uint8_t*)OutDataStart)[sizeof(IP_Header_t)]);
+ break;
+ case PROTOCOL_TCP:
+ RetSize = TCP_ProcessTCPPacket(InDataStart,
+ &((uint8_t*)InDataStart)[HeaderLengthBytes],
+ &((uint8_t*)OutDataStart)[sizeof(IP_Header_t)]);
+ break;
+ case PROTOCOL_UDP:
+ RetSize = UDP_ProcessUDPPacket(InDataStart,
+ &((uint8_t*)InDataStart)[HeaderLengthBytes],
+ &((uint8_t*)OutDataStart)[sizeof(IP_Header_t)]);
+ break;
+ }
+
+ /* Check to see if the protocol processing routine has filled out a response */
+ if (RetSize > 0)
+ {
+ /* Fill out the response IP packet header */
+ IPHeaderOUT->TotalLength = SwapEndian_16(sizeof(IP_Header_t) + RetSize);
+ IPHeaderOUT->TypeOfService = 0;
+ IPHeaderOUT->HeaderLength = (sizeof(IP_Header_t) / sizeof(uint32_t));
+ IPHeaderOUT->Version = 4;
+ IPHeaderOUT->Flags = 0;
+ IPHeaderOUT->FragmentOffset = 0;
+ IPHeaderOUT->Identification = 0;
+ IPHeaderOUT->HeaderChecksum = 0;
+ IPHeaderOUT->Protocol = IPHeaderIN->Protocol;
+ IPHeaderOUT->TTL = DEFAULT_TTL;
+ IPHeaderOUT->SourceAddress = IPHeaderIN->DestinationAddress;
+ IPHeaderOUT->DestinationAddress = IPHeaderIN->SourceAddress;
+
+ IPHeaderOUT->HeaderChecksum = Ethernet_Checksum16(IPHeaderOUT, sizeof(IP_Header_t));
+
+ /* Return the size of the response so far */
+ return (sizeof(IP_Header_t) + RetSize);
+ }
+
+ return RetSize;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.h
new file mode 100644
index 00000000..119d219e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/IP.h
@@ -0,0 +1,93 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for IP.c.
+ */
+
+#ifndef _IP_H_
+#define _IP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <string.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** Protocol IP address of the host (client) machine, once assigned by DHCP */
+ #define CLIENT_IP_ADDRESS { 10, 0, 0, 1}
+
+ /** Protocol IP address of the virtual server machine */
+ #define SERVER_IP_ADDRESS { 10, 0, 0, 2}
+
+ /** Protocol IP address of the broadcase address */
+ #define BROADCAST_IP_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF}
+
+ /** Default Time To Live (TTL) value for sent packets, indicating the maximum allowable hops until their destination is reached */
+ #define DEFAULT_TTL 128
+
+ /** Performs a comparison between two IP addresses, indicating if they are identical.
+ *
+ * \param IP1 First IP address
+ * \param IP2 Second IP address
+ *
+ * \return True if the addresses match, false otherwise
+ */
+ #define IP_COMPARE(IP1, IP2) (memcmp(IP1, IP2, sizeof(IP_Address_t)) == 0)
+
+ /* Type Defines: */
+ /** Type define of an IP packet header. */
+ typedef struct
+ {
+ unsigned int HeaderLength : 4; /**< Total length of the packet header, in 4-byte blocks */
+ unsigned int Version : 4; /**< IP protocol version */
+ unsigned int TypeOfService : 8; /**< Special service type identifier, indicating delay/throughput/reliability levels */
+ unsigned int TotalLength : 16; /**< Total length of the IP packet, in bytes */
+
+ unsigned int Identification : 16; /**< Idenfication value for identifying fragmented packets */
+ unsigned int FragmentOffset : 13; /**< Offset of this IP fragment */
+ unsigned int Flags : 3; /**< Fragment flags, to indicate if a packet is fragmented */
+
+ unsigned int TTL : 8; /**< Maximum allowable number of hops to reach the packet destination */
+ unsigned int Protocol : 8; /**< Encapsulated protocol type */
+ unsigned int HeaderChecksum : 16; /**< Ethernet checksum of the IP header */
+
+ IP_Address_t SourceAddress; /**< Source protocol IP address of the packet */
+ IP_Address_t DestinationAddress; /**< Destination protocol IP address of the packet */
+ } IP_Header_t;
+
+ /* Function Prototypes: */
+ int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/LUFA RNDIS.inf b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/LUFA RNDIS.inf
new file mode 100644
index 00000000..a124afec
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/LUFA RNDIS.inf
@@ -0,0 +1,52 @@
+; Windows LUFA RNDIS Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature = "$Windows NT$"
+Class = Net
+ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+Provider = %COMPANY%
+DriverVer = 06/21/2006,6.0.6000.16384
+;CatalogFile = device.cat
+
+[Manufacturer]
+%COMPANY% = RndisDevices,NTx86,NTamd64,NTia64
+
+; Decoration for x86 architecture
+[RndisDevices.NTx86]
+%RNDISDEV% = RNDIS.NT.5.1, USB\VID_03EB&PID_204C
+
+; Decoration for x64 architecture
+[RndisDevices.NTamd64]
+%RNDISDEV% = RNDIS.NT.5.1, USB\VID_03EB&PID_204C
+
+; Decoration for ia64 architecture
+[RndisDevices.NTia64]
+%RNDISDEV% = RNDIS.NT.5.1, USB\VID_03EB&PID_204C
+
+;@@@ This is the common setting for setup
+[ControlFlags]
+ExcludeFromSelect=*
+
+; DDInstall section
+; References the in-build Netrndis.inf
+[RNDIS.NT.5.1]
+Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
+BusType = 15
+; NEVER REMOVE THE FOLLOWING REFERENCE FOR NETRNDIS.INF
+include = netrndis.inf
+needs = Usb_Rndis.ndi
+AddReg = Rndis_AddReg_Vista
+
+; DDInstal.Services section
+[RNDIS.NT.5.1.Services]
+include = netrndis.inf
+needs = Usb_Rndis.ndi.Services
+
+; No sys copyfiles - the sys files are already in-build
+; (part of the operating system).
+
+; Modify these strings for your device as needed.
+[Strings]
+COMPANY="LUFA Library"
+RNDISDEV="LUFA USB RNDIS Demo" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.c
new file mode 100644
index 00000000..f0e6ebba
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.c
@@ -0,0 +1,280 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/* Protocol decoders for Ethernet, TCP, IP, ICMP and ARP. Each of these routines
+ accepts a header to the appropriate protocol and prints out pertient information
+ on the packet through the serial port.
+
+ To disable printing of a specific protocol, define the token NO_DECODE_{Protocol}
+ in the project makefile, and pass it to the compiler using the -D switch.
+*/
+
+/** \file
+ *
+ * Protocol decoding routines, for the plain-text decoding of Ethernet frames for debugging purposes.
+ * Enabled protocol decoders will print incomming Ethernet frame contents through the USART in a human
+ * readable format.
+ *
+ * Note that the USART is a slow transmission medium, and will slow down packet processing considerably.
+ * Packet decoding routines can be disabled by defining NO_DECODE_{Protocol Name} in the project makefile
+ * and passing it to the compiler via the -D switch.
+ */
+
+#include "ProtocolDecoders.h"
+
+/** Decodes an Ethernet frame header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of an Ethernet frame header
+ */
+void DecodeEthernetFrameHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_ETHERNET)
+ Ethernet_Frame_Header_t* FrameHeader = (Ethernet_Frame_Header_t*)InDataStart;
+
+ printf_P(PSTR("\r\n"));
+
+ printf_P(PSTR(" ETHERNET\r\n"));
+ printf_P(PSTR(" + Frame Size: %u\r\n"), FrameIN.FrameLength);
+
+ if (!(MAC_COMPARE(&FrameHeader->Destination, &ServerMACAddress)) &&
+ !(MAC_COMPARE(&FrameHeader->Destination, &BroadcastMACAddress)))
+ {
+ printf_P(PSTR(" + NOT ADDRESSED TO DEVICE\r\n"));
+ return;
+ }
+
+ printf_P(PSTR(" + MAC Source : %02X:%02X:%02X:%02X:%02X:%02X\r\n"), FrameHeader->Source.Octets[0],
+ FrameHeader->Source.Octets[1],
+ FrameHeader->Source.Octets[2],
+ FrameHeader->Source.Octets[3],
+ FrameHeader->Source.Octets[4],
+ FrameHeader->Source.Octets[5]);
+
+ printf_P(PSTR(" + MAC Dest: %02X:%02X:%02X:%02X:%02X:%02X\r\n"), FrameHeader->Destination.Octets[0],
+ FrameHeader->Destination.Octets[1],
+ FrameHeader->Destination.Octets[2],
+ FrameHeader->Destination.Octets[3],
+ FrameHeader->Destination.Octets[4],
+ FrameHeader->Destination.Octets[5]);
+
+ if (SwapEndian_16(FrameIN.FrameLength) > ETHERNET_VER2_MINSIZE)
+ printf_P(PSTR(" + Protocol: 0x%04x\r\n"), SwapEndian_16(FrameHeader->EtherType));
+ else
+ printf_P(PSTR(" + Protocol: UNKNOWN E1\r\n"));
+ #endif
+}
+
+/** Decodes an ARP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of an ARP packet header
+ */
+void DecodeARPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_ARP)
+ ARP_Header_t* ARPHeader = (ARP_Header_t*)InDataStart;
+
+ printf_P(PSTR(" \\\r\n ARP\r\n"));
+
+ if (!(IP_COMPARE(&ARPHeader->TPA, &ServerIPAddress)) &&
+ !(MAC_COMPARE(&ARPHeader->THA, &ServerMACAddress)))
+ {
+ printf_P(PSTR(" + NOT ADDRESSED TO DEVICE\r\n"));
+ return;
+ }
+
+ printf_P(PSTR(" + Protocol: %x\r\n"), SwapEndian_16(ARPHeader->ProtocolType));
+ printf_P(PSTR(" + Operation: %u\r\n"), SwapEndian_16(ARPHeader->Operation));
+
+ if (SwapEndian_16(ARPHeader->ProtocolType) == ETHERTYPE_IPV4)
+ {
+ printf_P(PSTR(" + SHA MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n"), ARPHeader->SHA.Octets[0],
+ ARPHeader->SHA.Octets[1],
+ ARPHeader->SHA.Octets[2],
+ ARPHeader->SHA.Octets[3],
+ ARPHeader->SHA.Octets[4],
+ ARPHeader->SHA.Octets[5]);
+
+ printf_P(PSTR(" + SPA IP: %u.%u.%u.%u\r\n"), ARPHeader->SPA.Octets[0],
+ ARPHeader->SPA.Octets[1],
+ ARPHeader->SPA.Octets[2],
+ ARPHeader->SPA.Octets[3]);
+
+ printf_P(PSTR(" + THA MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n"), ARPHeader->THA.Octets[0],
+ ARPHeader->THA.Octets[1],
+ ARPHeader->THA.Octets[2],
+ ARPHeader->THA.Octets[3],
+ ARPHeader->THA.Octets[4],
+ ARPHeader->THA.Octets[5]);
+
+ printf_P(PSTR(" + TPA IP: %u.%u.%u.%u\r\n"), ARPHeader->TPA.Octets[0],
+ ARPHeader->TPA.Octets[1],
+ ARPHeader->TPA.Octets[2],
+ ARPHeader->TPA.Octets[3]);
+ }
+ #endif
+}
+
+/** Decodes an IP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of an IP packet header
+ */
+void DecodeIPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_IP)
+ IP_Header_t* IPHeader = (IP_Header_t*)InDataStart;
+
+ uint16_t HeaderLengthBytes = (IPHeader->HeaderLength * sizeof(uint32_t));
+
+ printf_P(PSTR(" \\\r\n IP\r\n"));
+
+ if (!(IP_COMPARE(&IPHeader->DestinationAddress, &ServerIPAddress)))
+ {
+ printf_P(PSTR(" + NOT ADDRESSED TO DEVICE\r\n"));
+ return;
+ }
+
+ printf_P(PSTR(" + Header Length: %u Bytes\r\n"), HeaderLengthBytes);
+ printf_P(PSTR(" + Packet Version: %u\r\n"), IPHeader->Version);
+ printf_P(PSTR(" + Total Length: %u\r\n"), SwapEndian_16(IPHeader->TotalLength));
+
+ printf_P(PSTR(" + Protocol: %u\r\n"), IPHeader->Protocol);
+ printf_P(PSTR(" + TTL: %u\r\n"), IPHeader->TTL);
+
+ printf_P(PSTR(" + IP Src: %u.%u.%u.%u\r\n"), IPHeader->SourceAddress.Octets[0],
+ IPHeader->SourceAddress.Octets[1],
+ IPHeader->SourceAddress.Octets[2],
+ IPHeader->SourceAddress.Octets[3]);
+
+ printf_P(PSTR(" + IP Dst: %u.%u.%u.%u\r\n"), IPHeader->DestinationAddress.Octets[0],
+ IPHeader->DestinationAddress.Octets[1],
+ IPHeader->DestinationAddress.Octets[2],
+ IPHeader->DestinationAddress.Octets[3]);
+ #endif
+}
+
+/** Decodes an ICMP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of an ICMP packet header
+ */
+void DecodeICMPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_ICMP)
+ ICMP_Header_t* ICMPHeader = (ICMP_Header_t*)InDataStart;
+
+ printf_P(PSTR(" \\\r\n ICMP\r\n"));
+
+ printf_P(PSTR(" + Type: %u\r\n"), ICMPHeader->Type);
+ printf_P(PSTR(" + Code: %u\r\n"), ICMPHeader->Code);
+ #endif
+}
+
+/** Decodes a TCP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of a TCP packet header
+ */
+void DecodeTCPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_TCP)
+ TCP_Header_t* TCPHeader = (TCP_Header_t*)InDataStart;
+
+ uint16_t HeaderLengthBytes = (TCPHeader->DataOffset * sizeof(uint32_t));
+
+ printf_P(PSTR(" \\\r\n TCP\r\n"));
+
+ printf_P(PSTR(" + Header Length: %u Bytes\r\n"), HeaderLengthBytes);
+
+ printf_P(PSTR(" + Source Port: %u\r\n"), SwapEndian_16(TCPHeader->SourcePort));
+ printf_P(PSTR(" + Destination Port: %u\r\n"), SwapEndian_16(TCPHeader->DestinationPort));
+
+ printf_P(PSTR(" + Sequence Number: %lu\r\n"), SwapEndian_32(TCPHeader->SequenceNumber));
+ printf_P(PSTR(" + Acknowledgment Number: %lu\r\n"), SwapEndian_32(TCPHeader->AcknowledgmentNumber));
+
+ printf_P(PSTR(" + Flags: 0x%02X\r\n"), TCPHeader->Flags);
+
+ if (TCP_GetPortState(TCPHeader->DestinationPort) == TCP_Port_Closed)
+ printf_P(PSTR(" + NOT LISTENING ON DESTINATION PORT\r\n"));
+ #endif
+}
+
+/** Decodes an UDP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of a UDP packet header
+ */
+void DecodeUDPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_UDP)
+ UDP_Header_t* UDPHeader = (UDP_Header_t*)InDataStart;
+
+ printf_P(PSTR(" \\\r\n UDP\r\n"));
+
+ printf_P(PSTR(" + Source Port: %u\r\n"), SwapEndian_16(UDPHeader->SourcePort));
+ printf_P(PSTR(" + Destination Port: %u\r\n"), SwapEndian_16(UDPHeader->DestinationPort));
+
+ printf_P(PSTR(" + Data Length: %d\r\n"), SwapEndian_16(UDPHeader->Length));
+ #endif
+}
+
+/** Decodes an DHCP header and prints its contents to through the USART in a human readable format.
+ *
+ * \param InDataStart Pointer to the start of a DHCP packet header
+ */
+void DecodeDHCPHeader(void* InDataStart)
+{
+ #if !defined(NO_DECODE_DHCP)
+ uint8_t* DHCPOptions = (InDataStart + sizeof(DHCP_Header_t));
+
+ printf_P(PSTR(" \\\r\n DHCP\r\n"));
+
+ while (DHCPOptions[0] != DHCP_OPTION_END)
+ {
+ if (DHCPOptions[0] == DHCP_OPTION_MESSAGETYPE)
+ {
+ switch (DHCPOptions[2])
+ {
+ case DHCP_MESSAGETYPE_DISCOVER:
+ printf_P(PSTR(" + DISCOVER\r\n"));
+ break;
+ case DHCP_MESSAGETYPE_REQUEST:
+ printf_P(PSTR(" + REQUEST\r\n"));
+ break;
+ case DHCP_MESSAGETYPE_RELEASE:
+ printf_P(PSTR(" + RELEASE\r\n"));
+ break;
+ case DHCP_MESSAGETYPE_DECLINE:
+ printf_P(PSTR(" + DECLINE\r\n"));
+ break;
+ }
+ }
+
+ DHCPOptionsINStart += ((DHCPOptionsINStart[0] == DHCP_OPTION_PAD) ? 1 : (DHCPOptionsINStart[1] + 2));
+ }
+
+ #endif
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.h
new file mode 100644
index 00000000..06e4c0ad
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/ProtocolDecoders.h
@@ -0,0 +1,56 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ProtocolDecoders.c.
+ */
+
+#ifndef _PROTOCOL_DECODERS_H_
+#define _PROTOCOL_DECODERS_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+
+ /* Function Prototypes: */
+ void DecodeEthernetFrameHeader(void* InDataStart);
+ void DecodeARPHeader(void* InDataStart);
+ void DecodeIPHeader(void* InDataStart);
+ void DecodeICMPHeader(void* InDataStart);
+ void DecodeTCPHeader(void* InDataStart);
+ void DecodeUDPHeader(void* InDataStart);
+ void DecodeDHCPHeader(void* InDataStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.c
new file mode 100644
index 00000000..ee0c8c34
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.c
@@ -0,0 +1,386 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * RNDIS command handler functions. This handles RNDIS commands according to
+ * the Microsoft RNDIS specification, creating a USB Ethernet network adapter.
+ */
+
+#define INCLUDE_FROM_RNDIS_C
+#include "RNDIS.h"
+
+/* Global Variables: */
+/** Physical MAC address of the network adapter, which becomes the MAC address of the host for packets sent to the adapter. */
+static MAC_Address_t PROGMEM AdapterMACAddress = {ADAPTER_MAC_ADDRESS};
+
+/** Vendor description of the adapter. This is overridden by the INF file required to install the appropriate RNDIS drivers for
+ * the device, but may still be used by the OS in some circumstances.
+ */
+static char PROGMEM AdapterVendorDescription[] = "LUFA RNDIS Adapter";
+
+/** List of RNDIS OID commands supported by this adapter. */
+static const uint32_t PROGMEM AdapterSupportedOIDList[] =
+ {
+ OID_GEN_SUPPORTED_LIST,
+ OID_GEN_HARDWARE_STATUS,
+ OID_GEN_MEDIA_SUPPORTED,
+ OID_GEN_MEDIA_IN_USE,
+ OID_GEN_MAXIMUM_FRAME_SIZE,
+ OID_GEN_MAXIMUM_TOTAL_SIZE,
+ OID_GEN_LINK_SPEED,
+ OID_GEN_TRANSMIT_BLOCK_SIZE,
+ OID_GEN_RECEIVE_BLOCK_SIZE,
+ OID_GEN_VENDOR_ID,
+ OID_GEN_VENDOR_DESCRIPTION,
+ OID_GEN_CURRENT_PACKET_FILTER,
+ OID_GEN_MAXIMUM_TOTAL_SIZE,
+ OID_GEN_MEDIA_CONNECT_STATUS,
+ OID_GEN_XMIT_OK,
+ OID_GEN_RCV_OK,
+ OID_GEN_XMIT_ERROR,
+ OID_GEN_RCV_ERROR,
+ OID_GEN_RCV_NO_BUFFER,
+ OID_802_3_PERMANENT_ADDRESS,
+ OID_802_3_CURRENT_ADDRESS,
+ OID_802_3_MULTICAST_LIST,
+ OID_802_3_MAXIMUM_LIST_SIZE,
+ OID_802_3_RCV_ERROR_ALIGNMENT,
+ OID_802_3_XMIT_ONE_COLLISION,
+ OID_802_3_XMIT_MORE_COLLISIONS,
+ };
+
+/** Buffer for RNDIS messages (as distinct from Ethernet frames sent through the adapter. This must be big enough to hold the entire
+ * Supported OID list, plus the response header. The buffer is half-duplex, and is written to as it is read to save on SRAM - for this
+ * reason, care must be taken when constructing RNDIS responses that unread data is not overwritten when writing in responses.
+ */
+uint8_t RNDISMessageBuffer[sizeof(AdapterSupportedOIDList) + sizeof(RNDIS_QUERY_CMPLT_t)];
+
+/** Pointer to the RNDIS message header at the top of the RNDIS message buffer, for convenience. */
+RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISMessageBuffer;
+
+/** Indicates if a RNDIS message response is ready to be sent back to the host. */
+bool ResponseReady = false;
+
+/** Current RNDIS adapter state, a value from the RNDIS_States_t enum. */
+uint8_t CurrRNDISState = RNDIS_Uninitialized;
+
+/** Current Ethernet packet filter mask. This is non-zero when the adapter is initialized, or zero when disabled. */
+uint32_t CurrPacketFilter = 0;
+
+
+/** Processes the RNDIS message received by the host and stored in the RNDISMessageBuffer global buffer. If a response is
+ * created, the ResponseReady global is updated so that the response is written back to the host upon request.
+ */
+void ProcessRNDISControlMessage(void)
+{
+ /* Note: Only a single buffer is used for both the received message and its response to save SRAM. Because of
+ this, response bytes should be filled in order so that they do not clobber unread data in the buffer. */
+
+ switch (MessageHeader->MessageType)
+ {
+ case REMOTE_NDIS_INITIALIZE_MSG:
+ /* Initialize the adapter - return information about the supported RNDIS version and buffer sizes */
+
+ ResponseReady = true;
+
+ RNDIS_INITIALIZE_MSG_t* INITIALIZE_Message = (RNDIS_INITIALIZE_MSG_t*)&RNDISMessageBuffer;
+ RNDIS_INITIALIZE_CMPLT_t* INITIALIZE_Response = (RNDIS_INITIALIZE_CMPLT_t*)&RNDISMessageBuffer;
+
+ INITIALIZE_Response->MessageType = REMOTE_NDIS_INITIALIZE_CMPLT;
+ INITIALIZE_Response->MessageLength = sizeof(RNDIS_INITIALIZE_CMPLT_t);
+ INITIALIZE_Response->RequestId = INITIALIZE_Message->RequestId;
+ INITIALIZE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+
+ INITIALIZE_Response->MajorVersion = REMOTE_NDIS_VERSION_MAJOR;
+ INITIALIZE_Response->MinorVersion = REMOTE_NDIS_VERSION_MINOR;
+ INITIALIZE_Response->DeviceFlags = REMOTE_NDIS_DF_CONNECTIONLESS;
+ INITIALIZE_Response->Medium = REMOTE_NDIS_MEDIUM_802_3;
+ INITIALIZE_Response->MaxPacketsPerTransfer = 1;
+ INITIALIZE_Response->MaxTransferSize = (sizeof(RNDIS_PACKET_MSG_t) + ETHERNET_FRAME_SIZE_MAX);
+ INITIALIZE_Response->PacketAlignmentFactor = 0;
+ INITIALIZE_Response->AFListOffset = 0;
+ INITIALIZE_Response->AFListSize = 0;
+
+ CurrRNDISState = RNDIS_Initialized;
+
+ break;
+ case REMOTE_NDIS_HALT_MSG:
+ /* Halt the adapter, reset the adapter state - note that no response should be returned when completed */
+
+ ResponseReady = false;
+ MessageHeader->MessageLength = 0;
+
+ CurrRNDISState = RNDIS_Uninitialized;
+
+ break;
+ case REMOTE_NDIS_QUERY_MSG:
+ /* Request for information about a parameter about the adapter, specified as an OID token */
+
+ ResponseReady = true;
+
+ RNDIS_QUERY_MSG_t* QUERY_Message = (RNDIS_QUERY_MSG_t*)&RNDISMessageBuffer;
+ RNDIS_QUERY_CMPLT_t* QUERY_Response = (RNDIS_QUERY_CMPLT_t*)&RNDISMessageBuffer;
+ uint32_t Query_Oid = QUERY_Message->Oid;
+
+ void* QueryData = &RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
+ QUERY_Message->InformationBufferOffset];
+ void* ResponseData = &RNDISMessageBuffer[sizeof(RNDIS_QUERY_CMPLT_t)];
+ uint16_t ResponseSize;
+
+ QUERY_Response->MessageType = REMOTE_NDIS_QUERY_CMPLT;
+ QUERY_Response->MessageLength = sizeof(RNDIS_QUERY_CMPLT_t);
+
+ if (ProcessNDISQuery(Query_Oid, QueryData, QUERY_Message->InformationBufferLength,
+ ResponseData, &ResponseSize))
+ {
+ QUERY_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+ QUERY_Response->MessageLength += ResponseSize;
+
+ QUERY_Response->InformationBufferLength = ResponseSize;
+ QUERY_Response->InformationBufferOffset = (sizeof(RNDIS_QUERY_CMPLT_t) - sizeof(RNDIS_Message_Header_t));
+ }
+ else
+ {
+ QUERY_Response->Status = REMOTE_NDIS_STATUS_NOT_SUPPORTED;
+
+ QUERY_Response->InformationBufferLength = 0;
+ QUERY_Response->InformationBufferOffset = 0;
+ }
+
+ break;
+ case REMOTE_NDIS_SET_MSG:
+ /* Request to set a parameter of the adapter, specified as an OID token */
+
+ ResponseReady = true;
+
+ RNDIS_SET_MSG_t* SET_Message = (RNDIS_SET_MSG_t*)&RNDISMessageBuffer;
+ RNDIS_SET_CMPLT_t* SET_Response = (RNDIS_SET_CMPLT_t*)&RNDISMessageBuffer;
+ uint32_t SET_Oid = SET_Message->Oid;
+
+ SET_Response->MessageType = REMOTE_NDIS_SET_CMPLT;
+ SET_Response->MessageLength = sizeof(RNDIS_SET_CMPLT_t);
+ SET_Response->RequestId = SET_Message->RequestId;
+
+ void* SetData = &RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
+ SET_Message->InformationBufferOffset];
+
+ if (ProcessNDISSet(SET_Oid, SetData, SET_Message->InformationBufferLength))
+ SET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+ else
+ SET_Response->Status = REMOTE_NDIS_STATUS_NOT_SUPPORTED;
+
+ break;
+ case REMOTE_NDIS_RESET_MSG:
+ /* Soft reset the adapter */
+
+ ResponseReady = true;
+
+ RNDIS_RESET_CMPLT_t* RESET_Response = (RNDIS_RESET_CMPLT_t*)&RNDISMessageBuffer;
+
+ RESET_Response->MessageType = REMOTE_NDIS_RESET_CMPLT;
+ RESET_Response->MessageLength = sizeof(RNDIS_RESET_CMPLT_t);
+ RESET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+ RESET_Response->AddressingReset = 0;
+
+ break;
+ case REMOTE_NDIS_KEEPALIVE_MSG:
+ /* Keep alive message sent to the adapter every 5 seconds when idle to ensure it is still responding */
+
+ ResponseReady = true;
+
+ RNDIS_KEEPALIVE_MSG_t* KEEPALIVE_Message = (RNDIS_KEEPALIVE_MSG_t*)&RNDISMessageBuffer;
+ RNDIS_KEEPALIVE_CMPLT_t* KEEPALIVE_Response = (RNDIS_KEEPALIVE_CMPLT_t*)&RNDISMessageBuffer;
+
+ KEEPALIVE_Response->MessageType = REMOTE_NDIS_KEEPALIVE_CMPLT;
+ KEEPALIVE_Response->MessageLength = sizeof(RNDIS_KEEPALIVE_CMPLT_t);
+ KEEPALIVE_Response->RequestId = KEEPALIVE_Message->RequestId;
+ KEEPALIVE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+
+ break;
+ }
+}
+
+/** Processes RNDIS query commands, retrieving information from the adapter and reporting it back to the host. The requested
+ * parameter is given as an OID value.
+ *
+ * \param OId OId value of the parameter being queried
+ * \param QueryData Pointer to any extra query data being sent by the host to the device inside the RNDIS message buffer
+ * \param QuerySize Size in bytes of the extra query data being sent by the host
+ * \param ResponseData Pointer to the start of the query response inside the RNDIS message buffer
+ * \param ResponseSize Pointer to the size in bytes of the response data being sent to the host
+ *
+ * \return Boolean true if the query was handled, false otherwise
+ */
+static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize,
+ void* ResponseData, uint16_t* ResponseSize)
+{
+ /* Handler for REMOTE_NDIS_QUERY_MSG messages */
+
+ switch (OId)
+ {
+ case OID_GEN_SUPPORTED_LIST:
+ *ResponseSize = sizeof(AdapterSupportedOIDList);
+
+ /* Copy the list of supported NDIS OID tokens to the response buffer */
+ memcpy_P(ResponseData, AdapterSupportedOIDList, sizeof(AdapterSupportedOIDList));
+
+ return true;
+ case OID_GEN_HARDWARE_STATUS:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Always indicate hardware ready */
+ *((uint32_t*)ResponseData) = NdisHardwareStatusReady;
+
+ return true;
+ case OID_GEN_MEDIA_SUPPORTED:
+ case OID_GEN_MEDIA_IN_USE:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate 802.3 (Ethernet) supported by the adapter */
+ *((uint32_t*)ResponseData) = REMOTE_NDIS_MEDIUM_802_3;
+
+ return true;
+ case OID_GEN_VENDOR_ID:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Vendor ID 0x0xFFFFFF is reserved for vendors who have not purchased a NDIS VID */
+ *((uint32_t*)ResponseData) = 0x00FFFFFF;
+
+ return true;
+ case OID_GEN_MAXIMUM_FRAME_SIZE:
+ case OID_GEN_TRANSMIT_BLOCK_SIZE:
+ case OID_GEN_RECEIVE_BLOCK_SIZE:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate that the maximum frame size is the size of the ethernet frame buffer */
+ *((uint32_t*)ResponseData) = ETHERNET_FRAME_SIZE_MAX;
+
+ return true;
+ case OID_GEN_VENDOR_DESCRIPTION:
+ *ResponseSize = sizeof(AdapterVendorDescription);
+
+ /* Copy vendor description string to the response buffer */
+ memcpy_P(ResponseData, AdapterVendorDescription, sizeof(AdapterVendorDescription));
+
+ return true;
+ case OID_GEN_MEDIA_CONNECT_STATUS:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Always indicate that the adapter is connected to a network */
+ *((uint32_t*)ResponseData) = REMOTE_NDIS_MEDIA_STATE_CONNECTED;
+
+ return true;
+ case OID_GEN_LINK_SPEED:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate 10Mb/s link speed */
+ *((uint32_t*)ResponseData) = 100000;
+
+ return true;
+ case OID_802_3_PERMANENT_ADDRESS:
+ case OID_802_3_CURRENT_ADDRESS:
+ *ResponseSize = sizeof(MAC_Address_t);
+
+ /* Copy over the fixed adapter MAC to the response buffer */
+ memcpy_P(ResponseData, &AdapterMACAddress, sizeof(MAC_Address_t));
+
+ return true;
+ case OID_802_3_MAXIMUM_LIST_SIZE:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate only one multicast address supported */
+ *((uint32_t*)ResponseData) = 1;
+
+ return true;
+ case OID_GEN_CURRENT_PACKET_FILTER:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate the current packet filter mask */
+ *((uint32_t*)ResponseData) = CurrPacketFilter;
+
+ return true;
+ case OID_GEN_XMIT_OK:
+ case OID_GEN_RCV_OK:
+ case OID_GEN_XMIT_ERROR:
+ case OID_GEN_RCV_ERROR:
+ case OID_GEN_RCV_NO_BUFFER:
+ case OID_802_3_RCV_ERROR_ALIGNMENT:
+ case OID_802_3_XMIT_ONE_COLLISION:
+ case OID_802_3_XMIT_MORE_COLLISIONS:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Unused statistic OIDs - always return 0 for each */
+ *((uint32_t*)ResponseData) = 0;
+
+ return true;
+ case OID_GEN_MAXIMUM_TOTAL_SIZE:
+ *ResponseSize = sizeof(uint32_t);
+
+ /* Indicate maximum overall buffer (Ethernet frame and RNDIS header) the adapter can handle */
+ *((uint32_t*)ResponseData) = (sizeof(RNDISMessageBuffer) + ETHERNET_FRAME_SIZE_MAX);
+
+ return true;
+ default:
+ return false;
+ }
+}
+
+/** Processes RNDIS set commands, setting adapter parameters to values given by the host. The requested parameter is given
+ * as an OID value.
+ *
+ * \param OId OId value of the parameter being set
+ * \param SetData Pointer to the parameter value in the RNDIS message buffer
+ * \param SetSize Size in bytes of the parameter value being sent by the host
+ *
+ * \return Boolean true if the set was handled, false otherwise
+ */
+static bool ProcessNDISSet(uint32_t OId, void* SetData, uint16_t SetSize)
+{
+ /* Handler for REMOTE_NDIS_SET_MSG messages */
+
+ switch (OId)
+ {
+ case OID_GEN_CURRENT_PACKET_FILTER:
+ /* Save the packet filter mask in case the host queries it again later */
+ CurrPacketFilter = *((uint32_t*)SetData);
+
+ /* Set the RNDIS state to initialized if the packet filter is non-zero */
+ CurrRNDISState = ((CurrPacketFilter) ? RNDIS_Data_Initialized : RNDIS_Data_Initialized);
+
+ return true;
+ case OID_802_3_MULTICAST_LIST:
+ /* Do nothing - throw away the value from the host as it is unused */
+
+ return true;
+ default:
+ return false;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.h
new file mode 100644
index 00000000..7c75875c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDIS.h
@@ -0,0 +1,226 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for RNDIS.c.
+ */
+
+#ifndef _RNDIS_H_
+#define _RNDIS_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "RNDISEthernet.h"
+ #include "RNDISConstants.h"
+ #include "Ethernet.h"
+
+ /* Macros: */
+ /** Physical MAC Address of the USB netowork adapter */
+ #define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00}
+
+ /** Implemented RNDIS Version Major */
+ #define REMOTE_NDIS_VERSION_MAJOR 0x01
+
+ /** Implemented RNDIS Version Minor */
+ #define REMOTE_NDIS_VERSION_MINOR 0x00
+
+ /** RNDIS request to issue a host-to-device NDIS command */
+ #define SEND_ENCAPSULATED_COMMAND 0x00
+
+ /** RNDIS request to issue a device-to-host NDIS response */
+ #define GET_ENCAPSULATED_RESPONSE 0x01
+
+ /* Enums: */
+ /** Enum for the possible NDIS adapter states. */
+ enum RNDIS_States_t
+ {
+ RNDIS_Uninitialized = 0, /**< Adapter currently uninitialized */
+ RNDIS_Initialized = 1, /**< Adapter currently initialized but not ready for data transfers */
+ RNDIS_Data_Initialized = 2, /**< Adapter currently initialized and ready for data transfers */
+ };
+
+ /** Enum for the NDIS hardware states */
+ enum NDIS_Hardware_Status_t
+ {
+ NdisHardwareStatusReady, /**< Hardware Ready to accept commands from the host */
+ NdisHardwareStatusInitializing, /**< Hardware busy initializing */
+ NdisHardwareStatusReset, /**< Hardware reset */
+ NdisHardwareStatusClosing, /**< Hardware currently closing */
+ NdisHardwareStatusNotReady /**< Hardware not ready to accept commands from the host */
+ };
+
+ /* Type Defines: */
+ /** Type define for a RNDIS message header, sent before RNDIS messages */
+ typedef struct
+ {
+ uint32_t MessageType; /**< RNDIS message type, a REMOTE_NDIS_*_MSG constant */
+ uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */
+ } RNDIS_Message_Header_t;
+
+ /** Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t DataOffset;
+ uint32_t DataLength;
+ uint32_t OOBDataOffset;
+ uint32_t OOBDataLength;
+ uint32_t NumOOBDataElements;
+ uint32_t PerPacketInfoOffset;
+ uint32_t PerPacketInfoLength;
+ uint32_t VcHandle;
+ uint32_t Reserved;
+ } RNDIS_PACKET_MSG_t;
+
+ /** Type define for a RNDIS Initialize command message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+
+ uint32_t MajorVersion;
+ uint32_t MinorVersion;
+ uint32_t MaxTransferSize;
+ } RNDIS_INITIALIZE_MSG_t;
+
+ /** Type define for a RNDIS Initialize complete response message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+ uint32_t Status;
+
+ uint32_t MajorVersion;
+ uint32_t MinorVersion;
+ uint32_t DeviceFlags;
+ uint32_t Medium;
+ uint32_t MaxPacketsPerTransfer;
+ uint32_t MaxTransferSize;
+ uint32_t PacketAlignmentFactor;
+ uint32_t AFListOffset;
+ uint32_t AFListSize;
+ } RNDIS_INITIALIZE_CMPLT_t;
+
+ /** Type define for a RNDIS Keepalive command message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+ } RNDIS_KEEPALIVE_MSG_t;
+
+ /** Type define for a RNDIS Keepalive complete message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+ uint32_t Status;
+ } RNDIS_KEEPALIVE_CMPLT_t;
+
+ /** Type define for a RNDIS Reset complete message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t Status;
+
+ uint32_t AddressingReset;
+ } RNDIS_RESET_CMPLT_t;
+
+ /** Type define for a RNDIS Set command message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+
+ uint32_t Oid;
+ uint32_t InformationBufferLength;
+ uint32_t InformationBufferOffset;
+ uint32_t DeviceVcHandle;
+ } RNDIS_SET_MSG_t;
+
+ /** Type define for a RNDIS Set complete response message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+ uint32_t Status;
+ } RNDIS_SET_CMPLT_t;
+
+ /** Type define for a RNDIS Query command message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+
+ uint32_t Oid;
+ uint32_t InformationBufferLength;
+ uint32_t InformationBufferOffset;
+ uint32_t DeviceVcHandle;
+ } RNDIS_QUERY_MSG_t;
+
+ /** Type define for a RNDIS Query complete response message */
+ typedef struct
+ {
+ uint32_t MessageType;
+ uint32_t MessageLength;
+ uint32_t RequestId;
+ uint32_t Status;
+
+ uint32_t InformationBufferLength;
+ uint32_t InformationBufferOffset;
+ } RNDIS_QUERY_CMPLT_t;
+
+ /* External Variables: */
+ extern uint8_t RNDISMessageBuffer[];
+ extern RNDIS_Message_Header_t* MessageHeader;
+ extern bool ResponseReady;
+ extern uint8_t CurrRNDISState;
+
+ /* Function Prototypes: */
+ void ProcessRNDISControlMessage(void);
+
+ #if defined(INCLUDE_FROM_RNDIS_C)
+ static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize,
+ void* ResponseData, uint16_t* ResponseSize);
+ static bool ProcessNDISSet(uint32_t OId, void* SetData, uint16_t SetSize);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISConstants.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISConstants.h
new file mode 100644
index 00000000..91a7e898
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISConstants.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * RNDIS specification related constants. For more information on these
+ * constants, please refer to the Microsoft RNDIS specification.
+ */
+
+#ifndef _RNDIS_CONSTANTS_H_
+#define _RNDIS_CONSTANTS_H_
+
+ /* Macros: */
+ #define REMOTE_NDIS_PACKET_MSG 0x00000001UL
+ #define REMOTE_NDIS_INITIALIZE_MSG 0x00000002UL
+ #define REMOTE_NDIS_HALT_MSG 0x00000003UL
+ #define REMOTE_NDIS_QUERY_MSG 0x00000004UL
+ #define REMOTE_NDIS_SET_MSG 0x00000005UL
+ #define REMOTE_NDIS_RESET_MSG 0x00000006UL
+ #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007UL
+ #define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008UL
+
+ #define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002UL
+ #define REMOTE_NDIS_QUERY_CMPLT 0x80000004UL
+ #define REMOTE_NDIS_SET_CMPLT 0x80000005UL
+ #define REMOTE_NDIS_RESET_CMPLT 0x80000006UL
+ #define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008UL
+
+ #define REMOTE_NDIS_STATUS_SUCCESS 0x00000000UL
+ #define REMOTE_NDIS_STATUS_FAILURE 0xC0000001UL
+ #define REMOTE_NDIS_STATUS_INVALID_DATA 0xC0010015UL
+ #define REMOTE_NDIS_STATUS_NOT_SUPPORTED 0xC00000BBUL
+ #define REMOTE_NDIS_STATUS_MEDIA_CONNECT 0x4001000BUL
+ #define REMOTE_NDIS_STATUS_MEDIA_DISCONNECT 0x4001000CUL
+
+ #define REMOTE_NDIS_MEDIA_STATE_CONNECTED 0x00000000UL
+ #define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL
+
+ #define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL
+
+ #define REMOTE_NDIS_DF_CONNECTIONLESS 0x00000001UL
+ #define REMOTE_NDIS_DF_CONNECTION_ORIENTED 0x00000002UL
+
+ #define OID_GEN_SUPPORTED_LIST 0x00010101UL
+ #define OID_GEN_HARDWARE_STATUS 0x00010102UL
+ #define OID_GEN_MEDIA_SUPPORTED 0x00010103UL
+ #define OID_GEN_MEDIA_IN_USE 0x00010104UL
+ #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106UL
+ #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111UL
+ #define OID_GEN_LINK_SPEED 0x00010107UL
+ #define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010AUL
+ #define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010BUL
+ #define OID_GEN_VENDOR_ID 0x0001010CUL
+ #define OID_GEN_VENDOR_DESCRIPTION 0x0001010DUL
+ #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010EUL
+ #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111UL
+ #define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114UL
+ #define OID_GEN_XMIT_OK 0x00020101UL
+ #define OID_GEN_RCV_OK 0x00020102UL
+ #define OID_GEN_XMIT_ERROR 0x00020103UL
+ #define OID_GEN_RCV_ERROR 0x00020104UL
+ #define OID_GEN_RCV_NO_BUFFER 0x00020105UL
+ #define OID_802_3_PERMANENT_ADDRESS 0x01010101UL
+ #define OID_802_3_CURRENT_ADDRESS 0x01010102UL
+ #define OID_802_3_MULTICAST_LIST 0x01010103UL
+ #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104UL
+ #define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101UL
+ #define OID_802_3_XMIT_ONE_COLLISION 0x01020102UL
+ #define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103UL
+
+#endif \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.aps b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.aps
new file mode 100644
index 00000000..b5d21c1f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>RNDISEthernet</ProjectName><Created>30-Sep-2008 14:17:05</Created><LastEdit>22-Jan-2009 17:52:35</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:17:05</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>AT90USB1287.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ARP.c</SOURCEFILE><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>Ethernet.c</SOURCEFILE><SOURCEFILE>ICMP.c</SOURCEFILE><SOURCEFILE>IP.c</SOURCEFILE><SOURCEFILE>ProtocolDecoders.c</SOURCEFILE><SOURCEFILE>RNDIS.c</SOURCEFILE><SOURCEFILE>RNDISEthernet.c</SOURCEFILE><SOURCEFILE>TCP.c</SOURCEFILE><SOURCEFILE>Webserver.c</SOURCEFILE><HEADERFILE>ARP.h</HEADERFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>Ethernet.h</HEADERFILE><HEADERFILE>EthernetProtocols.h</HEADERFILE><HEADERFILE>ICMP.h</HEADERFILE><HEADERFILE>IP.h</HEADERFILE><HEADERFILE>ProtocolDecoders.h</HEADERFILE><HEADERFILE>RNDIS.h</HEADERFILE><HEADERFILE>RNDISEthernet.h</HEADERFILE><HEADERFILE>TCP.h</HEADERFILE><HEADERFILE>Webserver.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>at90usb1287</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>RNDISEthernet.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20081205\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20081205\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ARP.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Descriptors.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Ethernet.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\EthernetProtocols.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ICMP.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\IP.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ProtocolDecoders.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\RNDIS.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\RNDISEthernet.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\TCP.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Telnet.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Webserver.h</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ARP.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Descriptors.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Ethernet.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ICMP.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\IP.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\ProtocolDecoders.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\RNDIS.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\RNDISEthernet.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\TCP.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Telnet.c</Name><Name>C:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Demos\RNDISEthernet\Webserver.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="1" orderaddress="1" ordergroup="1"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.c
new file mode 100644
index 00000000..255a53b3
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.c
@@ -0,0 +1,357 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the RNDISEthernet demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "RNDISEthernet.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA RNDIS App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: Ethernet_Task , TaskStatus: TASK_STOP },
+ { Task: TCP_Task , TaskStatus: TASK_STOP },
+ { Task: RNDIS_Task , TaskStatus: TASK_STOP },
+};
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the USB management task.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+ SerialStream_Init(9600, false);
+
+ /* Webserver Initialization */
+ TCP_Init();
+ Webserver_Init();
+
+ printf_P(PSTR("\r\n\r\n****** RNDIS Demo running. ******\r\n"));
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops all the relevent tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running TCP/IP and USB management tasks */
+ Scheduler_SetTaskMode(RNDIS_Task, TASK_STOP);
+ Scheduler_SetTaskMode(Ethernet_Task, TASK_STOP);
+ Scheduler_SetTaskMode(TCP_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
+ * of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevent tasks.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start TCP/IP tasks */
+ Scheduler_SetTaskMode(RNDIS_Task, TASK_RUN);
+ Scheduler_SetTaskMode(Ethernet_Task, TASK_RUN);
+ Scheduler_SetTaskMode(TCP_Task, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the RNDIS control commands,
+ * which set up the USB RNDIS network adapter), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Discard the unused wValue parameter */
+ Endpoint_Discard_Word();
+
+ /* Discard the unused wIndex parameter */
+ Endpoint_Discard_Word();
+
+ /* Read in the wLength parameter */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* Process RNDIS class commands */
+ switch (bRequest)
+ {
+ case SEND_ENCAPSULATED_COMMAND:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Clear the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Read in the RNDIS message into the message buffer */
+ Endpoint_Read_Control_Stream_LE(RNDISMessageBuffer, wLength);
+
+ /* Finalize the stream transfer to clear the last packet from the host */
+ Endpoint_ClearSetupIN();
+
+ /* Process the RNDIS message */
+ ProcessRNDISControlMessage();
+ }
+
+ break;
+ case GET_ENCAPSULATED_RESPONSE:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Check if a response to the last message is ready */
+ if (!(MessageHeader->MessageLength))
+ {
+ /* Set the response to a single 0x00 byte to indicate that no response is ready */
+ RNDISMessageBuffer[0] = 0;
+ MessageHeader->MessageLength = 1;
+ }
+
+ /* Check if less than the requested number of bytes to transfer */
+ if (MessageHeader->MessageLength < wLength)
+ wLength = MessageHeader->MessageLength;
+
+ /* Clear the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Write the message response data to the endpoint */
+ Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+
+ /* Reset the message header once again after transmission */
+ MessageHeader->MessageLength = 0;
+ }
+
+ break;
+ }
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the RNDISEthernet_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ case Status_ProcessingEthernetFrame:
+ LEDMask = (LEDS_LED2 | LEDS_LED3);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task to manage the sending and receiving of encapsulated RNDIS data and notifications. This removes the RNDIS
+ * wrapper from recieved Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper
+ * to a frame in the FrameOUT global before sending the buffer contents to the host.
+ */
+TASK(RNDIS_Task)
+{
+ /* Select the notification endpoint */
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+
+ /* Check if a message response is ready for the host */
+ if (Endpoint_ReadWriteAllowed() && ResponseReady)
+ {
+ USB_Notification_t Notification = (USB_Notification_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+ bNotification: NOTIF_RESPONSE_AVAILABLE,
+ wValue: 0,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Indicate that a message response is ready for the host */
+ Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Indicate a response is no longer ready */
+ ResponseReady = false;
+ }
+
+ /* Don't process the data endpoints until the system is in the data initialized state, and the buffer is free */
+ if ((CurrRNDISState == RNDIS_Data_Initialized) && !(MessageHeader->MessageLength))
+ {
+ /* Create a new packet header for reading/writing */
+ RNDIS_PACKET_MSG_t RNDISPacketHeader;
+
+ /* Select the data OUT endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ /* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
+ if (Endpoint_ReadWriteAllowed() && !(FrameIN.FrameInBuffer))
+ {
+ /* Read in the packet message header */
+ Endpoint_Read_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_PACKET_MSG_t));
+
+ /* Stall the request if the data is too large */
+ if (RNDISPacketHeader.MessageLength > ETHERNET_FRAME_SIZE_MAX)
+ {
+ Endpoint_StallTransaction();
+ return;
+ }
+
+ /* Read in the Ethernet frame into the buffer */
+ Endpoint_Read_Stream_LE(FrameIN.FrameData, RNDISPacketHeader.DataLength);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Store the size of the Ethernet frame */
+ FrameIN.FrameLength = RNDISPacketHeader.DataLength;
+
+ /* Indicate Ethernet IN buffer full */
+ FrameIN.FrameInBuffer = true;
+ }
+
+ /* Select the data IN endpoint */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
+ if (Endpoint_ReadWriteAllowed() && FrameOUT.FrameInBuffer)
+ {
+ /* Clear the packet header with all 0s so that the relevant fields can be filled */
+ memset(&RNDISPacketHeader, 0, sizeof(RNDIS_PACKET_MSG_t));
+
+ /* Construct the required packet header fields in the buffer */
+ RNDISPacketHeader.MessageType = REMOTE_NDIS_PACKET_MSG;
+ RNDISPacketHeader.MessageLength = (sizeof(RNDIS_PACKET_MSG_t) + FrameOUT.FrameLength);
+ RNDISPacketHeader.DataOffset = (sizeof(RNDIS_PACKET_MSG_t) - sizeof(RNDIS_Message_Header_t));
+ RNDISPacketHeader.DataLength = FrameOUT.FrameLength;
+
+ /* Send the packet header to the host */
+ Endpoint_Write_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_PACKET_MSG_t));
+
+ /* Send the Ethernet frame data to the host */
+ Endpoint_Write_Stream_LE(FrameOUT.FrameData, RNDISPacketHeader.DataLength);
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Indicate Ethernet OUT buffer no longer full */
+ FrameOUT.FrameInBuffer = false;
+ }
+ }
+}
+
+/** Ethernet frame processing task. This task checks to see if a frame has been received, and if so hands off the processing
+ * of the frame to the Ethernet processing routines.
+ */
+TASK(Ethernet_Task)
+{
+ /* Task for Ethernet processing. Incoming ethernet frames are loaded into the FrameIN structure, and
+ outgoing frames should be loaded into the FrameOUT structure. Both structures can only hold a single
+ Ethernet frame at a time, so the FrameInBuffer bool is used to indicate when the buffers contain data. */
+
+ /* Check if a frame has been written to the IN frame buffer */
+ if (FrameIN.FrameInBuffer)
+ {
+ /* Indicate packet processing started */
+ UpdateStatus(Status_ProcessingEthernetFrame);
+
+ /* Process the ethernet frame - replace this with your own Ethernet handler code as desired */
+ Ethernet_ProcessPacket();
+
+ /* Indicate packet processing complete */
+ UpdateStatus(Status_USBReady);
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.h
new file mode 100644
index 00000000..4a0f3c18
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.h
@@ -0,0 +1,108 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for RNDISEthernet.c.
+ */
+
+#ifndef _RNDISETHERNET_H_
+#define _RNDISETHERNET_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <avr/pgmspace.h>
+
+ #include "Descriptors.h"
+ #include "RNDIS.h"
+ #include "Ethernet.h"
+ #include "TCP.h"
+ #include "ARP.h"
+ #include "Webserver.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h>
+
+ /* Macros: */
+ /** Notification value to indicate that a frame is ready to be read by the host. */
+ #define NOTIF_RESPONSE_AVAILABLE 0x01
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for a RNDIS notification message, for transmission to the RNDIS host via the notification
+ * Endpoint.
+ */
+ typedef struct
+ {
+ uint8_t bmRequestType; /**< Notification type, a mask of values from SrdRequestType.h */
+ uint8_t bNotification; /**< Notification index, indicating what the RNDIS notification relates to */
+ uint16_t wValue; /**< Two byte notification value parameter */
+ uint16_t wIndex; /**< Two byte notification index parameter */
+ uint16_t wLength; /**< Size of data payload following the notification header */
+ } USB_Notification_t;
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum RNDISEthernet_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_ProcessingEthernetFrame = 3, /**< Currently processing an ethernet frame from the host */
+ };
+
+ /* Tasks: */
+ TASK(RNDIS_Task);
+ TASK(Ethernet_Task);
+
+ /* Function Prototypes: */
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.txt b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.txt
new file mode 100644
index 00000000..bd4ff69e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/RNDISEthernet.txt
@@ -0,0 +1,62 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage RNDIS Class Ethernet Demo (with Webserver/Telnet)
+ *
+ * Remote Network Driver Interface demonstration application.
+ * This gives a simple reference application for implementing
+ * a CDC RNDIS device acting as a simple network interface for
+ * ethernet packet exchange. RNDIS is a proprietary Microsoft
+ * standard; this demo will only work on Windows 2000 (manually
+ * patched with the Microsoft RNDIS hotfix) and above (with no
+ * manual patches), or on the latest Linux kernels.
+ *
+ * Before running, you will need to install the INF file that
+ * is located in the RNDISEthernet project directory. This will
+ * enable Windows to use its inbuilt RNDIS drivers, negating the
+ * need for special Windows drivers for the device. To install,
+ * right-click the .INF file and choose the Install option. If
+ * Windows 2000 is used, the Microsoft INF file in the hotfix
+ * will need to be altered to use the VID/PID of the demo and
+ * then chosen instead of the LUFA RNDIS INF file when prompted.
+ *
+ * When enumerated, this demo will install as a new network
+ * adapter which ethernet packets can be sent to and received
+ * from. Running on top of the adapter is a very simple TCP/IP
+ * stack with a HTTP webserver and TELNET host which can be
+ * accessed through a web browser at IP address 10.0.0.2:80 or
+ * through a TELNET client at 10.0.0.2:25. This device also supports
+ * ping echos via the ICMP protocol.
+ *
+ * \note The TCP/IP stack in this demo has a number of limitations
+ * and should serve as an example only - it is not fully featured nor
+ * compliant to the TCP/IP specification. For complete projects, it is
+ * recommended that it be replaced with an external open source TCP/IP
+ * stack that is feature complete, such as the uIP stack.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Remote NDIS (Microsoft Proprietary CDC Class Networking Standard)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>Microsoft RNDIS Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.c
new file mode 100644
index 00000000..b4a65344
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.c
@@ -0,0 +1,614 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Transmission Control Protocol (TCP) packet handling routines. This protocol handles the reliable in-order transmission
+ * and reception of packets to and from devices on a network, to "ports" on the device. It is used in situations where data
+ * delivery must be reliable and correct, e.g. HTTP, TELNET and most other non-streaming protocols.
+ */
+
+#define INCLUDE_FROM_TCP_C
+#include "TCP.h"
+
+/* Global Variables: */
+/** Port state table array. This contains the current status of TCP ports in the device. To save on space, only open ports are
+ * stored - closed ports may be overwritten at any time, and the system will assume any ports not present in the array are closed. This
+ * allows for MAX_OPEN_TCP_PORTS to be less than the number of ports used by the application if desired.
+ */
+TCP_PortState_t PortStateTable[MAX_OPEN_TCP_PORTS];
+
+/** Connection state table array. This contains the current status of TCP connections in the device. To save on space, only active
+ * (non-closed) connections are stored - closed connections may be overwritten at any time, and the system will assume any connections
+ * not present in the array are closed.
+ */
+TCP_ConnectionState_t ConnectionStateTable[MAX_TCP_CONNECTIONS];
+
+
+/** Task to handle the calling of each registered application's callback function, to process and generate TCP packets at the application
+ * level. If an application produces a response, this task constructs the appropriate Ethernet frame and places it into the Ethernet OUT
+ * buffer for later transmission.
+ */
+TASK(TCP_Task)
+{
+ /* Task to hand off TCP packets to and from the listening applications. */
+
+ /* Run each application in sequence, to process incomming and generate outgoing packets */
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* Find the corresponding port entry in the port table */
+ for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
+ {
+ /* Run the application handler for the port */
+ if ((PortStateTable[PTableEntry].Port == ConnectionStateTable[CSTableEntry].Port) &&
+ (PortStateTable[PTableEntry].State == TCP_Port_Open))
+ {
+ PortStateTable[PTableEntry].ApplicationHandler(&ConnectionStateTable[CSTableEntry], &ConnectionStateTable[CSTableEntry].Info.Buffer);
+ }
+ }
+ }
+
+ /* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
+ if (FrameOUT.FrameInBuffer)
+ return;
+
+ /* Send response packets from each application as the TCP packet buffers are filled by the applications */
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* For each completely received packet, pass it along to the listening application */
+ if ((ConnectionStateTable[CSTableEntry].Info.Buffer.Direction == TCP_PACKETDIR_OUT) &&
+ (ConnectionStateTable[CSTableEntry].Info.Buffer.Ready))
+ {
+ Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData;
+ IP_Header_t* IPHeaderOUT = (IP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)];
+ TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
+ sizeof(IP_Header_t)];
+ void* TCPDataOUT = &FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
+ sizeof(IP_Header_t) +
+ sizeof(TCP_Header_t)];
+
+ uint16_t PacketSize = ConnectionStateTable[CSTableEntry].Info.Buffer.Length;
+
+ /* Fill out the TCP data */
+ TCPHeaderOUT->SourcePort = ConnectionStateTable[CSTableEntry].Port;
+ TCPHeaderOUT->DestinationPort = ConnectionStateTable[CSTableEntry].RemotePort;
+ TCPHeaderOUT->SequenceNumber = SwapEndian_32(ConnectionStateTable[CSTableEntry].Info.SequenceNumberOut);
+ TCPHeaderOUT->AcknowledgmentNumber = SwapEndian_32(ConnectionStateTable[CSTableEntry].Info.SequenceNumberIn);
+ TCPHeaderOUT->DataOffset = (sizeof(TCP_Header_t) / sizeof(uint32_t));
+ TCPHeaderOUT->WindowSize = SwapEndian_16(TCP_WINDOW_SIZE);
+
+ TCPHeaderOUT->Flags = TCP_FLAG_ACK;
+ TCPHeaderOUT->UrgentPointer = 0;
+ TCPHeaderOUT->Checksum = 0;
+ TCPHeaderOUT->Reserved = 0;
+
+ memcpy(TCPDataOUT, ConnectionStateTable[CSTableEntry].Info.Buffer.Data, PacketSize);
+
+ ConnectionStateTable[CSTableEntry].Info.SequenceNumberOut += PacketSize;
+
+ TCPHeaderOUT->Checksum = TCP_Checksum16(TCPHeaderOUT, ServerIPAddress,
+ ConnectionStateTable[CSTableEntry].RemoteAddress,
+ (sizeof(TCP_Header_t) + PacketSize));
+
+ PacketSize += sizeof(TCP_Header_t);
+
+ /* Fill out the response IP header */
+ IPHeaderOUT->TotalLength = SwapEndian_16(sizeof(IP_Header_t) + PacketSize);
+ IPHeaderOUT->TypeOfService = 0;
+ IPHeaderOUT->HeaderLength = (sizeof(IP_Header_t) / sizeof(uint32_t));
+ IPHeaderOUT->Version = 4;
+ IPHeaderOUT->Flags = 0;
+ IPHeaderOUT->FragmentOffset = 0;
+ IPHeaderOUT->Identification = 0;
+ IPHeaderOUT->HeaderChecksum = 0;
+ IPHeaderOUT->Protocol = PROTOCOL_TCP;
+ IPHeaderOUT->TTL = DEFAULT_TTL;
+ IPHeaderOUT->SourceAddress = ServerIPAddress;
+ IPHeaderOUT->DestinationAddress = ConnectionStateTable[CSTableEntry].RemoteAddress;
+
+ IPHeaderOUT->HeaderChecksum = Ethernet_Checksum16(IPHeaderOUT, sizeof(IP_Header_t));
+
+ PacketSize += sizeof(IP_Header_t);
+
+ /* Fill out the response Ethernet frame header */
+ FrameOUTHeader->Source = ServerMACAddress;
+ FrameOUTHeader->Destination = (MAC_Address_t){{0x02, 0x00, 0x02, 0x00, 0x02, 0x00}};
+ FrameOUTHeader->EtherType = SwapEndian_16(ETHERTYPE_IPV4);
+
+ PacketSize += sizeof(Ethernet_Frame_Header_t);
+
+ /* Set the response length in the buffer and indicate that a response is ready to be sent */
+ FrameOUT.FrameLength = PacketSize;
+ FrameOUT.FrameInBuffer = true;
+
+ ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;
+
+ break;
+ }
+ }
+}
+
+/** Initializes the TCP protocol handler, clearing the port and connection state tables. This must be called before TCP packets are
+ * processed.
+ */
+void TCP_Init(void)
+{
+ /* Initialize the port state table with all CLOSED entries */
+ for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++)
+ PortStateTable[PTableEntry].State = TCP_Port_Closed;
+
+ /* Initialize the connection table with all CLOSED entries */
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ ConnectionStateTable[CSTableEntry].State = TCP_Connection_Closed;
+}
+
+/** Sets the state and callback handler of the given port, specified in big endian to the given state.
+ *
+ * \param Port Port whose state and callback function to set, specified in big endian
+ * \param State New state of the port, a value from the TCP_PortStates_t enum
+ * \param Handler Application callback handler for the port
+ *
+ * \return Boolean true if the port state was set, false otherwise (no more space in the port state table)
+ */
+bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
+{
+ /* Note, Port number should be specified in BIG endian to simplfy network code */
+
+ /* Check to see if the port entry is already in the port state table */
+ for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
+ {
+ /* Find existing entry for the port in the table, update it if found */
+ if (PortStateTable[PTableEntry].Port == Port)
+ {
+ PortStateTable[PTableEntry].State = State;
+ PortStateTable[PTableEntry].ApplicationHandler = Handler;
+ return true;
+ }
+ }
+
+ /* Check if trying to open the port -- if so we need to find an unused (closed) entry and replace it */
+ if (State == TCP_Port_Open)
+ {
+ for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
+ {
+ /* Find a closed port entry in the table, change it to the given port and state */
+ if (PortStateTable[PTableEntry].State == TCP_Port_Closed)
+ {
+ PortStateTable[PTableEntry].Port = Port;
+ PortStateTable[PTableEntry].State = State;
+ PortStateTable[PTableEntry].ApplicationHandler = Handler;
+ return true;
+ }
+ }
+
+ /* Port not in table and no room to add it, return failure */
+ return false;
+ }
+ else
+ {
+ /* Port not in table but trying to close it, so operation successful */
+ return true;
+ }
+}
+
+/** Retrieves the current state of a given TCP port, specified in big endian.
+ *
+ * \param Port TCP port whose state is to be retrieved, given in big-endian
+ *
+ * \return A value from the TCP_PortStates_t enum
+ */
+uint8_t TCP_GetPortState(uint16_t Port)
+{
+ /* Note, Port number should be specified in BIG endian to simplfy network code */
+
+ for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
+ {
+ /* Find existing entry for the port in the table, return the port status if found */
+ if (PortStateTable[PTableEntry].Port == Port)
+ return PortStateTable[PTableEntry].State;
+ }
+
+ /* Port not in table, assume closed */
+ return TCP_Port_Closed;
+}
+
+/** Sets the connection state of the given port, remote address and remote port to the given TCP connection state. If the
+ * connection exists in the connection state table it is updated, otherwise it is created if possible.
+ *
+ * \param Port TCP port of the connection on the device, specified in big endian
+ * \param RemoteAddress Remote protocol IP address of the connected device
+ * \param RemotePort TCP port of the remote device in the connection, specified in big endian
+ * \param State TCP connection state, a value from the TCP_ConnectionStates_t enum
+ *
+ * \return Boolean true if the connection was updated or created, false otherwise (no more space in the connection state table)
+ */
+bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State)
+{
+ /* Note, Port number should be specified in BIG endian to simplfy network code */
+
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* Find port entry in the table */
+ if ((ConnectionStateTable[CSTableEntry].Port == Port) &&
+ IP_COMPARE(&ConnectionStateTable[CSTableEntry].RemoteAddress, &RemoteAddress) &&
+ ConnectionStateTable[CSTableEntry].RemotePort == RemotePort)
+ {
+ ConnectionStateTable[CSTableEntry].State = State;
+ return true;
+ }
+ }
+
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* Find empty entry in the table */
+ if (ConnectionStateTable[CSTableEntry].State == TCP_Connection_Closed)
+ {
+ ConnectionStateTable[CSTableEntry].Port = Port;
+ ConnectionStateTable[CSTableEntry].RemoteAddress = RemoteAddress;
+ ConnectionStateTable[CSTableEntry].RemotePort = RemotePort;
+ ConnectionStateTable[CSTableEntry].State = State;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/** Retrieves the current state of a given TCP connection to a host.
+ *
+ * \param Port TCP port on the device in the connection, specified in big endian
+ * \param RemoteAddress Remote protocol IP address of the connected host
+ * \param RemotePort Remote TCP port of the connected host, specified in big endian
+ *
+ * \return A value from the TCP_ConnectionStates_t enum
+ */
+uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
+{
+ /* Note, Port number should be specified in BIG endian to simplfy network code */
+
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* Find port entry in the table */
+ if ((ConnectionStateTable[CSTableEntry].Port == Port) &&
+ IP_COMPARE(&ConnectionStateTable[CSTableEntry].RemoteAddress, &RemoteAddress) &&
+ ConnectionStateTable[CSTableEntry].RemotePort == RemotePort)
+
+ {
+ return ConnectionStateTable[CSTableEntry].State;
+ }
+ }
+
+ return TCP_Connection_Closed;
+}
+
+/** Retrieves the connection info structure of a given connection to a host.
+ *
+ * \param Port TCP port on the device in the connection, specified in big endian
+ * \param RemoteAddress Remote protocol IP address of the connected host
+ * \param RemotePort Remote TCP port of the connected host, specified in big endian
+ *
+ * \return ConnectionInfo structure of the connection if found, NULL otherwise
+ */
+TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
+{
+ /* Note, Port number should be specified in BIG endian to simplfy network code */
+
+ for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
+ {
+ /* Find port entry in the table */
+ if ((ConnectionStateTable[CSTableEntry].Port == Port) &&
+ IP_COMPARE(&ConnectionStateTable[CSTableEntry].RemoteAddress, &RemoteAddress) &&
+ ConnectionStateTable[CSTableEntry].RemotePort == RemotePort)
+ {
+ return &ConnectionStateTable[CSTableEntry].Info;
+ }
+ }
+
+ return NULL;
+}
+
+/** Processes a TCP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if one is created by a application handler.
+ *
+ * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
+ * \param TCPHeaderInStart Pointer to the start of the incomming packet's TCP header
+ * \param TCPHeaderOutStart Pointer to the start of the outgoing packet's TCP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no
+ * response was generated, NO_PROCESS if the packet processing was deferred until the
+ * next Ethernet packet handler iteration
+ */
+int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart)
+{
+ IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
+ TCP_Header_t* TCPHeaderIN = (TCP_Header_t*)TCPHeaderInStart;
+ TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)TCPHeaderOutStart;
+
+ TCP_ConnectionInfo_t* ConnectionInfo;
+
+ DecodeTCPHeader(TCPHeaderInStart);
+
+ bool PacketResponse = false;
+
+ /* Check if the destination port is open and allows incomming connections */
+ if (TCP_GetPortState(TCPHeaderIN->DestinationPort) == TCP_Port_Open)
+ {
+ /* Detect SYN from host to start a connection */
+ if (TCPHeaderIN->Flags & TCP_FLAG_SYN)
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort, TCP_Connection_Listen);
+
+ /* Detect RST from host to abort existing connection */
+ if (TCPHeaderIN->Flags & TCP_FLAG_RST)
+ {
+ TCPHeaderOUT->Flags = (TCP_FLAG_RST | TCP_FLAG_ACK);
+ PacketResponse = true;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_Closed);
+ }
+ else
+ {
+ /* Process the incomming TCP packet based on the current connection state for the sender and port */
+ switch (TCP_GetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort))
+ {
+ case TCP_Connection_Listen:
+ if (TCPHeaderIN->Flags == TCP_FLAG_SYN)
+ {
+ /* SYN connection when closed starts a connection with a peer */
+
+ TCPHeaderOUT->Flags = (TCP_FLAG_SYN | TCP_FLAG_ACK);
+ PacketResponse = true;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort,
+ TCP_Connection_SYNReceived);
+
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort);
+
+ ConnectionInfo->SequenceNumberIn = (SwapEndian_32(TCPHeaderIN->SequenceNumber) + 1);
+ ConnectionInfo->SequenceNumberOut = 0;
+ ConnectionInfo->Buffer.InUse = false;
+ }
+
+ break;
+ case TCP_Connection_SYNReceived:
+ if (TCPHeaderIN->Flags == TCP_FLAG_ACK)
+ {
+ /* ACK during the connection process completes the connection to a peer */
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_Established);
+
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ ConnectionInfo->SequenceNumberOut++;
+ }
+
+ break;
+ case TCP_Connection_Established:
+ if (TCPHeaderIN->Flags == (TCP_FLAG_FIN | TCP_FLAG_ACK))
+ {
+ /* FIN ACK when connected to a peer starts the finalization process */
+
+ TCPHeaderOUT->Flags = (TCP_FLAG_FIN | TCP_FLAG_ACK);
+ PacketResponse = true;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_CloseWait);
+
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ ConnectionInfo->SequenceNumberIn++;
+ ConnectionInfo->SequenceNumberOut++;
+ }
+ else if ((TCPHeaderIN->Flags == TCP_FLAG_ACK) || (TCPHeaderIN->Flags == (TCP_FLAG_ACK | TCP_FLAG_PSH)))
+ {
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ /* Check if the buffer is currently in use either by a buffered data to send, or receive */
+ if ((ConnectionInfo->Buffer.InUse == false) && (ConnectionInfo->Buffer.Ready == false))
+ {
+ ConnectionInfo->Buffer.Direction = TCP_PACKETDIR_IN;
+ ConnectionInfo->Buffer.InUse = true;
+ ConnectionInfo->Buffer.Length = 0;
+ }
+
+ /* Check if the buffer has been claimed by us to read in data from the peer */
+ if ((ConnectionInfo->Buffer.Direction == TCP_PACKETDIR_IN) &&
+ (ConnectionInfo->Buffer.Length != TCP_WINDOW_SIZE))
+ {
+ uint16_t IPOffset = (IPHeaderIN->HeaderLength * sizeof(uint32_t));
+ uint16_t TCPOffset = (TCPHeaderIN->DataOffset * sizeof(uint32_t));
+ uint16_t DataLength = (SwapEndian_16(IPHeaderIN->TotalLength) - IPOffset - TCPOffset);
+
+ /* Copy the packet data into the buffer */
+ memcpy(&ConnectionInfo->Buffer.Data[ConnectionInfo->Buffer.Length],
+ &((uint8_t*)TCPHeaderInStart)[TCPOffset],
+ DataLength);
+
+ ConnectionInfo->SequenceNumberIn += DataLength;
+ ConnectionInfo->Buffer.Length += DataLength;
+
+ /* Check if the buffer is full or if the PSH flag is set, if so indicate buffer ready */
+ if ((!(TCP_WINDOW_SIZE - ConnectionInfo->Buffer.Length)) || (TCPHeaderIN->Flags & TCP_FLAG_PSH))
+ {
+ ConnectionInfo->Buffer.InUse = false;
+ ConnectionInfo->Buffer.Ready = true;
+
+ TCPHeaderOUT->Flags = TCP_FLAG_ACK;
+ PacketResponse = true;
+ }
+ }
+ else
+ {
+ /* Buffer is currently in use by the application, defer processing of the incomming packet */
+ return NO_PROCESS;
+ }
+ }
+
+ break;
+ case TCP_Connection_Closing:
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ TCPHeaderOUT->Flags = (TCP_FLAG_ACK | TCP_FLAG_FIN);
+ PacketResponse = true;
+
+ ConnectionInfo->Buffer.InUse = false;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_FINWait1);
+
+ break;
+ case TCP_Connection_FINWait1:
+ if (TCPHeaderIN->Flags == (TCP_FLAG_FIN | TCP_FLAG_ACK))
+ {
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ TCPHeaderOUT->Flags = TCP_FLAG_ACK;
+ PacketResponse = true;
+
+ ConnectionInfo->SequenceNumberIn++;
+ ConnectionInfo->SequenceNumberOut++;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_Closed);
+ }
+ else if (TCPHeaderIN->Flags == TCP_FLAG_ACK)
+ {
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_FINWait2);
+ }
+
+ break;
+ case TCP_Connection_FINWait2:
+ if (TCPHeaderIN->Flags == (TCP_FLAG_FIN | TCP_FLAG_ACK))
+ {
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ TCPHeaderOUT->Flags = TCP_FLAG_ACK;
+ PacketResponse = true;
+
+ ConnectionInfo->SequenceNumberIn++;
+ ConnectionInfo->SequenceNumberOut++;
+
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_Closed);
+ }
+
+ break;
+ case TCP_Connection_CloseWait:
+ if (TCPHeaderIN->Flags == TCP_FLAG_ACK)
+ {
+ TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_Closed);
+ }
+
+ break;
+ }
+ }
+ }
+ else
+ {
+ /* Port is not open, indicate via a RST/ACK response to the sender */
+ TCPHeaderOUT->Flags = (TCP_FLAG_RST | TCP_FLAG_ACK);
+ PacketResponse = true;
+ }
+
+ /* Check if we need to respond to the sent packet */
+ if (PacketResponse)
+ {
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort);
+
+ TCPHeaderOUT->SourcePort = TCPHeaderIN->DestinationPort;
+ TCPHeaderOUT->DestinationPort = TCPHeaderIN->SourcePort;
+ TCPHeaderOUT->SequenceNumber = SwapEndian_32(ConnectionInfo->SequenceNumberOut);
+ TCPHeaderOUT->AcknowledgmentNumber = SwapEndian_32(ConnectionInfo->SequenceNumberIn);
+ TCPHeaderOUT->DataOffset = (sizeof(TCP_Header_t) / sizeof(uint32_t));
+
+ if (!(ConnectionInfo->Buffer.InUse))
+ TCPHeaderOUT->WindowSize = SwapEndian_16(TCP_WINDOW_SIZE);
+ else
+ TCPHeaderOUT->WindowSize = SwapEndian_16(TCP_WINDOW_SIZE - ConnectionInfo->Buffer.Length);
+
+ TCPHeaderOUT->UrgentPointer = 0;
+ TCPHeaderOUT->Checksum = 0;
+ TCPHeaderOUT->Reserved = 0;
+
+ TCPHeaderOUT->Checksum = TCP_Checksum16(TCPHeaderOUT, IPHeaderIN->DestinationAddress,
+ IPHeaderIN->SourceAddress, sizeof(TCP_Header_t));
+
+ return sizeof(TCP_Header_t);
+ }
+
+ return NO_RESPONSE;
+}
+
+/** Calculates the appropriate TCP checksum, consisting of the addition of the one's compliment of each word,
+ * complimented.
+ *
+ * \param TCPHeaderOutStart Pointer to the start of the packet's outgoing TCP header
+ * \param SourceAddress Source protocol IP address of the outgoing IP header
+ * \param SourceAddress DestinationAddress protocol IP address of the outgoing IP header
+ * \param TCPOutSize Size in bytes of the TCP data header and payload
+ *
+ * \return A 16-bit TCP checksum value
+ */
+static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
+ IP_Address_t DestinationAddress, uint16_t TCPOutSize)
+{
+ uint32_t Checksum = 0;
+
+ /* TCP/IP checksums are the addition of the one's compliment of each word including the IP psudo-header,
+ complimented */
+
+ Checksum += ((uint16_t*)&SourceAddress)[0];
+ Checksum += ((uint16_t*)&SourceAddress)[1];
+ Checksum += ((uint16_t*)&DestinationAddress)[0];
+ Checksum += ((uint16_t*)&DestinationAddress)[1];
+ Checksum += SwapEndian_16(PROTOCOL_TCP);
+ Checksum += SwapEndian_16(TCPOutSize);
+
+ for (uint8_t CurrWord = 0; CurrWord < (TCPOutSize >> 1); CurrWord++)
+ Checksum += ((uint16_t*)TCPHeaderOutStart)[CurrWord];
+
+ if (TCPOutSize & 0x01)
+ Checksum += (((uint16_t*)TCPHeaderOutStart)[TCPOutSize >> 1] & 0x00FF);
+
+ while (Checksum & 0xFFFF0000)
+ Checksum = ((Checksum & 0xFFFF) + (Checksum >> 16));
+
+ return ~Checksum;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.h
new file mode 100644
index 00000000..21254859
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/TCP.h
@@ -0,0 +1,253 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for TCP.c.
+ */
+
+#ifndef _TCP_H_
+#define _TCP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include <LUFA/Scheduler/Scheduler.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** Maximum number of TCP ports which can be open at the one time */
+ #define MAX_OPEN_TCP_PORTS 1
+
+ /** Maximum number of TCP connections which can be sustained at the one time */
+ #define MAX_TCP_CONNECTIONS 1
+
+ /** TCP window size, giving the maximum number of bytes which can be buffered at the one time */
+ #define TCP_WINDOW_SIZE 1024
+
+ /** Port number for HTTP transmissions */
+ #define TCP_PORT_HTTP SwapEndian_16(80)
+
+ /** Data direction indicator for a TCP application buffer, indicating data from host-to-device */
+ #define TCP_PACKETDIR_IN false
+
+ /** Data direction indicator for a TCP application buffer, indicating data from device-to-host */
+ #define TCP_PACKETDIR_OUT true
+
+ /** Congestion Window Reduced TCP flag mask */
+ #define TCP_FLAG_CWR (1 << 7)
+
+ /** Explicit Congestion Notification TCP flag mask */
+ #define TCP_FLAG_ECE (1 << 6)
+
+ /** Urgent TCP flag mask */
+ #define TCP_FLAG_URG (1 << 5)
+
+ /** Data Acknowledge TCP flag mask */
+ #define TCP_FLAG_ACK (1 << 4)
+
+ /** Data Push TCP flag mask */
+ #define TCP_FLAG_PSH (1 << 3)
+
+ /** Reset TCP flag mask */
+ #define TCP_FLAG_RST (1 << 2)
+
+ /** Synchronize TCP flag mask */
+ #define TCP_FLAG_SYN (1 << 1)
+
+ /** Connection Finalize TCP flag mask */
+ #define TCP_FLAG_FIN (1 << 0)
+
+ /** Application macro: Determines if the given application buffer contains a packet received from the host
+ *
+ * \param Buffer Application buffer to check
+ *
+ * \return Boolean true if the buffer contains a packet from the host, false otherwise
+ */
+ #define TCP_APP_HAS_RECEIVED_PACKET(Buffer) (Buffer->Ready && (Buffer->Direction == TCP_PACKETDIR_IN))
+
+ /** Application macro: Indicates if the application buffer is currently locked by the application for device-to-host transfers.
+ *
+ * \param Buffer Application buffer to check
+ *
+ * \return Boolean true if the buffer has been captured by the application for device-to-host transmissions, false otherwise
+ */
+ #define TCP_APP_HAVE_CAPTURED_BUFFER(Buffer) (!(Buffer->Ready) && Buffer->InUse && \
+ (Buffer->Direction == TCP_PACKETDIR_OUT))
+
+ /** Application macro: Indicates if the application can lock the buffer for multiple continued device-to-host transmissions.
+ *
+ * \param Buffer Application buffer to check
+ *
+ * \return Boolean true if the buffer may be captured by the application for device-to-host transmissions, false otherwise
+ */
+ #define TCP_APP_CAN_CAPTURE_BUFFER(Buffer) Buffer->InUse
+
+ /** Application macro: Captures the application buffer, locking it for device-to-host transmissions only. This should be
+ * performed when the application needs to transmit several packets worth of data in succession with no interruptions from the host.
+ *
+ * \note The application must check that the buffer can be locked first using TCP_APP_CAN_CAPTURE_BUFFER().
+ *
+ * \param Buffer Application buffer to lock
+ */
+ #define TCP_APP_CAPTURE_BUFFER(Buffer) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->InUse = true; }MACROE
+
+ /** Application macro: Releases a captured application buffer, allowing for host-to-device packets to be received.
+ *
+ * \param Buffer Application buffer to release
+ */
+ #define TCP_APP_RELEASE_BUFFER(Buffer) MACROS{ Buffer->InUse = false; }MACROE
+
+ /** Application macro: Sends the contents of the given application buffer to the host.
+ *
+ * \param Buffer Application buffer to send
+ * \param Len Length of data contained in the buffer
+ */
+ #define TCP_APP_SEND_BUFFER(Buffer, Len) MACROS{ Buffer->Direction = TCP_PACKETDIR_OUT; Buffer->Length = Len; Buffer->Ready = true; }MACROE
+
+ /** Application macro: Clears the application buffer, ready for a packet to be written to it.
+ *
+ * \param Buffer Application buffer to clear
+ */
+ #define TCP_APP_CLEAR_BUFFER(Buffer) MACROS{ Buffer->Ready = false; Buffer->Length = 0; }MACROE
+
+ /** Application macro: Closes an open connection to a host.
+ *
+ * \param Connection Open TCP connection to close
+ */
+ #define TCP_APP_CLOSECONNECTION(Connection) MACROS{ Connection->State = TCP_Connection_Closing; }MACROE
+
+ /* Enums: */
+ /** Enum for possible TCP port states */
+ enum TCP_PortStates_t
+ {
+ TCP_Port_Closed = 0, /**< TCP port closed, no connections to a host may be made on this port. */
+ TCP_Port_Open = 1, /**< TCP port open, connections to a host may be made on this port. */
+ };
+
+ /** Enum for possible TCP connection states */
+ enum TCP_ConnectionStates_t
+ {
+ TCP_Connection_Listen = 0, /**< Listening for a connection from a host */
+ TCP_Connection_SYNSent = 1, /**< Unused */
+ TCP_Connection_SYNReceived = 2, /**< SYN received, waiting for ACK */
+ TCP_Connection_Established = 3, /**< Connection established in both directions */
+ TCP_Connection_FINWait1 = 4, /**< Closing, waiting for ACK */
+ TCP_Connection_FINWait2 = 5, /**< Closing, waiting for FIN ACK */
+ TCP_Connection_CloseWait = 6, /**< Closing, waiting for ACK */
+ TCP_Connection_Closing = 7, /**< Unused */
+ TCP_Connection_LastACK = 8, /**< Unused */
+ TCP_Connection_TimeWait = 9, /**< Unused */
+ TCP_Connection_Closed = 10, /**< Connection closed in both directions */
+ };
+
+ /* Type Defines: */
+ /** Type define for a TCP connection buffer structure, including size, data and direction */
+ typedef struct
+ {
+ uint16_t Length; /**< Length of data in the TCP application buffer */
+ uint8_t Data[TCP_WINDOW_SIZE]; /**< TCP application data buffer */
+ bool Direction; /**< Buffer transmission direction, either TCP_PACKETDIR_IN or TCP_PACKETDIR_OUT */
+ bool Ready; /**< If data from host, indicates buffer ready to be read, otherwise indicates
+ * buffer ready to be sent to the host
+ */
+ bool InUse; /** Indicates if the buffer is locked to to the current direction, and cannot be changed */
+ } TCP_ConnectionBuffer_t;
+
+ /** Type define for a TCP connection information structure */
+ typedef struct
+ {
+ uint32_t SequenceNumberIn; /**< Current TCP sequence number for host-to-device */
+ uint32_t SequenceNumberOut; /**< Current TCP sequence number for device-to-host */
+ TCP_ConnectionBuffer_t Buffer; /**< Connection application data buffer */
+ } TCP_ConnectionInfo_t;
+
+ /** Type define for a complete TCP connection state */
+ typedef struct
+ {
+ uint16_t Port; /**< Connection port number on the device */
+ uint16_t RemotePort; /**< Connection port number on the host */
+ IP_Address_t RemoteAddress; /**< Connection protocol IP address of the host */
+ TCP_ConnectionInfo_t Info; /**< Connection information, including application buffer */
+ uint8_t State; /**< Current connection state, a value from the TCP_ConnectionStates_t enum */
+ } TCP_ConnectionState_t;
+
+ /** Type define for a TCP port state */
+ typedef struct
+ {
+ uint16_t Port; /**< TCP port number on the device */
+ uint8_t State; /**< Current port state, a value from the TCP_PortStates_t enum */
+ void (*ApplicationHandler) (TCP_ConnectionState_t* ConnectionState,
+ TCP_ConnectionBuffer_t* Buffer); /**< Port application handler */
+ } TCP_PortState_t;
+
+ /** Type define for a TCP packet header */
+ typedef struct
+ {
+ uint16_t SourcePort; /**< Source port of the TCP packet */
+ uint16_t DestinationPort; /**< Destination port of the TCP packet */
+
+ uint32_t SequenceNumber; /**< Data sequence number of the packet */
+ uint32_t AcknowledgmentNumber; /**< Data acknowledgment number of the packet */
+
+ unsigned int Reserved : 4; /**< Reserved, must be all 0 */
+ unsigned int DataOffset : 4; /**< Offset of the data from the start of the header, in 4 byte chunks */
+ uint8_t Flags; /**< TCP packet flags */
+ uint16_t WindowSize; /**< Current data window size (bytes remaning in reception buffer) */
+
+ uint16_t Checksum; /**< TCP checksum */
+ uint16_t UrgentPointer; /**< Urgent data pointer */
+ } TCP_Header_t;
+
+ /* Tasks: */
+ TASK(TCP_Task);
+
+ /* External Variables: */
+ TCP_PortState_t PortStateTable[MAX_OPEN_TCP_PORTS];
+
+ /* Function Prototypes: */
+ void TCP_Init(void);
+ bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
+ uint8_t TCP_GetPortState(uint16_t Port);
+ bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State);
+ uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
+ TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
+ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart);
+
+ #if defined(INCLUDE_FROM_TCP_C)
+ static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
+ IP_Address_t DestinationAddress, uint16_t TCPOutSize);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.c
new file mode 100644
index 00000000..3e1f9395
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.c
@@ -0,0 +1,80 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * User Datagram Protocol (UDP) packet handling routines. This protocol handles high throughput, low
+ * reliability packets which are typically used to encapsulate streaming data.
+ */
+
+#define INCLUDE_FROM_UDP_C
+#include "UDP.h"
+
+/** Processes a UDP packet inside an Ethernet frame, and writes the appropriate response
+ * to the output Ethernet frame if a subprotocol handler has created a response packet.
+ *
+ * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
+ * \param UDPHeaderInStart Pointer to the start of the incomming packet's UDP header
+ * \param UDPHeaderOutStart Pointer to the start of the outgoing packet's UDP header
+ *
+ * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
+ */
+int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart)
+{
+ UDP_Header_t* UDPHeaderIN = (UDP_Header_t*)UDPHeaderInStart;
+ UDP_Header_t* UDPHeaderOUT = (UDP_Header_t*)UDPHeaderOutStart;
+
+ int16_t RetSize = NO_RESPONSE;
+
+ DecodeUDPHeader(UDPHeaderInStart);
+
+ /* Check to see if the UDP packet is a DHCP packet */
+ if (SwapEndian_16(UDPHeaderIN->DestinationPort) == UDP_PORT_DHCP_REQUEST)
+ {
+ RetSize = DHCP_ProcessDHCPPacket(IPHeaderInStart,
+ &((uint8_t*)UDPHeaderInStart)[sizeof(UDP_Header_t)],
+ &((uint8_t*)UDPHeaderOutStart)[sizeof(UDP_Header_t)]);
+ }
+
+ /* Check to see if the protocol processing routine has filled out a response */
+ if (RetSize > 0)
+ {
+ /* Fill out the response UDP packet header */
+ UDPHeaderOUT->SourcePort = UDPHeaderIN->DestinationPort;
+ UDPHeaderOUT->DestinationPort = UDPHeaderIN->SourcePort;
+ UDPHeaderOUT->Checksum = 0;
+ UDPHeaderOUT->Length = SwapEndian_16(sizeof(UDP_Header_t) + RetSize);
+
+ /* Return the size of the response so far */
+ return (sizeof(UDP_Header_t) + RetSize);
+ }
+
+ return NO_RESPONSE;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.h
new file mode 100644
index 00000000..60bbe218
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/UDP.h
@@ -0,0 +1,66 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for IP.c.
+ */
+
+#ifndef _UDP_H_
+#define _UDP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "EthernetProtocols.h"
+ #include "Ethernet.h"
+ #include "ProtocolDecoders.h"
+
+ /* Macros: */
+ /** Source UDP port for a DHCP request */
+ #define UDP_PORT_DHCP_REQUEST 67
+
+ /** Destination UDP port for a DHCP reply */
+ #define UDP_PORT_DHCP_REPLY 68
+
+ /* Type Defines: */
+ /** Type define for a UDP packet header */
+ typedef struct
+ {
+ uint16_t SourcePort; /**< Packet source port */
+ uint16_t DestinationPort; /**< Packet destination port */
+ uint16_t Length; /**< Total packet length, in bytes */
+ uint16_t Checksum; /**< Optional UDP packet checksum */
+ } UDP_Header_t;
+
+ /* Function Prototypes: */
+ int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.c b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.c
new file mode 100644
index 00000000..c07f2c8b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.c
@@ -0,0 +1,162 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Simple webserver application for demonstrating the RNDIS demo and TCP/IP stack. This
+ * application will serve up a static HTTP webpage when requested by the host.
+ */
+
+#include "Webserver.h"
+
+/** HTTP server response header, for transmission before the page contents. This indicates to the host that a page exists at the
+ * given location, and gives extra connection information.
+ */
+char PROGMEM HTTPHeader[] = "HTTP/1.1 200 OK\r\n"
+ "Server: LUFA RNDIS\r\n"
+ "Content-type: text/html\r\n"
+ "Connection: close\r\n\r\n";
+
+/** HTTP page to serve to the host when a HTTP request is made. This page is too long for a single response, thus it is automatically
+ * broken up into smaller blocks and sent as a series of packets each time the webserver application callback is run.
+ */
+char PROGMEM HTTPPage[] =
+ "<html>"
+ " <head>"
+ " <title>"
+ " LUFA Webserver Demo"
+ " </title>"
+ " </head>"
+ " <body>"
+ " <h1>Hello from your USB AVR!</h1>"
+ " <p>"
+ " Hello! Welcome to the LUFA RNDIS Demo Webserver test page, running on your USB AVR via the LUFA library. This demonstrates the HTTP webserver, TCP/IP stack and RNDIS demo all running atop the LUFA USB stack."
+ " <br /><br />"
+ " <small>Project Information: <a href=\"http://www.fourwalledcubicle.com/LUFA.php\">http://www.fourwalledcubicle.com/LUFA.php</a>.</small>"
+ " <hr />"
+ " <i>LUFA Version: </i>" LUFA_VERSION_STRING
+ " </p>"
+ " </body>"
+ "</html>";
+
+
+/** Initializes the Webserver application, opening the appropriate HTTP port in the TCP handler and registering the application
+ * callback routine for packets sent to the HTTP protocol port.
+ */
+void Webserver_Init(void)
+{
+ /* Open the HTTP port in the TCP protocol so that HTTP connections to the device can be established */
+ TCP_SetPortState(TCP_PORT_HTTP, TCP_Port_Open, Webserver_ApplicationCallback);
+}
+
+/** Indicates if a given request equals the given HTTP command.
+ *
+ * \param RequestHeader HTTP request made by the host
+ * \param Command HTTP command to compare the request to
+ *
+ * \return Boolean true if the command matches the request, false otherwise
+ */
+static bool IsHTTPCommand(uint8_t* RequestHeader, char* Command)
+{
+ /* Returns true if the non null terminated string in RequestHeader matches the null terminated string Command */
+ return (strncmp((char*)RequestHeader, Command, strlen(Command)) == 0);
+}
+
+/** Application callback routine, executed each time the TCP processing task runs. This callback determines what request
+ * has been made (if any), and serves up appropriate responses.
+ *
+ * \param ConnectionState Pointer to a TCP Connection State structure giving connection information
+ * \param Buffer Pointer to the application's send/receive packet buffer
+ */
+void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer)
+{
+ char* BufferDataStr = (char*)Buffer->Data;
+ static uint8_t PageBlock = 0;
+
+ /* Check to see if a packet has been received on the HTTP port from a remote host */
+ if (TCP_APP_HAS_RECEIVED_PACKET(Buffer))
+ {
+ if (IsHTTPCommand(Buffer->Data, "GET"))
+ {
+ PageBlock = 0;
+
+ /* Copy the HTTP response header into the packet buffer */
+ strcpy_P(BufferDataStr, HTTPHeader);
+
+ /* Send the buffer contents to the host */
+ TCP_APP_SEND_BUFFER(Buffer, strlen(BufferDataStr));
+
+ /* Lock the buffer to Device->Host transmissions only while we send the page contents */
+ TCP_APP_CAPTURE_BUFFER(Buffer);
+ }
+ else if (IsHTTPCommand(Buffer->Data, "HEAD"))
+ {
+ /* Copy the HTTP response header into the packet buffer */
+ strcpy_P(BufferDataStr, HTTPHeader);
+
+ /* Send the buffer contents to the host */
+ TCP_APP_SEND_BUFFER(Buffer, strlen(BufferDataStr));
+ }
+ else if (IsHTTPCommand(Buffer->Data, "TRACE"))
+ {
+ /* Echo the host's query back to the host */
+ TCP_APP_SEND_BUFFER(Buffer, Buffer->Length);
+ }
+ else
+ {
+ /* Unknown request, just clear the buffer (drop the packet) */
+ TCP_APP_CLEAR_BUFFER(Buffer);
+ }
+ }
+ else if (TCP_APP_HAVE_CAPTURED_BUFFER(Buffer))
+ {
+ uint16_t RemLength = strlen_P(&HTTPPage[PageBlock * HTTP_REPLY_BLOCK_SIZE]);
+ uint16_t Length;
+
+ /* Determine the length of the loaded block */
+ Length = ((RemLength > HTTP_REPLY_BLOCK_SIZE) ? HTTP_REPLY_BLOCK_SIZE : RemLength);
+
+ /* Copy the next buffer sized block of the page to the packet buffer */
+ strncpy_P(BufferDataStr, &HTTPPage[PageBlock * HTTP_REPLY_BLOCK_SIZE], Length);
+
+ /* Send the buffer contents to the host */
+ TCP_APP_SEND_BUFFER(Buffer, Length);
+
+ /* Check to see if the entire page has been sent */
+ if (PageBlock++ == (sizeof(HTTPPage) / HTTP_REPLY_BLOCK_SIZE))
+ {
+ /* Unlock the buffer so that the host can fill it with future packets */
+ TCP_APP_RELEASE_BUFFER(Buffer);
+
+ /* Close the connection to the host */
+ TCP_APP_CLOSECONNECTION(ConnectionState);
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.h b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.h
new file mode 100644
index 00000000..b2193ad1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/Webserver.h
@@ -0,0 +1,55 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Webserver.c.
+ */
+
+#ifndef _WEBSERVER_H_
+#define _WEBSERVER_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+
+ #include <LUFA/Version.h>
+
+ #include "TCP.h"
+
+ /* Macros: */
+ /** Maximum size of a HTTP response per transmission */
+ #define HTTP_REPLY_BLOCK_SIZE 128
+
+ /* Function Prototypes: */
+ void Webserver_Init(void);
+ void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/makefile b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/makefile
new file mode 100644
index 00000000..48cd040a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/RNDISEthernet/makefile
@@ -0,0 +1,715 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = RNDISEthernet
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ RNDIS.c \
+ Ethernet.c \
+ ProtocolDecoders.c \
+ ICMP.c \
+ TCP.c \
+ UDP.c \
+ DHCP.c \
+ ARP.c \
+ IP.c \
+ Webserver.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.c
new file mode 100644
index 00000000..a336c1f5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.c
@@ -0,0 +1,191 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Configuration Descriptor processing routines, to determine the correct pipe configurations
+ * needed to communication with an attached USB device. Descriptors are special computer-readable structures
+ * which the host requests upon device enumeration, to determine the device's capabilities and functions.
+ */
+
+#include "ConfigDescriptor.h"
+
+/** Reads and processes an attached device's descriptors, to determine compatibility and pipe configurations. This
+ * routine will read in the entire configuration descriptor, and configure the hosts pipes to correctly communicate
+ * with compatible devices.
+ *
+ * This routine searches for a SI interface descriptor containing bulk IN and OUT data endpoints.
+ *
+ * \return An error code from the StillImageHost_GetConfigDescriptorDataCodes_t enum.
+ */
+uint8_t ProcessConfigurationDescriptor(void)
+{
+ uint8_t* ConfigDescriptorData;
+ uint16_t ConfigDescriptorSize;
+ uint8_t FoundEndpoints = 0;
+
+ /* Get Configuration Descriptor size from the device */
+ if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ return ControlError;
+
+ /* Ensure that the Configuration Descriptor isn't too large */
+ if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
+ return DescriptorTooLarge;
+
+ /* Allocate enough memory for the entire config descriptor */
+ ConfigDescriptorData = alloca(ConfigDescriptorSize);
+
+ /* Retrieve the entire configuration descriptor into the allocated buffer */
+ USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+
+ /* Validate returned data - ensure first entry is a configuration header descriptor */
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return InvalidConfigDataReturned;
+
+ /* Get the Still Image interface from the configuration descriptor */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextStillImageInterface))
+ {
+ /* Descriptor not found, error out */
+ return NoInterfaceFound;
+ }
+
+ /* Get the IN and OUT data and event endpoints for the Still Image interface */
+ while (FoundEndpoints != ((1 << SIMAGE_EVENTS_PIPE) | (1 << SIMAGE_DATA_IN_PIPE) | (1 << SIMAGE_DATA_OUT_PIPE)))
+ {
+ /* Fetch the next endpoint from the current Still Image interface */
+ if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextSImageInterfaceDataEndpoint))
+ {
+ /* Descriptor not found, error out */
+ return NoEndpointFound;
+ }
+
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ /* Check if the found endpoint is a interrupt or bulk type descriptor */
+ if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)
+ {
+ /* If the endpoint is a IN type interrupt endpoint */
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Configure the events pipe */
+ Pipe_ConfigurePipe(SIMAGE_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+
+ Pipe_SetInfiniteINRequests();
+ Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
+
+ /* Set the flag indicating that the events pipe has been found */
+ FoundEndpoints |= (1 << SIMAGE_EVENTS_PIPE);
+ }
+ }
+ else
+ {
+ /* Check if the endpoint is a bulk IN or bulk OUT endpoint */
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ /* Configure the data IN pipe */
+ Pipe_ConfigurePipe(SIMAGE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+
+ Pipe_SetInfiniteINRequests();
+
+ /* Set the flag indicating that the data IN pipe has been found */
+ FoundEndpoints |= (1 << SIMAGE_DATA_IN_PIPE);
+ }
+ else
+ {
+ /* Configure the data OUT pipe */
+ Pipe_ConfigurePipe(SIMAGE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+
+ /* Set the flag indicating that the data OUT pipe has been found */
+ FoundEndpoints |= (1 << SIMAGE_DATA_OUT_PIPE);
+ }
+ }
+ }
+
+ /* Valid data found, return success */
+ return SuccessfulConfigRead;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interface descriptor of the correct Still Image Class, Subclass and Protocol values.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextStillImageInterface)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ /* Check the descriptor class and protocol, break out if correct class/protocol interface found */
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == SIMAGE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == SIMAGE_SUBCLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == SIMAGE_PROTOCOL))
+ {
+ return Descriptor_Search_Found;
+ }
+ }
+
+ return Descriptor_Search_NotFound;
+}
+
+/** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's
+ * configuration descriptor, to search for a specific sub descriptor. It can also be used to abort the configuration
+ * descriptor processing if an incompatible descriptor configuration is found.
+ *
+ * This comparator searches for the next Interrupt or Bulk Endpoint descriptor of the current SI interface, aborting the
+ * search if another interface descriptor is found before the next endpoint.
+ *
+ * \return A value from the DSEARCH_Return_ErrorCodes_t enum
+ */
+DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,
+ USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);
+
+ if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))
+ return Descriptor_Search_Found;
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return Descriptor_Search_Fail;
+ }
+
+ return Descriptor_Search_NotFound;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.h
new file mode 100644
index 00000000..f791488b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/ConfigDescriptor.h
@@ -0,0 +1,77 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for ConfigDescriptor.c.
+ */
+
+#ifndef _CONFIGDESCRIPTOR_H_
+#define _CONFIGDESCRIPTOR_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
+
+ #include "StillImageHost.h"
+
+ /* Macros: */
+ /** Interface Class value for the Still Image Device class */
+ #define SIMAGE_CLASS 0x06
+
+ /** Interface Class value for the Still Image Device subclass */
+ #define SIMAGE_SUBCLASS 0x01
+
+ /** Interface Class value for the Still Image Device protocol */
+ #define SIMAGE_PROTOCOL 0x01
+
+ /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */
+ #define MAX_CONFIG_DESCRIPTOR_SIZE 512
+
+ /* Enums: */
+ /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */
+ enum MassStorageHost_GetConfigDescriptorDataCodes_t
+ {
+ SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */
+ ControlError = 1, /**< A control request to the device failed to complete successfully */
+ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */
+ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */
+ NoInterfaceFound = 4, /**< A compatible SI interface was not found in the device's Configuration Descriptor */
+ NoEndpointFound = 5, /**< The correct SI endpoint descriptors were not found in the device's SI interface */
+ };
+
+ /* Configuration Descriptor Comparison Functions: */
+ DESCRIPTOR_COMPARATOR(NextStillImageInterface);
+ DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint);
+
+ /* Function Prototypes: */
+ uint8_t ProcessConfigurationDescriptor(void);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/StillImageHost/Doxygen.conf
new file mode 100644
index 00000000..d3a494a5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Still Image Host Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/PIMACodes.h b/digital/avr/modules/usb/lufa/Demos/StillImageHost/PIMACodes.h
new file mode 100644
index 00000000..38755aba
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/PIMACodes.h
@@ -0,0 +1,51 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header containing macros for possible PIMA commands. Refer to the PIMA standard
+ * documentation for more information on each PIMA command.
+ */
+
+#ifndef _PIMA_CODES_H_
+
+ /* Macros: */
+ #define PIMA_OPERATION_GETDEVICEINFO 0x1001
+ #define PIMA_OPERATION_OPENSESSION 0x1002
+ #define PIMA_OPERATION_CLOSESESSION 0x1003
+
+ #define PIMA_RESPONSE_OK 0x2001
+ #define PIMA_RESPONSE_GENERALERROR 0x2002
+ #define PIMA_RESPONSE_SESSIONNOTOPEN 0x2003
+ #define PIMA_RESPONSE_INVALIDTRANSACTIONID 0x2004
+ #define PIMA_RESPONSE_OPERATIONNOTSUPPORTED 0x2005
+ #define PIMA_RESPONSE_PARAMETERNOTSUPPORTED 0x2006
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.c b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.c
new file mode 100644
index 00000000..969ff5af
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.c
@@ -0,0 +1,273 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Still Image Device commands, to issue PIMA commands to the device for
+ * reading device status, capacity, and other characteristics as well as
+ * reading and writing of stored image data.
+ */
+
+#include "StillImageCommands.h"
+
+/* Globals: */
+/** PIMA block container for the block to send to the device */
+PIMA_Container_t PIMA_SendBlock;
+
+/** PIMA block container for the last received block from the device */
+PIMA_Container_t PIMA_ReceivedBlock;
+
+/** PIMA block container for the last event block received from the device */
+PIMA_Container_t PIMA_EventBlock;
+
+
+/** Function to send the PIMA command container to the attached still image device. */
+void SImage_SendBlockHeader(void)
+{
+ /* Unfreeze the data OUT pipe ready for data transmission */
+ Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
+
+ /* Write the PIMA block to the data OUT pipe */
+ Pipe_Write_Stream_LE(&PIMA_SendBlock, PIMA_COMMAND_SIZE(0));
+
+ /* If the block type is a command, send its parameters (if any) */
+ if (PIMA_SendBlock.Type == CType_CommandBlock)
+ {
+ /* Determine the size of the parameters in the block via the data length attribute */
+ uint8_t ParamBytes = (PIMA_SendBlock.DataLength - PIMA_COMMAND_SIZE(0));
+
+ /* Check if any parameters in the command block */
+ if (ParamBytes)
+ {
+ /* Write the PIMA parameters to the data OUT pipe */
+ Pipe_Write_Stream_LE(&PIMA_SendBlock.Params, ParamBytes);
+ }
+
+ /* Send the PIMA command block to the attached device */
+ Pipe_ClearCurrentBank();
+ }
+
+ /* Freeze pipe after use */
+ Pipe_Freeze();
+}
+
+/** Function to receive a PIMA event container from the attached still image device. */
+void SImage_RecieveEventHeader(void)
+{
+ /* Unfreeze the events pipe */
+ Pipe_SelectPipe(SIMAGE_EVENTS_PIPE);
+ Pipe_Unfreeze();
+
+ /* Read in the event data into the global structure */
+ Pipe_Read_Stream_LE(&PIMA_EventBlock, sizeof(PIMA_EventBlock));
+
+ /* Clear the pipe after read complete to prepare for next event */
+ Pipe_ClearCurrentBank();
+
+ /* Freeze the event pipe again after use */
+ Pipe_Freeze();
+}
+
+/** Function to receive a PIMA response container from the attached still image device. */
+uint8_t SImage_RecieveBlockHeader(void)
+{
+ uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
+
+ /* Unfreeze the data IN pipe */
+ Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
+
+ /* Wait until data received on the IN pipe */
+ while (!(Pipe_ReadWriteAllowed()))
+ {
+ /* Check to see if a new frame has been issued (1ms elapsed) */
+ if (USB_INT_HasOccurred(USB_INT_HSOFI))
+ {
+ /* Clear the flag and decrement the timout period counter */
+ USB_INT_Clear(USB_INT_HSOFI);
+ TimeoutMSRem--;
+
+ /* Check to see if the timeout period for the command has elapsed */
+ if (!(TimeoutMSRem))
+ {
+ /* Return error code */
+ return PIPE_RWSTREAM_ERROR_Timeout;
+ }
+ }
+
+ Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);
+
+ /* Check if pipe stalled (command failed by device) */
+ if (Pipe_IsStalled())
+ {
+ /* Clear the stall condition on the OUT pipe */
+ SImage_ClearPipeStall(SIMAGE_DATA_OUT_PIPE);
+
+ /* Return error code and break out of the loop */
+ return PIPE_RWSTREAM_ERROR_PipeStalled;
+ }
+
+ Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);
+
+ /* Check if pipe stalled (command failed by device) */
+ if (Pipe_IsStalled())
+ {
+ /* Clear the stall condition on the IN pipe */
+ SImage_ClearPipeStall(SIMAGE_DATA_IN_PIPE);
+
+ /* Return error code */
+ return PIPE_RWSTREAM_ERROR_PipeStalled;
+ }
+
+ /* Check to see if the device was disconnected, if so exit function */
+ if (!(USB_IsConnected))
+ {
+ /* Return error code */
+ return PIPE_RWSTREAM_ERROR_DeviceDisconnected;
+ }
+ };
+
+ /* Freeze OUT pipe after use */
+ Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);
+ Pipe_Freeze();
+
+ /* Select the IN data pipe for data reception */
+ Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);
+
+ /* Load in the response from the attached device */
+ Pipe_Read_Stream_LE(&PIMA_ReceivedBlock, PIMA_COMMAND_SIZE(0));
+
+ /* Check if the returned block type is a response block */
+ if (PIMA_ReceivedBlock.Type == CType_ResponseBlock)
+ {
+ /* Determine the size of the parameters in the block via the data length attribute */
+ uint8_t ParamBytes = (PIMA_ReceivedBlock.DataLength - PIMA_COMMAND_SIZE(0));
+
+ /* Check if the device has returned any parameters */
+ if (ParamBytes)
+ {
+ /* Read the PIMA parameters from the data IN pipe */
+ Pipe_Read_Stream_LE(&PIMA_ReceivedBlock.Params, ParamBytes);
+ }
+
+ /* Clear pipe bank after use */
+ Pipe_ClearCurrentBank();
+ }
+
+ /* Freeze the IN pipe after use */
+ Pipe_Freeze();
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+/** Function to send the given data to the device, after a command block has been issued.
+ *
+ * \param Buffer Source data buffer to send to the device
+ * \param Bytes Number of bytes to send
+ */
+void SImage_SendData(void* Buffer, uint16_t Bytes)
+{
+ /* Unfreeze the data OUT pipe */
+ Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
+
+ /* Write the data contents to the pipe */
+ Pipe_Write_Stream_LE(Buffer, Bytes);
+
+ /* Freeze the pipe again after use */
+ Pipe_Freeze();
+}
+
+/** Function to receive the given data to the device, after a response block has been received.
+ *
+ * \param Buffer Destination data buffer to put read bytes from the device
+ * \param Bytes Number of bytes to receive
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
+ */
+uint8_t SImage_ReadData(void* Buffer, uint16_t Bytes)
+{
+ uint8_t ErrorCode;
+
+ /* Unfreeze the data IN pipe */
+ Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
+
+ /* Read in the data into the buffer */
+ ErrorCode = Pipe_Read_Stream_LE(Buffer, Bytes);
+
+ /* Freeze the pipe again after use */
+ Pipe_Freeze();
+
+ return ErrorCode;
+}
+
+/** Function to test if a PIMA event block is waiting to be read in from the attached device.
+ *
+ * \return True if an event is waiting to be read in from the device, false otherwise
+ */
+bool SImage_IsEventReceived(void)
+{
+ bool IsEventReceived = false;
+
+ /* Unfreeze the Event pipe */
+ Pipe_SelectPipe(SIMAGE_EVENTS_PIPE);
+ Pipe_Unfreeze();
+
+ /* If the pipe contains data, an event has been received */
+ if (Pipe_BytesInPipe())
+ IsEventReceived = true;
+
+ /* Freeze the pipe after use */
+ Pipe_Freeze();
+
+ return IsEventReceived;
+}
+
+/** Clears the stall condition in the attached device on the nominated endpoint number.
+ *
+ * \param EndpointNum Endpoint number in the attached device whose stall condition is to be cleared
+ *
+ * \return A value from the USB_Host_SendControlErrorCodes_t enum
+ */
+uint8_t SImage_ClearPipeStall(const uint8_t PipeEndpointNum)
+{
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
+ bRequest: REQ_ClearFeature,
+ wValue: FEATURE_ENDPOINT_HALT,
+ wIndex: PipeEndpointNum,
+ wLength: 0,
+ };
+
+ return USB_Host_SendControlRequest(NULL);
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.h b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.h
new file mode 100644
index 00000000..5679deae
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageCommands.h
@@ -0,0 +1,102 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for StillImageCommands.c.
+ */
+
+#ifndef _STILL_IMAGE_COMMANDS_H_
+#define _STILL_IMAGE_COMMANDS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+
+ #include "PIMACodes.h"
+
+ /* Macros: */
+ /** Pipe number of the Still Image data IN pipe */
+ #define SIMAGE_DATA_IN_PIPE 0x01
+
+ /** Pipe number of the Still Image data OUT pipe */
+ #define SIMAGE_DATA_OUT_PIPE 0x02
+
+ /** Pipe number of the Still Image events pipe */
+ #define SIMAGE_EVENTS_PIPE 0x03
+
+ /** Timeout period between the issuing of a command to a device, and the reception of the first packet */
+ #define COMMAND_DATA_TIMEOUT_MS 5000
+
+ /** Used in the DataLength field of a PIMA container, to give the total container size in bytes.
+ *
+ * \param params Number of parameters which are to be sent in the Param field of the container
+ */
+ #define PIMA_COMMAND_SIZE(params) ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + \
+ (params * sizeof(PIMA_SendBlock.Params[0])))
+
+ /* Type Defines: */
+ /** Type define for a PIMA container, use to send commands and receieve responses to and from an
+ * attached Still Image device.
+ */
+ typedef struct
+ {
+ uint32_t DataLength; /**< Length of the container and data, in bytes */
+ uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */
+ uint16_t Code; /**< Command, event or response code of the container */
+ uint32_t TransactionID; /**< Unique container ID to link blocks together */
+ uint32_t Params[4]; /**< Block parameters to be issued along with the block code */
+ } PIMA_Container_t;
+
+ /* Enums: */
+ /** Enum for the possible PIMA contains types. */
+ enum PIMA_Container_Types_t
+ {
+ CType_Undefined = 0, /**< Undefined container type */
+ CType_CommandBlock = 1, /**< Command Block container type */
+ CType_DataBlock = 2, /**< Data Block container type */
+ CType_ResponseBlock = 3, /**< Response container type */
+ CType_EventBlock = 4, /**< Event Block container type */
+ };
+
+ /* External Variables: */
+ extern PIMA_Container_t PIMA_SendBlock;
+ extern PIMA_Container_t PIMA_ReceivedBlock;
+ extern PIMA_Container_t PIMA_EventBlock;
+
+ /* Function Prototypes: */
+ void SImage_SendBlockHeader(void);
+ uint8_t SImage_RecieveBlockHeader(void);
+ void SImage_RecieveEventHeader(void);
+ void SImage_SendData(void* Buffer, uint16_t Bytes);
+ uint8_t SImage_ReadData(void* Buffer, uint16_t Bytes);
+ bool SImage_IsEventReceived(void);
+ uint8_t SImage_ClearPipeStall(const uint8_t PipeEndpointNum);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.aps b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.aps
new file mode 100644
index 00000000..cf2f1d8e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>StillImageHost</ProjectName><Created>30-Sep-2008 14:17:41</Created><LastEdit>30-Sep-2008 14:17:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:17:41</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\StillImageHost\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>ConfigDescriptor.c</SOURCEFILE><SOURCEFILE>StillImageCommands.c</SOURCEFILE><SOURCEFILE>StillImageHost.c</SOURCEFILE><HEADERFILE>ConfigDescriptor.h</HEADERFILE><HEADERFILE>PIMACodes.h</HEADERFILE><HEADERFILE>StillImageCommands.h</HEADERFILE><HEADERFILE>StillImageHost.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>StillImageHost.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.c b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.c
new file mode 100644
index 00000000..50b2054d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.c
@@ -0,0 +1,436 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the StillImageHost demo. This file contains the main tasks of
+ * the demo and is responsible for the initial application hardware configuration.
+ */
+
+#include "StillImageHost.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA SIMG Host App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_SImage_Host , TaskStatus: TASK_STOP },
+};
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ CLKPR = (1 << CLKPCE);
+ CLKPR = 0;
+
+ /* Hardware Initialization */
+ SerialStream_Init(9600, false);
+ LEDs_Init();
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Startup message */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "Still Image Host Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR("Device Attached.\r\n"));
+ UpdateStatus(Status_USBEnumerating);
+
+ /* Start USB management task to enumerate the device */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and
+ * stops the library USB task management process.
+ */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ /* Stop USB management and Still Image tasks */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(USB_SImage_Host, TASK_STOP);
+
+ puts_P(PSTR("\r\nDevice Unattached.\r\n"));
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully
+ * enumerated by the host and is now ready to be used by the application.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ /* Once device is fully enumerated, start the Still Image Host task */
+ Scheduler_SetTaskMode(USB_SImage_Host, TASK_RUN);
+
+ /* Indicate device enumeration complete */
+ UpdateStatus(Status_USBReady);
+}
+
+/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
+EVENT_HANDLER(USB_HostError)
+{
+ USB_ShutDown();
+
+ puts_P(PSTR(ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ UpdateStatus(Status_HardwareError);
+ for(;;);
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while
+ * enumerating an attached USB device.
+ */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);
+ printf_P(PSTR(" -- In State %d\r\n"), USB_HostState);
+
+ UpdateStatus(Status_EnumerationError);
+}
+
+/** Task to set the configuration of the attached device after it has been enumerated, and to print device information
+ * through the serial port.
+ */
+TASK(USB_SImage_Host)
+{
+ uint8_t ErrorCode;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_Addressed:
+ /* Standard request to set the device configuration to configuration 1 */
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetConfiguration,
+ wValue: 1,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ /* Send the request, display error and wait for device detatch if request fails */
+ if (USB_Host_SendControlRequest(NULL) != HOST_SENDCONTROL_Successful)
+ {
+ puts_P(PSTR("Control error.\r\n"));
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Configured;
+ break;
+ case HOST_STATE_Configured:
+ puts_P(PSTR("Getting Config Data.\r\n"));
+
+ /* Get and process the configuration descriptor data */
+ if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
+ {
+ if (ErrorCode == ControlError)
+ puts_P(PSTR("Control Error (Get Configuration).\r\n"));
+ else
+ puts_P(PSTR("Invalid Device.\r\n"));
+
+ printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_EnumerationError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+ break;
+ }
+
+ puts_P(PSTR("Still Image Device Enumerated.\r\n"));
+
+ USB_HostState = HOST_STATE_Ready;
+ break;
+ case HOST_STATE_Ready:
+ /* Indicate device busy via the status LEDs */
+ UpdateStatus(Status_Busy);
+
+ puts_P(PSTR("Retrieving Device Info...\r\n"));
+
+ PIMA_SendBlock = (PIMA_Container_t)
+ {
+ DataLength: PIMA_COMMAND_SIZE(0),
+ Type: CType_CommandBlock,
+ Code: PIMA_OPERATION_GETDEVICEINFO,
+ TransactionID: 0x00000000,
+ Params: {},
+ };
+
+ /* Send the GETDEVICEINFO block */
+ SImage_SendBlockHeader();
+
+ /* Recieve the response data block */
+ if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ ShowCommandError(ErrorCode, false);
+ break;
+ }
+
+ /* Calculate the size of the returned device info data structure */
+ uint16_t DeviceInfoSize = (PIMA_ReceivedBlock.DataLength - PIMA_COMMAND_SIZE(0));
+
+ /* Create a buffer large enough to hold the entire device info */
+ uint8_t DeviceInfo[DeviceInfoSize];
+
+ /* Read in the data block data (containing device info) */
+ SImage_ReadData(DeviceInfo, DeviceInfoSize);
+
+ /* Once all the data has been read, the pipe must be cleared before the response can be sent */
+ Pipe_ClearCurrentBank();
+
+ /* Create a pointer for walking through the info dataset */
+ uint8_t* DeviceInfoPos = DeviceInfo;
+
+ /* Skip over the data before the unicode device information strings */
+ DeviceInfoPos += 8; // Skip to VendorExtensionDesc String
+ DeviceInfoPos += ((*DeviceInfoPos << 1) + 1); // Skip over VendorExtensionDesc String
+ DeviceInfoPos += 2; // Skip over FunctionalMode
+ DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over OperationCode Array
+ DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over EventCode Array
+ DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over DevicePropCode Array
+ DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over ObjectFormatCode Array
+ DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over ObjectFormatCode Array
+
+ /* Extract and convert the Manufacturer Unicode string to ASCII and print it through the USART */
+ char Manufacturer[*DeviceInfoPos];
+ UnicodeToASCII(DeviceInfoPos, Manufacturer);
+ printf_P(PSTR(" Manufacturer: %s\r\n"), Manufacturer);
+
+ DeviceInfoPos += ((*DeviceInfoPos << 1) + 1); // Skip over Manufacturer String
+
+ /* Extract and convert the Model Unicode string to ASCII and print it through the USART */
+ char Model[*DeviceInfoPos];
+ UnicodeToASCII(DeviceInfoPos, Model);
+ printf_P(PSTR(" Model: %s\r\n"), Model);
+
+ DeviceInfoPos += ((*DeviceInfoPos << 1) + 1); // Skip over Model String
+
+ /* Extract and convert the Device Version Unicode string to ASCII and print it through the USART */
+ char DeviceVersion[*DeviceInfoPos];
+ UnicodeToASCII(DeviceInfoPos, DeviceVersion);
+ printf_P(PSTR(" Device Version: %s\r\n"), DeviceVersion);
+
+ /* Recieve the final response block from the device */
+ if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ ShowCommandError(ErrorCode, false);
+ break;
+ }
+
+ /* Verify that the command completed successfully */
+ if ((PIMA_ReceivedBlock.Type != CType_ResponseBlock) || (PIMA_ReceivedBlock.Code != PIMA_RESPONSE_OK))
+ {
+ ShowCommandError(PIMA_ReceivedBlock.Code, true);
+ break;
+ }
+
+ puts_P(PSTR("Opening Session...\r\n"));
+
+ PIMA_SendBlock = (PIMA_Container_t)
+ {
+ DataLength: PIMA_COMMAND_SIZE(1),
+ Type: CType_CommandBlock,
+ Code: PIMA_OPERATION_OPENSESSION,
+ TransactionID: 0x00000000,
+ Params: {0x00000001},
+ };
+
+ /* Send the OPENSESSION block, open a session with an ID of 0x0001 */
+ SImage_SendBlockHeader();
+
+ /* Recieve the response block from the device */
+ if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ ShowCommandError(ErrorCode, false);
+ break;
+ }
+
+ /* Verify that the command completed successfully */
+ if ((PIMA_ReceivedBlock.Type != CType_ResponseBlock) || (PIMA_ReceivedBlock.Code != PIMA_RESPONSE_OK))
+ {
+ ShowCommandError(PIMA_ReceivedBlock.Code, true);
+ break;
+ }
+
+ puts_P(PSTR("Closing Session...\r\n"));
+
+ PIMA_SendBlock = (PIMA_Container_t)
+ {
+ DataLength: PIMA_COMMAND_SIZE(1),
+ Type: CType_CommandBlock,
+ Code: PIMA_OPERATION_CLOSESESSION,
+ TransactionID: 0x00000001,
+ Params: {0x00000001},
+ };
+
+ /* Send the CLOSESESSION block, close the session with an ID of 0x0001 */
+ SImage_SendBlockHeader();
+
+ /* Recieve the response block from the device */
+ if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)
+ {
+ ShowCommandError(ErrorCode, false);
+ break;
+ }
+
+ /* Verify that the command completed successfully */
+ if ((PIMA_ReceivedBlock.Type != CType_ResponseBlock) || (PIMA_ReceivedBlock.Code != PIMA_RESPONSE_OK))
+ {
+ ShowCommandError(PIMA_ReceivedBlock.Code, true);
+ break;
+ }
+
+ puts_P(PSTR("Done.\r\n"));
+
+ /* Indicate device no longer busy */
+ UpdateStatus(Status_USBReady);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+
+ break;
+ }
+}
+
+/** Function to convert a given Unicode encoded string to ASCII. This function will only work correctly on Unicode
+ * strings which contain ASCII printable characters only.
+ *
+ * \param UnicodeString Pointer to a Unicode encoded input string
+ * \param Buffer Pointer to a buffer where the converted ASCII string should be stored
+ */
+void UnicodeToASCII(uint8_t* UnicodeString, char* Buffer)
+{
+ /* Get the number of characters in the string, skip to the start of the string data */
+ uint8_t CharactersRemaining = *(UnicodeString++);
+
+ /* Loop through the entire unicode string */
+ while (CharactersRemaining--)
+ {
+ /* Load in the next unicode character (only the lower byte, only Unicode coded ASCII supported) */
+ *(Buffer++) = *UnicodeString;
+
+ /* Jump to the next unicode character */
+ UnicodeString += 2;
+ }
+
+ /* Null terminate the string */
+ *Buffer = 0;
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the StillImageHost_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2);
+ break;
+ case Status_EnumerationError:
+ case Status_HardwareError:
+ case Status_PIMACommandError:
+ LEDMask = (LEDS_LED1 | LEDS_LED3);
+ break;
+ case Status_Busy:
+ LEDMask = (LEDS_LED1 | LEDS_LED3 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Displays a PIMA command error via the device's serial port.
+ *
+ * \param ErrorCode Error code of the function which failed to complete successfully
+ * \param ResponseErrorCode Indicates if the error is due to a command failed indication from the device, or a communication failure
+ */
+void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError)
+{
+ char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail"));
+
+ printf_P(PSTR(ESC_BG_RED "Command Error (%S).\r\n"), FailureType);
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ UpdateStatus(Status_PIMACommandError);
+
+ /* Wait until USB device disconnected */
+ while (USB_IsConnected);
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.h b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.h
new file mode 100644
index 00000000..5669c827
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.h
@@ -0,0 +1,83 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for StillImageHost.c.
+ */
+
+#ifndef _STILL_IMAGE_HOST_H_
+#define _STILL_IMAGE_HOST_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <stdio.h>
+
+ #include "ConfigDescriptor.h"
+ #include "PIMACodes.h"
+ #include "StillImageCommands.h"
+
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LED driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Enums: */
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum StillImageHost_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB device) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */
+ Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */
+ Status_Busy = 5, /**< Busy reading or writing to the attached Still Image device */
+ Status_PIMACommandError = 6, /**< Error while sending or receiving a PIM command to the attached device */
+ };
+
+ /* Task Definitions: */
+ TASK(USB_SImage_Host);
+
+ /* Event Handlers: */
+ HANDLES_EVENT(USB_DeviceAttached);
+ HANDLES_EVENT(USB_DeviceUnattached);
+ HANDLES_EVENT(USB_DeviceEnumerationComplete);
+ HANDLES_EVENT(USB_HostError);
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /* Function Prototypes: */
+ void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer);
+ void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.txt b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.txt
new file mode 100644
index 00000000..6e2657be
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/StillImageHost.txt
@@ -0,0 +1,40 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Still Image Host Demo
+ *
+ * Still Image host demonstration application. This gives a simple reference
+ * application for implementing a Still Image host, for USB devices such as
+ * digital cameras.
+ *
+ * This demo will enumerate an attached USB Still Image device, print out its
+ * information structure, open a session with the device and finally close the
+ * session.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Still Image Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Still Image Class Specification</td>
+ * <td>PIMA 15740 Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/StillImageHost/makefile b/digital/avr/modules/usb/lufa/Demos/StillImageHost/makefile
new file mode 100644
index 00000000..83664e47
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/StillImageHost/makefile
@@ -0,0 +1,705 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = StillImageHost
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ ConfigDescriptor.c \
+ StillImageCommands.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/Class/ConfigDescriptor.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion:
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+## Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.c
new file mode 100644
index 00000000..fc56660b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.c
@@ -0,0 +1,187 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2040,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: ( sizeof(USB_Descriptor_Configuration_Header_t)
+ + sizeof(USB_Descriptor_Interface_t) ),
+
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 0,
+
+ Class: 0xFF,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(9), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.h
new file mode 100644
index 00000000..88c0a5e7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/Descriptors.h
@@ -0,0 +1,59 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */
+ USB_Descriptor_Interface_t Interface; /**< Interface descriptor, required for the device to enumerate */
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/TestApp/Doxygen.conf
new file mode 100644
index 00000000..80e1b7e4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - Test Application Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.aps b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.aps
new file mode 100644
index 00000000..6939268c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>TestApp</ProjectName><Created>30-Sep-2008 14:18:11</Created><LastEdit>30-Sep-2008 14:18:23</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:18:11</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\TestApp\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>TestApp.c</SOURCEFILE><SOURCEFILE>TestEvents.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>TestApp.h</HEADERFILE><HEADERFILE>TestEvents.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>TestApp.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.c b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.c
new file mode 100644
index 00000000..e7ee526d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.c
@@ -0,0 +1,198 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the TestApp demo. This file contains the main tasks of the demo and
+ * is responsible for the initial application hardware configuration.
+ */
+
+#include "TestApp.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA Test App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: TestApp_CheckJoystick, TaskStatus: TASK_RUN },
+ { Task: TestApp_CheckHWB , TaskStatus: TASK_RUN },
+ { Task: TestApp_CheckTemp , TaskStatus: TASK_RUN },
+ { Task: USB_USBTask , TaskStatus: TASK_RUN },
+};
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable clock division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware initialization */
+ SerialStream_Init(9600, false);
+ ADC_Init(ADC_SINGLE_CONVERSION | ADC_PRESCALE_64);
+ Temperature_Init();
+ Joystick_Init();
+ LEDs_Init();
+ HWB_Init();
+
+ /* Millisecond timer initialization, with output compare interrupt enabled */
+ OCR0A = 0x7D;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Turn on interrupts */
+ sei();
+
+ /* Startup message via USART */
+ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
+ "LUFA Demo running.\r\n" ESC_INVERSE_OFF));
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and increments the
+ * scheduler tick counter.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* Scheduler test - increment scheduler tick counter once each millisecond */
+ Scheduler_TickCounter++;
+}
+
+/** Task responsible for checking the joystick position, and displaying the joystick position onto the
+ * board LEDs.
+ */
+TASK(TestApp_CheckJoystick)
+{
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ uint8_t LEDMask = 0;
+
+ /* Test of the Joystick - change a mask in response to joystick */
+ if (JoyStatus_LCL & JOY_UP)
+ LEDMask |= LEDS_LED1;
+
+ if (JoyStatus_LCL & JOY_DOWN)
+ LEDMask |= LEDS_LED2;
+
+ if (JoyStatus_LCL & JOY_LEFT)
+ LEDMask |= LEDS_LED3;
+
+ if (JoyStatus_LCL & JOY_RIGHT)
+ LEDMask |= LEDS_LED4;
+
+ if (JoyStatus_LCL & JOY_PRESS)
+ LEDMask = LEDS_ALL_LEDS;
+
+ /* Test of LEDs - light up in response to joystick */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Task responsible for checking the current temperature via the temperature sensor mounted on the
+ * board, and displaying it through the serial USART.
+ */
+TASK(TestApp_CheckTemp)
+{
+ static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on startup
+
+ /* Task runs every 10000 ticks, 10 seconds for this demo */
+ if (Scheduler_HasDelayElapsed(10000, &DelayCounter))
+ {
+ printf_P(PSTR("Current temperature: %d Degrees Celcius\r\n\r\n"),
+ (int)Temperature_GetTemperature());
+
+ /* Reset the delay counter, ready to count another 10000 tick interval */
+ Scheduler_ResetDelay(&DelayCounter);
+ }
+}
+
+/** Task responsible for checking the HWB button position, and start-stopping other tasks and the USB
+ * interface in response to user joystick movements.
+ */
+TASK(TestApp_CheckHWB)
+{
+ static SchedulerDelayCounter_t DelayCounter = 0;
+ static bool IsPressed;
+ static bool BlockingJoystickTask;
+
+ /* Check if HWB pressed (start USB) */
+ if (HWB_GetStatus() == true)
+ {
+ /* Debounce - check 100 ticks later to see if button is still being pressed */
+ if ((IsPressed == false) && (Scheduler_HasDelayElapsed(100, &DelayCounter)))
+ {
+ /* Set flag, indicating that current pressed state has been handled */
+ IsPressed = true;
+
+ /* First start of the USB interface permenantly blocks the joystick task */
+ if (BlockingJoystickTask == false)
+ {
+ Scheduler_SetTaskMode(TestApp_CheckJoystick, TASK_STOP);
+ BlockingJoystickTask = true;
+ }
+
+ /* Toggle USB interface */
+ if (USB_IsInitialized == true)
+ {
+ USB_ShutDown();
+
+ LEDs_SetAllLEDs(LEDS_LED1);
+ puts_P(PSTR(ESC_BG_WHITE "USB Power Off.\r\n"));
+
+ Scheduler_SetTaskMode(TestApp_CheckTemp, TASK_RUN);
+ }
+ else
+ {
+ Scheduler_SetTaskMode(TestApp_CheckTemp, TASK_STOP);
+
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3);
+ puts_P(PSTR(ESC_BG_YELLOW "USB Power On.\r\n"));
+
+ USB_Init(USB_MODE_UID, USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL);
+ }
+ }
+ }
+ else
+ {
+ /* HWB not pressed - reset debounce interval counter and press handled flag */
+ Scheduler_ResetDelay(&DelayCounter);
+ IsPressed = false;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.h b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.h
new file mode 100644
index 00000000..4175fad1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.h
@@ -0,0 +1,62 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for TestApp.c.
+ */
+
+#ifndef _TESTAPP_H_
+#define _TESTAPP_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/interrupt.h>
+ #include <avr/wdt.h>
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+ #include <LUFA/MemoryAllocator/DynAlloc.h> // Auto-defragmenting Dynamic Memory allocation
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Drivers/AT90USBXXX/ADC.h> // ADC driver
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // USART Stream driver
+ #include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LED driver
+ #include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
+ #include <LUFA/Drivers/Board/Temperature.h> // Temperature sensor driver
+
+ /* Task Definitions: */
+ TASK(TestApp_CheckJoystick);
+ TASK(TestApp_CheckHWB);
+ TASK(TestApp_CheckTemp);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.txt b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.txt
new file mode 100644
index 00000000..e5b268aa
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestApp.txt
@@ -0,0 +1,51 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Test Application for the LUFA library
+ *
+ * Test application. Demonstrates several aspects of the LUFA
+ * Library. On startup the current temperature will be printed
+ * through the USART every 10 seconds, and the current joystick
+ * position will be indicated via the LEDs on the selected board.
+ * Pressing the HWB will initiate the USB subsystem, enumerating
+ * the device (which has <b>no actual functionality beyond
+ * enumeration as a device or as a host in this demo</b>, and serves
+ * only to demonstrate the USB portion of the library). It will
+ * also suspend the joystick and temperature monitoring tasks.
+ *
+ * Pressing the HWB a second time will turn off the USB system
+ * and resume the temperature printing task (but not the joystick
+ * monitoring task).
+ *
+ * When activated, the USB events will be printed through the
+ * serial USART.
+ *
+ * When the USB subsystem is activated, the board LEDs will show
+ * the current USB status.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host/Device (Dual Role)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.c b/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.c
new file mode 100644
index 00000000..8f05b820
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.c
@@ -0,0 +1,226 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file contains dummy handlers for all the possible USB events passed to the
+ * application by the library (see Events.h documentation for more details on USB events).
+ *
+ * Each event is caught and printed to the USART so that they may be monitored.
+ */
+
+#define INCLUDE_FROM_TESTEVENTS_C
+#include "TestEvents.h"
+
+/** Simple routine which aborts the program execution when a fatal error occurs, and is passed to the
+ * application via an event. When run, this function shuts down the USB interface, indicates an error
+ * via the board LEDs, prints an error message to the USART and then enters an infinite loop, preventing
+ * any more application code (other than interrupts) from executing.
+ */
+static void Abort_Program(void)
+{
+ USB_ShutDown();
+
+ LEDs_SetAllLEDs(LEDS_LED1 | LEDS_LED3);
+
+ puts_P(PSTR(ESC_INVERSE_ON "\r\n**PROGRAM ABORT**"));
+ for (;;);
+}
+
+/** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_VBUSChange)
+{
+ puts_P(PSTR(EVENT_PREFIX "VBUS Change\r\n"));
+}
+
+/** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_VBUSConnect)
+{
+ puts_P(PSTR(EVENT_PREFIX "VBUS +\r\n"));
+}
+
+/** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_VBUSDisconnect)
+{
+ puts_P(PSTR(EVENT_PREFIX "VBUS -\r\n"));
+}
+
+/**
+ * Event handler for the USB_Connect event. When fired, the event is logged to the USART and the
+ * USB task started.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ puts_P(PSTR(EVENT_PREFIX "USB +\r\n"));
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3 | LEDS_LED4);
+
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/**
+ * Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the
+ * USB task stopped.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ puts_P(PSTR(EVENT_PREFIX "USB -\r\n"));
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3 | LEDS_LED3);
+}
+
+/** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_Suspend)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "USB Sleep\r\n"));
+ LEDs_SetAllLEDs(LEDS_ALL_LEDS);
+}
+
+/** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_WakeUp)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "USB Wakeup\r\n"));
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED4);
+}
+
+/** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_Reset)
+{
+ puts_P(PSTR(EVENT_PREFIX "USB Reset\r\n"));
+}
+
+/** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_UIDChange)
+{
+ char* ModeStrPtr;
+
+ puts_P(PSTR(EVENT_PREFIX "UID Change\r\n"));
+
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ ModeStrPtr = PSTR("HOST");
+ else if (USB_CurrentMode == USB_MODE_HOST)
+ ModeStrPtr = PSTR("DEVICE");
+ else
+ ModeStrPtr = PSTR("N/A");
+
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3);
+
+ printf_P(PSTR(" -- New Mode %S\r\n"), ModeStrPtr);
+}
+
+/**
+ * Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program
+ * execution aborted.
+ */
+EVENT_HANDLER(USB_PowerOnFail)
+{
+ char* ModeStrPtr;
+
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Power On Fail\r\n"));
+
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ ModeStrPtr = PSTR("DEVICE");
+ else if (USB_CurrentMode == USB_MODE_HOST)
+ ModeStrPtr = PSTR("HOST");
+ else
+ ModeStrPtr = PSTR("N/A");
+
+ printf_P(PSTR(" -- Mode %S\r\n"), ModeStrPtr);
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ Abort_Program();
+}
+
+/**
+ * Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program
+ * execution aborted.
+ */
+EVENT_HANDLER(USB_HostError)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Host Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ Abort_Program();
+}
+
+/** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_DeviceEnumerationFailed)
+{
+ puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+}
+
+/**
+ * Event handler for the USB_DeviceError event. When fired, the event is logged to the USART and the program
+ * execution aborted.
+ */
+EVENT_HANDLER(USB_DeviceError)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Device Mode Error\r\n"));
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);
+
+ Abort_Program();
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ puts_P(PSTR(EVENT_PREFIX "Ctrl Request\r\n"));
+ printf_P(PSTR(" -- Req Data %d\r\n"), bRequest);
+ printf_P(PSTR(" -- Req Type %d\r\n"), bmRequestType);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ puts_P(PSTR(EVENT_PREFIX "Configuration Number Changed\r\n"));
+
+ LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED4);
+}
+
+/** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_DeviceAttached)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "Device +\r\n"));
+
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_DeviceUnattached)
+{
+ puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "Device -\r\n"));
+}
+
+/** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */
+EVENT_HANDLER(USB_DeviceEnumerationComplete)
+{
+ puts_P(PSTR(EVENT_PREFIX "Device Enumeration Complete\r\n"));
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.h b/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.h
new file mode 100644
index 00000000..6ba06aed
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/TestEvents.h
@@ -0,0 +1,110 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for TestEvents.c.
+ */
+
+#ifndef _TESTEVENTS_H_
+#define _TESTEVENTS_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include <LUFA/Common/Common.h> // Commonly used macros
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/Board/LEDs.h> // LED driver
+ #include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // USART Stream driver
+ #include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Event Catch List: */
+ /** Indicates that this module will catch the USB_VBUSChange event when thrown by the library. */
+ HANDLES_EVENT(USB_VBUSChange);
+
+ /** Indicates that this module will catch the USB_VBUSConnect event when thrown by the library. */
+ HANDLES_EVENT(USB_VBUSConnect);
+
+ /** Indicates that this module will catch the USB_VBUSDisconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_VBUSDisconnect);
+
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_Suspend event when thrown by the library. */
+ HANDLES_EVENT(USB_Suspend);
+
+ /** Indicates that this module will catch the USB_WakeUp event when thrown by the library. */
+ HANDLES_EVENT(USB_WakeUp);
+
+ /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
+ HANDLES_EVENT(USB_Reset);
+
+ /** Indicates that this module will catch the USB_UIDChange event when thrown by the library. */
+ HANDLES_EVENT(USB_UIDChange);
+
+ /** Indicates that this module will catch the USB_PowerOnFail event when thrown by the library. */
+ HANDLES_EVENT(USB_PowerOnFail);
+
+ /** Indicates that this module will catch the USB_HostError event when thrown by the library. */
+ HANDLES_EVENT(USB_HostError);
+
+ /** Indicates that this module will catch the USB_DeviceEnumerationFailed event when thrown by the library. */
+ HANDLES_EVENT(USB_DeviceEnumerationFailed);
+
+ /** Indicates that this module will catch the USB_DeviceError event when thrown by the library. */
+ HANDLES_EVENT(USB_DeviceError);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_DeviceAttached event when thrown by the library. */
+ HANDLES_EVENT(USB_DeviceAttached);
+
+ /** Indicates that this module will catch the USB_DeviceUnattached event when thrown by the library. */
+ HANDLES_EVENT(USB_DeviceUnattached);
+
+ /* Macros: */
+ /** Prefix sent through the USART when an even fires before the actual event message. */
+ #define EVENT_PREFIX ESC_INVERSE_ON "EVENT:" ESC_INVERSE_OFF " "
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_TESTEVENTS_C) || defined(__DOXYGEN__)
+ static void Abort_Program(void) ATTR_NO_RETURN;
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/TestApp/makefile b/digital/avr/modules/usb/lufa/Demos/TestApp/makefile
new file mode 100644
index 00000000..16c2ee5b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/TestApp/makefile
@@ -0,0 +1,710 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = TestApp
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ TestEvents.c \
+ Descriptors.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/MemoryAllocator/DynAlloc.c \
+ ../../LUFA/Drivers/Board/Temperature.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial_Stream.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/Pipe.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/LowLevel/HostChapter9.c \
+ ../../LUFA/Drivers/USB/LowLevel/Host.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES
+CDEFS += -DNUM_BLOCKS=100 -DBLOCK_SIZE=8 -DNUM_HANDLES=20
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+#CFLAGS += -mshort-calls
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+#PRINTF_LIB =
+PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.c b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.c
new file mode 100644
index 00000000..03d4ed9e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.c
@@ -0,0 +1,263 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x02,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2044,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x01}
+ },
+
+ CDC_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0xFF
+ },
+
+ DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA USB-RS232 Demo"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.h b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.h
new file mode 100644
index 00000000..bec5e40d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
+ * uniform structure but variable sized data payloads, thus cannot be represented accurately by
+ * a single typedef struct. A macro is used instead so that functional descriptors can be created
+ * easily by specifying the size of the payload. This allows sizeof() to work correctly.
+ *
+ * \param DataSize Size in bytes of the CDC functional descriptor's data payload
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPNUM 2
+
+ /** Endpoint number of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPNUM 3
+
+ /** Endpoint number of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPNUM 4
+
+ /** Size in bytes of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Size in bytes of the CDC data IN and OUT endpoints. */
+ #define CDC_TXRX_EPSIZE 16
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t ManagementEndpoint;
+ USB_Descriptor_Interface_t DCI_Interface;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Doxygen.conf b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Doxygen.conf
new file mode 100644
index 00000000..1eb8c543
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - USB to Serial Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/LUFA USBtoSerial.inf b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/LUFA USBtoSerial.inf
new file mode 100644
index 00000000..bd9c8bf1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/LUFA USBtoSerial.inf
@@ -0,0 +1,55 @@
+; Windows LUFA USB to Serial Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%COMPANY%
+LayoutFile=layout.inf
+DriverVer=06/06/2006,1.0.0.0
+
+[Manufacturer]
+%MFGNAME% = ManufName
+
+[DestinationDirs]
+DefaultDestDir=12
+
+[ManufName]
+%Modem3% = Modem3, USB\VID_03EB&PID_204B
+
+;------------------------------------------------------------------------------
+; Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[Modem3.nt]
+CopyFiles=USBModemCopyFileSection
+AddReg=Modem3.nt.AddReg
+
+[USBModemCopyFileSection]
+usbser.sys,,,0x20
+
+[Modem3.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[Modem3.nt.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+;------------------------------------------------------------------------------
+; String Definitions
+;------------------------------------------------------------------------------
+
+[Strings]
+COMPANY="LUFA Library"
+MFGNAME="Dean Camera"
+Modem3="USB Virtual Serial Port"
+SERVICE="USB Virtual Serial Port CDC Driver" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.c b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.c
new file mode 100644
index 00000000..1f477f17
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.c
@@ -0,0 +1,120 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "RingBuff.h"
+
+void Buffer_Initialize(RingBuff_t* Buffer)
+{
+ BUFF_ATOMIC_BLOCK
+ {
+ Buffer->InPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ Buffer->Elements = 0;
+ }
+}
+
+void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data)
+{
+ BUFF_ATOMIC_BLOCK
+ {
+ #if defined(BUFF_DROPOLD)
+ if (Buffer->Elements == BUFF_LENGTH)
+ {
+ Buffer->OutPtr++;
+
+ if (Buffer->OutPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+ else
+ {
+ Buffer->Elements++;
+ }
+ #elif defined(BUFF_DROPNEW)
+ if (Buffer->Elements == BUFF_LENGTH)
+ return;
+
+ Buffer->Elements++;
+ #elif defined(BUFF_NODROPCHECK)
+ Buffer->Elements++;
+ #endif
+
+ *(Buffer->InPtr) = Data;
+ Buffer->InPtr++;
+
+ if (Buffer->InPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->InPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+}
+
+RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer)
+{
+ RingBuff_Data_t BuffData;
+
+ BUFF_ATOMIC_BLOCK
+ {
+#if defined(BUFF_EMPTYRETURNSZERO)
+ if (!(Buffer->Elements))
+ return 0;
+#elif !defined(BUFF_NOEMPTYCHECK)
+ #error No empty buffer check behaviour specified.
+#endif
+
+ BuffData = *(Buffer->OutPtr);
+
+ Buffer->OutPtr++;
+ Buffer->Elements--;
+
+ if (Buffer->OutPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+
+ return BuffData;
+}
+
+#if defined(BUFF_USEPEEK)
+RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer)
+{
+ RingBuff_Data_t BuffData;
+
+ BUFF_ATOMIC_BLOCK
+ {
+#if defined(BUFF_EMPTYRETURNSZERO)
+ if (!(Buffer->Elements))
+ return 0;
+#elif !defined(BUFF_NOEMPTYCHECK)
+ #error No empty buffer check behaviour specified.
+#endif
+
+ BuffData = *(Buffer->OutPtr);
+ }
+
+ return BuffData;
+}
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.h b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.h
new file mode 100644
index 00000000..4b6bfde6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/RingBuff.h
@@ -0,0 +1,116 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/* Buffer Configuration: */
+ /* Buffer length - select static size of created ringbuffers: */
+ #define BUFF_STATICSIZE 128 // Set to the static ringbuffer size for all ringbuffers (place size after define)
+
+ /* Volatile mode - uncomment to make buffers volatile, for use in ISRs, etc: */
+ #define BUFF_VOLATILE // Uncomment to cause all ring buffers to become volatile (and atomic if multi-byte) in access
+
+ /* Drop mode - select behaviour when Buffer_StoreElement called on a full buffer: */
+ #define BUFF_DROPOLD // Uncomment to cause full ring buffers to drop the oldest character to make space when full
+ // #define BUFF_DROPNEW // Uncomment to cause full ring buffers to drop the new character when full
+ // #define BUFF_NODROPCHECK // Uncomment to ignore full ring buffer checks - checking left to user!
+
+ /* Underflow behaviour - select behaviour when Buffer_GetElement is called with an empty ringbuffer: */
+ //#define BUFF_EMPTYRETURNSZERO // Uncomment to return 0 when an empty ringbuffer is read
+ #define BUFF_NOEMPTYCHECK // Uncomment to disable checking of empty ringbuffers - checking left to user!
+
+ /* Buffer storage type - set the datatype for the stored data */
+ #define BUFF_DATATYPE uint8_t // Change to the data type that is going to be stored into the buffer
+
+ /* Peek routine - uncomment to include the peek routine (fetches next byte without removing it from the buffer */
+ //#define BUFF_USEPEEK
+
+#ifndef _RINGBUFF_H_
+#define _RINGBUFF_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/interrupt.h>
+ #include <util/atomic.h>
+ #include <limits.h>
+
+ #include <LUFA/Common/Common.h>
+
+ /* Defines and checks: */
+ #if defined(BUFF_STATICSIZE)
+ #define BUFF_LENGTH BUFF_STATICSIZE
+ #else
+ #error No buffer length specified!
+ #endif
+
+ #if !(defined(BUFF_DROPOLD) || defined(BUFF_DROPNEW) || defined(BUFF_NODROPCHECK))
+ #error No buffer drop mode specified.
+ #endif
+
+ #if !defined(BUFF_DATATYPE)
+ #error Ringbuffer storage data type not specified.
+ #endif
+
+ #if defined(BUFF_VOLATILE)
+ #define BUFF_MODE volatile
+ #define BUFF_ATOMIC_BLOCK ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ #else
+ #define BUFF_MODE
+ #define BUFF_ATOMIC_BLOCK
+ #endif
+
+ #if (BUFF_STATICSIZE > LONG_MAX)
+ #define RingBuff_Elements_t uint64_t
+ #elif (BUFF_STATICSIZE > INT_MAX)
+ #define RingBuff_Elements_t uint32_t
+ #elif (BUFF_STATICSIZE > CHAR_MAX)
+ #define RingBuff_Elements_t uint16_t
+ #else
+ #define RingBuff_Elements_t uint8_t
+ #endif
+
+ /* Type Defines: */
+ typedef BUFF_DATATYPE RingBuff_Data_t;
+
+ typedef BUFF_MODE struct
+ {
+ RingBuff_Data_t Buffer[BUFF_LENGTH];
+ RingBuff_Data_t* InPtr;
+ RingBuff_Data_t* OutPtr;
+ RingBuff_Elements_t Elements;
+ } RingBuff_t;
+
+ /* Function Prototypes: */
+ void Buffer_Initialize(RingBuff_t* Buff);
+ void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data);
+ RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer);
+ #if defined(BUFF_USEPEEK)
+ RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.aps b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.aps
new file mode 100644
index 00000000..2db4f97b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>USBtoSerial</ProjectName><Created>30-Sep-2008 14:18:39</Created><LastEdit>30-Sep-2008 14:18:52</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:18:39</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\USBtoSerial\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>RingBuff.c</SOURCEFILE><SOURCEFILE>USBtoSerial.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>RingBuff.h</HEADERFILE><HEADERFILE>USBtoSerial.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>USBtoSerial.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.c b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.c
new file mode 100644
index 00000000..7c06007a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.c
@@ -0,0 +1,390 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBtoSerial.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA USB RS232 App");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: CDC_Task , TaskStatus: TASK_STOP },
+};
+
+/* Globals: */
+/** Contains the current baud rate and other settings of the virtual serial port.
+ *
+ * These values are set by the host via a class-specific request, and the physical USART should be reconfigured to match the
+ * new settings each time they are changed by the host.
+ */
+CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** Ring (circular) buffer to hold the RX data - data from the host to the attached device on the serial port. */
+RingBuff_t Rx_Buffer;
+
+/** Ring (circular) buffer to hold the TX data - data from the attached device on the serial port to the host. */
+RingBuff_t Tx_Buffer;
+
+/** Flag to indicate if the USART is currently transmitting data from the Rx_Buffer circular buffer. */
+volatile bool Transmitting = false;
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+ ReconfigureUSART();
+
+ /* Ringbuffer Initialization */
+ Buffer_Initialize(&Rx_Buffer);
+ Buffer_Initialize(&Tx_Buffer);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ * starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ * the status LEDs and stops the USB management and CDC management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running CDC and USB management tasks */
+ Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ * of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start CDC task */
+ Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library (including the CDC control commands,
+ * which are all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* LineCodingData = (uint8_t*)&LineCoding;
+
+ /* Process CDC specific control requests */
+ switch (bRequest)
+ {
+ case REQ_GetLineEncoding:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Write the line coding data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetLineEncoding:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Read the line coding data in from the host into the global struct */
+ Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
+
+ /* Finalize the stream transfer to clear the last packet from the host */
+ Endpoint_ClearSetupIN();
+
+ /* Reconfigure the USART with the new settings */
+ ReconfigureUSART();
+ }
+
+ break;
+ case REQ_SetControlLineState:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+#if 0
+ /* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake
+ lines. The mask is read in from the wValue parameter, and can be masked against the CONTROL_LINE_OUT_* masks
+ to determine the RTS and DTR line states using the following code:
+ */
+
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ // Do something with the given line states in wIndex
+#endif
+
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Task to manage CDC data transmission and reception to and from the host, from and to the physical USART. */
+TASK(CDC_Task)
+{
+ if (USB_IsConnected)
+ {
+#if 0
+ /* NOTE: Here you can use the notification endpoint to send back line state changes to the host, for the special RS-232
+ handshake signal lines (and some error states), via the CONTROL_LINE_IN_* masks and the following code:
+ */
+
+ USB_Notification_Header_t Notification = (USB_Notification_Header_t)
+ {
+ NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+ Notification: NOTIF_SerialState,
+ wValue: 0,
+ wIndex: 0,
+ wLength: sizeof(uint16_t),
+ };
+
+ uint16_t LineStateMask;
+
+ // Set LineStateMask here to a mask of CONTROL_LINE_IN_* masks to set the input handshake line states to send to the host
+
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+ Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
+ Endpoint_Write_Stream_LE(&LineStateMask, sizeof(LineStateMask));
+ Endpoint_ClearCurrentBank();
+#endif
+
+ /* Select the Serial Rx Endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Read the received data endpoint into the transmission buffer */
+ while (Endpoint_BytesInEndpoint())
+ {
+ /* Wait until the buffer has space for a new character */
+ while (!((BUFF_STATICSIZE - Rx_Buffer.Elements)));
+
+ /* Store each character from the endpoint */
+ Buffer_StoreElement(&Rx_Buffer, Endpoint_Read_Byte());
+ }
+
+ /* Clear the endpoint buffer */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Check if Rx buffer contains data */
+ if (Rx_Buffer.Elements)
+ {
+ /* Initiate the transmission of the buffer contents if USART idle */
+ if (!(Transmitting))
+ {
+ Transmitting = true;
+ Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
+ }
+ }
+
+ /* Select the Serial Tx Endpoint */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Check if the Tx buffer contains anything to be sent to the host */
+ if (Tx_Buffer.Elements)
+ {
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Check before sending the data if the endpoint is completely full */
+ bool IsFull = (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE);
+
+ /* Write the transmission buffer contents to the received data endpoint */
+ while (Tx_Buffer.Elements && (Endpoint_BytesInEndpoint() < CDC_TXRX_EPSIZE))
+ Endpoint_Write_Byte(Buffer_GetElement(&Tx_Buffer));
+
+ /* Send the data */
+ Endpoint_ClearCurrentBank();
+
+ /* If a full endpoint was sent, we need to send an empty packet afterwards to terminate the transfer */
+ if (IsFull)
+ {
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Send an empty packet to terminate the transfer */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+ }
+}
+
+/** ISR to handle the USART transmit complete interrupt, fired each time the USART has sent a character. This reloads the USART
+ * data register with the next byte from the Rx_Buffer circular buffer if a character is available, or stops the transmission if
+ * the buffer is currently empty.
+ */
+ISR(USART1_TX_vect, ISR_BLOCK)
+{
+ /* Send next character if available */
+ if (Rx_Buffer.Elements)
+ UDR1 = Buffer_GetElement(&Rx_Buffer);
+ else
+ Transmitting = false;
+}
+
+/** ISR to handle the USART receive complete interrupt, fired each time the USART has received a character. This stores the received
+ * character into the Tx_Buffer circular buffer for later transmission to the host.
+ */
+ISR(USART1_RX_vect, ISR_BLOCK)
+{
+ /* Character received, store it into the buffer */
+ Buffer_StoreElement(&Tx_Buffer, UDR1);
+}
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ * log to a serial port, or anything else that is suitable for status updates.
+ *
+ * \param CurrentStatus Current status of the system, from the USBtoSerial_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+/** Reconfigures the USART to match the current serial port settings issued by the host as closely as possible. */
+void ReconfigureUSART(void)
+{
+ uint8_t ConfigMask = 0;
+
+ /* Determine parity - non odd/even parity mode defaults to no parity */
+ if (LineCoding.ParityType == Parity_Odd)
+ ConfigMask = ((1 << UPM11) | (1 << UPM10));
+ else if (LineCoding.ParityType == Parity_Even)
+ ConfigMask = (1 << UPM11);
+
+ /* Determine stop bits - 1.5 stop bits is set as 1 stop bit due to hardware limitations */
+ if (LineCoding.CharFormat == TwoStopBits)
+ ConfigMask |= (1 << USBS1);
+
+ /* Determine data size - 5, 6, 7, or 8 bits are supported */
+ if (LineCoding.DataBits == 6)
+ ConfigMask |= (1 << UCSZ10);
+ else if (LineCoding.DataBits == 7)
+ ConfigMask |= (1 << UCSZ11);
+ else if (LineCoding.DataBits == 8)
+ ConfigMask |= ((1 << UCSZ11) | (1 << UCSZ10));
+
+ /* Enable double speed, gives better error percentages at 8MHz */
+ UCSR1A = (1 << U2X1);
+
+ /* Enable transmit and receive modules and interrupts */
+ UCSR1B = ((1 << TXCIE1) | (1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1));
+
+ /* Set the USART mode to the mask generated by the Line Coding options */
+ UCSR1C = ConfigMask;
+
+ /* Set the USART baud rate register to the desired baud rate value */
+ UBRR1 = SERIAL_2X_UBBRVAL((uint16_t)LineCoding.BaudRateBPS);
+}
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.h b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.h
new file mode 100644
index 00000000..f363fa93
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.h
@@ -0,0 +1,192 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for USBtoSerial.c.
+ */
+
+#ifndef _USB_SERIAL_H_
+#define _USB_SERIAL_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+
+ #include "Descriptors.h"
+ #include "RingBuff.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/Serial.h> // USART driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** CDC Class specific request to get the current virtual serial port configuration settings. */
+ #define REQ_GetLineEncoding 0x21
+
+ /** CDC Class specific request to set the current virtual serial port configuration settings. */
+ #define REQ_SetLineEncoding 0x20
+
+ /** CDC Class specific request to set the current virtual serial port handshake line states. */
+ #define REQ_SetControlLineState 0x22
+
+ /** Notification type constant for a change in the virtual serial port handshake line states, for
+ * use with a USB_Notification_Header_t notification structure when sent to the host via the CDC
+ * notification endpoint.
+ */
+ #define NOTIF_SerialState 0x20
+
+ /** Mask for the DTR handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that the DTR line state should be high.
+ */
+ #define CONTROL_LINE_OUT_DTR (1 << 0)
+
+ /** Mask for the RTS handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that theRTS line state should be high.
+ */
+ #define CONTROL_LINE_OUT_RTS (1 << 1)
+
+ /** Mask for the DCD handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DCD line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DCD (1 << 0)
+
+ /** Mask for the DSR handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DSR line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DSR (1 << 1)
+
+ /** Mask for the BREAK handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the BREAK line state is currently high.
+ */
+ #define CONTROL_LINE_IN_BREAK (1 << 2)
+
+ /** Mask for the RING handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the RING line state is currently high.
+ */
+ #define CONTROL_LINE_IN_RING (1 << 3)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a framing error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_FRAMEERROR (1 << 4)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a parity error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_PARITYERROR (1 << 5)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a data overrun error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration
+ * as set by the host via a class specific request.
+ */
+ typedef struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
+ uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
+ * CDCDevice_CDC_LineCodingFormats_t enum
+ */
+ uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
+ * CDCDevice_LineCodingParity_t enum
+ */
+ uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */
+ } CDC_Line_Coding_t;
+
+ /** Type define for a CDC notification, sent to the host via the CDC notification endpoint to indicate a
+ * change in the device state asynchronously.
+ */
+ typedef struct
+ {
+ uint8_t NotificationType; /**< Notification type, a mask of REQDIR_*, REQTYPE_* and REQREC_* constants
+ * from the library StdRequestType.h header
+ */
+ uint8_t Notification; /**< Notification value, a NOTIF_* constant */
+ uint16_t wValue; /**< Notification wValue, notification-specific */
+ uint16_t wIndex; /**< Notification wIndex, notification-specific */
+ uint16_t wLength; /**< Notification wLength, notification-specific */
+ } USB_Notification_Header_t;
+
+ /* Enums: */
+ /** Enum for the possible line encoding formats of a virtual serial port. */
+ enum CDCDevice_CDC_LineCodingFormats_t
+ {
+ OneStopBit = 0, /**< Each frame contains one stop bit */
+ OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits */
+ TwoStopBits = 2, /**< Each frame contains two stop bits */
+ };
+
+ /** Enum for the possible line encoding parity settings of a virtual serial port. */
+ enum CDCDevice_LineCodingParity_t
+ {
+ Parity_None = 0, /**< No parity bit mode on each frame */
+ Parity_Odd = 1, /**< Odd parity bit mode on each frame */
+ Parity_Even = 2, /**< Even parity bit mode on each frame */
+ Parity_Mark = 3, /**< Mark parity bit mode on each frame */
+ Parity_Space = 4, /**< Space parity bit mode on each frame */
+ };
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum USBtoSerial_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Tasks: */
+ TASK(CDC_Task);
+
+ /* Function Prototypes: */
+ void ReconfigureUSART(void);
+ void UpdateStatus(uint8_t CurrentStatus);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.txt b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.txt
new file mode 100644
index 00000000..992f00f4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/USBtoSerial.txt
@@ -0,0 +1,45 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage USB to Serial Converter Demo (via CDC-ACM class)
+ *
+ * Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a USB to Serial converter using the CDC class. Sent and
+ * received data on the serial port is communicated to the USB
+ * host.
+ *
+ * After running this demo for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Abstract Control Model (ACM)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Demos/USBtoSerial/makefile b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/makefile
new file mode 100644
index 00000000..ad91aa81
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/USBtoSerial/makefile
@@ -0,0 +1,704 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = USBtoSerial
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ RingBuff.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Demos/makefile b/digital/avr/modules/usb/lufa/Demos/makefile
new file mode 100644
index 00000000..b53d81cd
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Demos/makefile
@@ -0,0 +1,121 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2009.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Makefile to build all the LUFA Demos. Call with "make all" to
+# rebuild all demos.
+
+# Projects are pre-cleaned before each one is built, to ensure any
+# custom LUFA library build options are reflected in the compiled
+# code.
+
+all:
+ make -C AudioInput clean
+ make -C AudioInput all
+
+ make -C AudioOutput clean
+ make -C AudioOutput all
+
+ make -C CDC clean
+ make -C CDC all
+
+ make -C CDCHost clean
+ make -C CDCHost all
+
+ make -C DualCDC clean
+ make -C DualCDC all
+
+ make -C Joystick clean
+ make -C Joystick all
+
+ make -C KeyboardMouse clean
+ make -C KeyboardMouse all
+
+ make -C Keyboard clean
+ make -C Keyboard all
+
+ make -C KeyboardFullInt clean
+ make -C KeyboardFullInt all
+
+ make -C KeyboardViaInt clean
+ make -C KeyboardViaInt all
+
+ make -C KeyboardHost clean
+ make -C KeyboardHost all
+
+ make -C KeyboardHostWithParser clean
+ make -C KeyboardHostWithParser all
+
+ make -C KeyboardHostViaInt clean
+ make -C KeyboardHostViaInt all
+
+ make -C MassStorage clean
+ make -C MassStorage all
+
+ make -C MassStorageHost clean
+ make -C MassStorageHost all
+
+ make -C MIDI clean
+ make -C MIDI all
+
+ make -C Mouse clean
+ make -C Mouse all
+
+ make -C MouseFullInt clean
+ make -C MouseFullInt all
+
+ make -C MouseViaInt clean
+ make -C MouseViaInt all
+
+ make -C MouseHost clean
+ make -C MouseHost all
+
+ make -C MouseHostWithParser clean
+ make -C MouseHostWithParser all
+
+ make -C MouseHostViaInt clean
+ make -C MouseHostViaInt all
+
+ make -C RNDISEthernet clean
+ make -C RNDISEthernet all
+
+ make -C StillImageHost clean
+ make -C StillImageHost all
+
+ make -C TestApp clean
+ make -C TestApp all
+
+ make -C USBtoSerial clean
+ make -C USBtoSerial all
+
+%:
+ make -C AudioInput $@
+ make -C AudioOutput $@
+ make -C CDC $@
+ make -C CDCHost $@
+ make -C DualCDC $@
+ make -C Joystick $@
+ make -C KeyboardMouse $@
+ make -C Keyboard $@
+ make -C KeyboardFullInt $@
+ make -C KeyboardViaInt $@
+ make -C KeyboardHost $@
+ make -C KeyboardHostWithParser $@
+ make -C KeyboardHostViaInt $@
+ make -C MassStorage $@
+ make -C MassStorageHost $@
+ make -C MIDI $@
+ make -C Mouse $@
+ make -C MouseFullInt $@
+ make -C MouseViaInt $@
+ make -C MouseHost $@
+ make -C MouseHostWithParser $@
+ make -C MouseHostViaInt $@
+ make -C RNDISEthernet $@
+ make -C StillImageHost $@
+ make -C TestApp $@
+ make -C USBtoSerial $@ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/LUFA.pnproj b/digital/avr/modules/usb/lufa/LUFA.pnproj
new file mode 100644
index 00000000..6cba8f16
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA.pnproj
@@ -0,0 +1 @@
+<Project name="LUFA"><Folder name="Demos"><Folder name="TestApp"><File path="Demos\TestApp\makefile"></File><File path="Demos\TestApp\TestApp.c"></File><File path="Demos\TestApp\TestApp.h"></File><File path="Demos\TestApp\TestEvents.c"></File><File path="Demos\TestApp\TestEvents.h"></File><File path="Demos\TestApp\Descriptors.c"></File><File path="Demos\TestApp\Descriptors.h"></File><File path="Demos\TestApp\TestApp.txt"></File><File path="Demos\TestApp\Doxygen.conf"></File></Folder><Folder name="Mouse"><File path="Demos\Mouse\makefile"></File><File path="Demos\Mouse\Descriptors.c"></File><File path="Demos\Mouse\Descriptors.h"></File><File path="Demos\Mouse\Mouse.h"></File><File path="Demos\Mouse\Mouse.c"></File><File path="Demos\Mouse\Mouse.txt"></File><File path="Demos\Mouse\Doxygen.conf"></File></Folder><Folder name="Keyboard"><File path="Demos\Keyboard\Descriptors.c"></File><File path="Demos\Keyboard\Keyboard.c"></File><File path="Demos\Keyboard\Descriptors.h"></File><File path="Demos\Keyboard\Keyboard.h"></File><File path="Demos\Keyboard\makefile"></File><File path="Demos\Keyboard\Keyboard.txt"></File><File path="Demos\Keyboard\Doxygen.conf"></File></Folder><Folder name="MouseHost"><File path="Demos\MouseHost\MouseHost.h"></File><File path="Demos\MouseHost\makefile"></File><File path="Demos\MouseHost\MouseHost.c"></File><File path="Demos\MouseHost\ConfigDescriptor.c"></File><File path="Demos\MouseHost\ConfigDescriptor.h"></File><File path="Demos\MouseHost\Doxygen.conf"></File><File path="Demos\MouseHost\MouseHost.txt"></File></Folder><Folder name="KeyboardHost"><File path="Demos\KeyboardHost\makefile"></File><File path="Demos\KeyboardHost\KeyboardHost.c"></File><File path="Demos\KeyboardHost\KeyboardHost.h"></File><File path="Demos\KeyboardHost\ConfigDescriptor.c"></File><File path="Demos\KeyboardHost\ConfigDescriptor.h"></File><File path="Demos\KeyboardHost\Doxygen.conf"></File><File path="Demos\KeyboardHost\KeyboardHost.txt"></File></Folder><Folder name="Joystick"><File path="Demos\Joystick\makefile"></File><File path="Demos\Joystick\Descriptors.c"></File><File path="Demos\Joystick\Descriptors.h"></File><File path="Demos\Joystick\Joystick.c"></File><File path="Demos\Joystick\Joystick.h"></File><File path="Demos\Joystick\Joystick.txt"></File><File path="Demos\Joystick\Doxygen.conf"></File></Folder><Folder name="CDC"><File path="Demos\CDC\makefile"></File><File path="Demos\CDC\CDC.c"></File><File path="Demos\CDC\CDC.h"></File><File path="Demos\CDC\Descriptors.c"></File><File path="Demos\CDC\Descriptors.h"></File><File path="Demos\CDC\CDC.txt"></File><File path="Demos\CDC\LUFA CDC.inf"></File><File path="Demos\CDC\Doxygen.conf"></File></Folder><Folder name="USBtoSerial"><File path="Demos\USBtoSerial\Descriptors.h"></File><File path="Demos\USBtoSerial\RingBuff.c"></File><File path="Demos\USBtoSerial\RingBuff.h"></File><File path="Demos\USBtoSerial\Descriptors.c"></File><File path="Demos\USBtoSerial\makefile"></File><File path="Demos\USBtoSerial\USBtoSerial.h"></File><File path="Demos\USBtoSerial\USBtoSerial.c"></File><File path="Demos\USBtoSerial\USBtoSerial.txt"></File><File path="Demos\USBtoSerial\LUFA USBtoSerial.inf"></File><File path="Demos\USBtoSerial\Doxygen.conf"></File></Folder><Folder name="MassStorage"><File path="Demos\MassStorage\MassStorage.h"></File><File path="Demos\MassStorage\Descriptors.c"></File><File path="Demos\MassStorage\Descriptors.h"></File><File path="Demos\MassStorage\makefile"></File><File path="Demos\MassStorage\MassStorage.c"></File><File path="Demos\MassStorage\SCSI.h"></File><File path="Demos\MassStorage\SCSI.c"></File><File path="Demos\MassStorage\DataflashManager.h"></File><File path="Demos\MassStorage\SCSI_Codes.h"></File><File path="Demos\MassStorage\MassStorage.txt"></File><File path="Demos\MassStorage\DataflashManager.c"></File><File path="Demos\MassStorage\Doxygen.conf"></File></Folder><Folder name="KeyboardHostViaInt"><File path="Demos\KeyboardHostViaInt\makefile"></File><File path="Demos\KeyboardHostViaInt\KeyboardHostViaInt.c"></File><File path="Demos\KeyboardHostViaInt\KeyboardHostViaInt.h"></File><File path="Demos\KeyboardHostViaInt\ConfigDescriptor.c"></File><File path="Demos\KeyboardHostViaInt\ConfigDescriptor.h"></File><File path="Demos\KeyboardHostViaInt\Doxygen.conf"></File><File path="Demos\KeyboardHostViaInt\KeyboardHostViaInt.txt"></File></Folder><Folder name="MouseHostViaInt"><File path="Demos\MouseHostViaInt\MouseHostViaInt.h"></File><File path="Demos\MouseHostViaInt\makefile"></File><File path="Demos\MouseHostViaInt\MouseHostViaInt.c"></File><File path="Demos\MouseHostViaInt\ConfigDescriptor.c"></File><File path="Demos\MouseHostViaInt\ConfigDescriptor.h"></File><File path="Demos\MouseHostViaInt\Doxygen.conf"></File><File path="Demos\MouseHostViaInt\MouseHostViaInt.txt"></File></Folder><Folder name="AudioOutput"><File path="Demos\AudioOutput\makefile"></File><File path="Demos\AudioOutput\AudioOutput.c"></File><File path="Demos\AudioOutput\AudioOutput.h"></File><File path="Demos\AudioOutput\Descriptors.c"></File><File path="Demos\AudioOutput\Descriptors.h"></File><File path="Demos\AudioOutput\Doxygen.conf"></File><File path="Demos\AudioOutput\AudioOutput.txt"></File></Folder><Folder name="MassStorageHost"><File path="Demos\MassStorageHost\MassStorageHost.h"></File><File path="Demos\MassStorageHost\makefile"></File><File path="Demos\MassStorageHost\MassStorageHost.c"></File><File path="Demos\MassStorageHost\MassStoreCommands.c"></File><File path="Demos\MassStorageHost\MassStoreCommands.h"></File><File path="Demos\MassStorageHost\ConfigDescriptor.c"></File><File path="Demos\MassStorageHost\ConfigDescriptor.h"></File><File path="Demos\MassStorageHost\Doxygen.conf"></File><File path="Demos\MassStorageHost\SCSI_Codes.h"></File><File path="Demos\MassStorageHost\MassStorageHost.txt"></File></Folder><Folder name="AudioInput"><File path="Demos\AudioInput\makefile"></File><File path="Demos\AudioInput\AudioInput.h"></File><File path="Demos\AudioInput\Descriptors.h"></File><File path="Demos\AudioInput\Descriptors.c"></File><File path="Demos\AudioInput\AudioInput.c"></File><File path="Demos\AudioInput\Doxygen.conf"></File><File path="Demos\AudioInput\AudioInput.txt"></File></Folder><Folder name="KeyboardViaInt"><File path="Demos\KeyboardViaInt\Descriptors.c"></File><File path="Demos\KeyboardViaInt\Descriptors.h"></File><File path="Demos\KeyboardViaInt\KeyboardViaInt.c"></File><File path="Demos\KeyboardViaInt\KeyboardViaInt.h"></File><File path="Demos\KeyboardViaInt\makefile"></File><File path="Demos\KeyboardViaInt\KeyboardViaInt.txt"></File><File path="Demos\KeyboardViaInt\Doxygen.conf"></File></Folder><Folder name="MouseViaInt"><File path="Demos\MouseViaInt\Descriptors.c"></File><File path="Demos\MouseViaInt\Descriptors.h"></File><File path="Demos\MouseViaInt\makefile"></File><File path="Demos\MouseViaInt\MouseViaInt.c"></File><File path="Demos\MouseViaInt\MouseViaInt.h"></File><File path="Demos\MouseViaInt\MouseViaInt.txt"></File><File path="Demos\MouseViaInt\Doxygen.conf"></File></Folder><Folder name="MouseFullInt"><File path="Demos\MouseFullInt\Descriptors.c"></File><File path="Demos\MouseFullInt\Descriptors.h"></File><File path="Demos\MouseFullInt\makefile"></File><File path="Demos\MouseFullInt\MouseFullInt.c"></File><File path="Demos\MouseFullInt\MouseFullInt.h"></File><File path="Demos\MouseFullInt\MouseFullInt.txt"></File><File path="Demos\MouseFullInt\Doxygen.conf"></File></Folder><Folder name="KeyboardHostWithParser"><File path="Demos\KeyboardHostWithParser\makefile"></File><File path="Demos\KeyboardHostWithParser\KeyboardHostWithParser.c"></File><File path="Demos\KeyboardHostWithParser\KeyboardHostWithParser.h"></File><File path="Demos\KeyboardHostWithParser\ConfigDescriptor.c"></File><File path="Demos\KeyboardHostWithParser\ConfigDescriptor.h"></File><File path="Demos\KeyboardHostWithParser\HIDReport.c"></File><File path="Demos\KeyboardHostWithParser\HIDReport.h"></File><File path="Demos\KeyboardHostWithParser\Doxygen.conf"></File><File path="Demos\KeyboardHostWithParser\KeyboardHostWithParser.txt"></File></Folder><Folder name="MouseHostWithParser"><File path="Demos\MouseHostWithParser\makefile"></File><File path="Demos\MouseHostWithParser\MouseHostWithParser.c"></File><File path="Demos\MouseHostWithParser\MouseHostWithParser.h"></File><File path="Demos\MouseHostWithParser\ConfigDescriptor.c"></File><File path="Demos\MouseHostWithParser\ConfigDescriptor.h"></File><File path="Demos\MouseHostWithParser\HIDReport.c"></File><File path="Demos\MouseHostWithParser\HIDReport.h"></File><File path="Demos\MouseHostWithParser\Doxygen.conf"></File><File path="Demos\MouseHostWithParser\MouseHostWithParser.txt"></File></Folder><Folder name="MIDI"><File path="Demos\MIDI\Descriptors.c"></File><File path="Demos\MIDI\Descriptors.h"></File><File path="Demos\MIDI\makefile"></File><File path="Demos\MIDI\MIDI.c"></File><File path="Demos\MIDI\MIDI.h"></File><File path="Demos\MIDI\Doxygen.conf"></File><File path="Demos\MIDI\MIDI.txt"></File></Folder><Folder name="CDCHost"><File path="Demos\CDCHost\CDCHost.c"></File><File path="Demos\CDCHost\CDCHost.h"></File><File path="Demos\CDCHost\makefile"></File><File path="Demos\CDCHost\ConfigDescriptor.c"></File><File path="Demos\CDCHost\ConfigDescriptor.h"></File><File path="Demos\CDCHost\Doxygen.conf"></File><File path="Demos\CDCHost\CDCHost.txt"></File></Folder><Folder name="StillImageHost"><File path="Demos\StillImageHost\makefile"></File><File path="Demos\StillImageHost\PIMACodes.h"></File><File path="Demos\StillImageHost\StillImageCommands.c"></File><File path="Demos\StillImageHost\StillImageCommands.h"></File><File path="Demos\StillImageHost\StillImageHost.c"></File><File path="Demos\StillImageHost\StillImageHost.h"></File><File path="Demos\StillImageHost\ConfigDescriptor.c"></File><File path="Demos\StillImageHost\ConfigDescriptor.h"></File><File path="Demos\StillImageHost\Doxygen.conf"></File></Folder><Folder name="KeyboardFullInt"><File path="Demos\KeyboardFullInt\Descriptors.c"></File><File path="Demos\KeyboardFullInt\Descriptors.h"></File><File path="Demos\KeyboardFullInt\KeyboardFullInt.c"></File><File path="Demos\KeyboardFullInt\KeyboardFullInt.h"></File><File path="Demos\KeyboardFullInt\makefile"></File><File path="Demos\KeyboardFullInt\KeyboardFullInt.txt"></File><File path="Demos\KeyboardFullInt\Doxygen.conf"></File></Folder><Folder name="RNDISEthernet"><File path="Demos\RNDISEthernet\RNDIS.c"></File><File path="Demos\RNDISEthernet\Descriptors.c"></File><File path="Demos\RNDISEthernet\Webserver.h"></File><File path="Demos\RNDISEthernet\ARP.c"></File><File path="Demos\RNDISEthernet\ARP.h"></File><File path="Demos\RNDISEthernet\Descriptors.h"></File><File path="Demos\RNDISEthernet\DHCP.c"></File><File path="Demos\RNDISEthernet\DHCP.h"></File><File path="Demos\RNDISEthernet\Ethernet.c"></File><File path="Demos\RNDISEthernet\Ethernet.h"></File><File path="Demos\RNDISEthernet\EthernetProtocols.h"></File><File path="Demos\RNDISEthernet\ICMP.c"></File><File path="Demos\RNDISEthernet\ICMP.h"></File><File path="Demos\RNDISEthernet\IP.c"></File><File path="Demos\RNDISEthernet\IP.h"></File><File path="Demos\RNDISEthernet\makefile"></File><File path="Demos\RNDISEthernet\ProtocolDecoders.c"></File><File path="Demos\RNDISEthernet\ProtocolDecoders.h"></File><File path="Demos\RNDISEthernet\RNDIS.h"></File><File path="Demos\RNDISEthernet\RNDISEthernet.aps"></File><File path="Demos\RNDISEthernet\RNDISEthernet.c"></File><File path="Demos\RNDISEthernet\RNDISEthernet.h"></File><File path="Demos\RNDISEthernet\TCP.c"></File><File path="Demos\RNDISEthernet\TCP.h"></File><File path="Demos\RNDISEthernet\UDP.c"></File><File path="Demos\RNDISEthernet\UDP.h"></File><File path="Demos\RNDISEthernet\Webserver.c"></File><File path="Demos\RNDISEthernet\LUFA RNDIS.inf"></File><File path="Demos\RNDISEthernet\Doxygen.conf"></File><File path="Demos\RNDISEthernet\RNDISEthernet.txt"></File><File path="Demos\RNDISEthernet\RNDISConstants.h"></File></Folder><Folder name="KeyboardMouse"><File path="Demos\KeyboardMouse\Descriptors.c"></File><File path="Demos\KeyboardMouse\Descriptors.h"></File><File path="Demos\KeyboardMouse\KeyboardMouse.c"></File><File path="Demos\KeyboardMouse\KeyboardMouse.h"></File><File path="Demos\KeyboardMouse\makefile"></File><File path="Demos\KeyboardMouse\KeyboardMouse.txt"></File><File path="Demos\KeyboardMouse\Doxygen.conf"></File></Folder><Folder name="DualCDC"><File path="Demos\DualCDC\Descriptors.c"></File><File path="Demos\DualCDC\Descriptors.h"></File><File path="Demos\DualCDC\makefile"></File><File path="Demos\DualCDC\DualCDC.c"></File><File path="Demos\DualCDC\DualCDC.h"></File><File path="Demos\DualCDC\DualCDC.txt"></File><File path="Demos\DualCDC\LUFA DualCDC.inf"></File><File path="Demos\DualCDC\Doxygen.conf"></File></Folder><File path="Demos\makefile"></File></Folder><Folder name="LUFA"><Folder name="Common"><File path="LUFA\Common\Common.h"></File><File path="LUFA\Common\FunctionAttributes.h"></File><File path="LUFA\Common\ButtLoadTag.h"></File><File path="LUFA\Common\BoardTypes.h"></File></Folder><Folder name="Drivers"><Folder name="USB"><Folder name="LowLevel"><File path="LUFA\Drivers\USB\LowLevel\HostChapter9.h"></File><File path="LUFA\Drivers\USB\LowLevel\LowLevel.c"></File><File path="LUFA\Drivers\USB\LowLevel\LowLevel.h"></File><File path="LUFA\Drivers\USB\LowLevel\Pipe.c"></File><File path="LUFA\Drivers\USB\LowLevel\Pipe.h"></File><File path="LUFA\Drivers\USB\LowLevel\StdRequestType.h"></File><File path="LUFA\Drivers\USB\LowLevel\DevChapter9.c"></File><File path="LUFA\Drivers\USB\LowLevel\DevChapter9.h"></File><File path="LUFA\Drivers\USB\LowLevel\Device.h"></File><File path="LUFA\Drivers\USB\LowLevel\Endpoint.c"></File><File path="LUFA\Drivers\USB\LowLevel\Endpoint.h"></File><File path="LUFA\Drivers\USB\LowLevel\Host.c"></File><File path="LUFA\Drivers\USB\LowLevel\Host.h"></File><File path="LUFA\Drivers\USB\LowLevel\HostChapter9.c"></File><File path="LUFA\Drivers\USB\LowLevel\OTG.h"></File><File path="LUFA\Drivers\USB\LowLevel\USBMode.h"></File><File path="LUFA\Drivers\USB\LowLevel\StreamCallbacks.h"></File></Folder><Folder name="HighLevel"><File path="LUFA\Drivers\USB\HighLevel\USBTask.h"></File><File path="LUFA\Drivers\USB\HighLevel\Events.c"></File><File path="LUFA\Drivers\USB\HighLevel\Events.h"></File><File path="LUFA\Drivers\USB\HighLevel\USBInterrupt.c"></File><File path="LUFA\Drivers\USB\HighLevel\USBInterrupt.h"></File><File path="LUFA\Drivers\USB\HighLevel\USBTask.c"></File><File path="LUFA\Drivers\USB\HighLevel\StdDescriptors.c"></File><File path="LUFA\Drivers\USB\HighLevel\StdDescriptors.h"></File></Folder><Folder name="Class"><File path="LUFA\Drivers\USB\Class\HIDParser.c"></File><File path="LUFA\Drivers\USB\Class\HIDParser.h"></File><File path="LUFA\Drivers\USB\Class\HIDReportData.h"></File><File path="LUFA\Drivers\USB\Class\ConfigDescriptor.c"></File><File path="LUFA\Drivers\USB\Class\ConfigDescriptor.h"></File></Folder><File path="LUFA\Drivers\USB\USB.h"></File></Folder><Folder name="Misc"><File path="LUFA\Drivers\Misc\TerminalCodes.h"></File></Folder><Folder name="AT90USBXXX"><Folder name="AT90USBXXX67"><File path="LUFA\Drivers\AT90USBXXX\AT90USBXXX67\ADC.h"></File></Folder><File path="LUFA\Drivers\AT90USBXXX\Serial_Stream.h"></File><File path="LUFA\Drivers\AT90USBXXX\ADC.h"></File><File path="LUFA\Drivers\AT90USBXXX\Serial.c"></File><File path="LUFA\Drivers\AT90USBXXX\Serial.h"></File><File path="LUFA\Drivers\AT90USBXXX\Serial_Stream.c"></File><File path="LUFA\Drivers\AT90USBXXX\SPI.h"></File></Folder><Folder name="Board"><Folder name="USBKEY"><File path="LUFA\Drivers\Board\USBKEY\Dataflash.h"></File><File path="LUFA\Drivers\Board\USBKEY\Joystick.h"></File><File path="LUFA\Drivers\Board\USBKEY\HWB.h"></File><File path="LUFA\Drivers\Board\USBKEY\AT45DB642D.h"></File><File path="LUFA\Drivers\Board\USBKEY\LEDs.h"></File></Folder><Folder name="STK526"><File path="LUFA\Drivers\Board\STK526\Dataflash.h"></File><File path="LUFA\Drivers\Board\STK526\Joystick.h"></File><File path="LUFA\Drivers\Board\STK526\HWB.h"></File><File path="LUFA\Drivers\Board\STK526\AT45DB642D.h"></File><File path="LUFA\Drivers\Board\STK526\LEDs.h"></File></Folder><Folder name="STK525"><File path="LUFA\Drivers\Board\STK525\Dataflash.h"></File><File path="LUFA\Drivers\Board\STK525\Joystick.h"></File><File path="LUFA\Drivers\Board\STK525\HWB.h"></File><File path="LUFA\Drivers\Board\STK525\AT45DB321C.h"></File><File path="LUFA\Drivers\Board\STK525\LEDs.h"></File></Folder><Folder name="RZUSBSTICK"><File path="LUFA\Drivers\Board\RZUSBSTICK\LEDs.h"></File></Folder><Folder name="ATAVRUSBRF01"><File path="LUFA\Drivers\Board\ATAVRUSBRF01\LEDs.h"></File><File path="LUFA\Drivers\Board\ATAVRUSBRF01\HWB.h"></File></Folder><File path="LUFA\Drivers\Board\Temperature.h"></File><File path="LUFA\Drivers\Board\Dataflash.h"></File><File path="LUFA\Drivers\Board\HWB.h"></File><File path="LUFA\Drivers\Board\Joystick.h"></File><File path="LUFA\Drivers\Board\Temperature.c"></File><File path="LUFA\Drivers\Board\LEDs.h"></File></Folder></Folder><Folder name="Scheduler"><File path="LUFA\Scheduler\Scheduler.h"></File><File path="LUFA\Scheduler\Scheduler.c"></File></Folder><Folder name="MemoryAllocator"><File path="LUFA\MemoryAllocator\DynAlloc.h"></File><File path="LUFA\MemoryAllocator\DynAlloc.c"></File></Folder><Folder name="DriverStubs"><File path="LUFA\DriverStubs\Dataflash.h"></File><File path="LUFA\DriverStubs\HWB.h"></File><File path="LUFA\DriverStubs\Joystick.h"></File><File path="LUFA\DriverStubs\LEDs.h"></File></Folder><File path="LUFA\makefile"></File><File path="LUFA\Version.h"></File><File path="LUFA\BuildingLinkableLibraries.txt"></File><File path="LUFA\GettingStarted.txt"></File><File path="LUFA\MainPage.txt"></File><File path="LUFA\SchedulerOverview.txt"></File><File path="LUFA\VIDAndPIDValues.txt"></File><File path="LUFA\ChangeLog.txt"></File><File path="LUFA\CompileTimeTokens.txt"></File><File path="LUFA\MigrationInformation.txt"></File><File path="LUFA\DirectorySummaries.txt"></File><File path="LUFA\Doxygen.conf"></File><File path="LUFA\WritingBoardDrivers.txt"></File></Folder><Folder name="Projects"><Folder name="MagStripe"><File path="Projects\Magstripe\Descriptors.c"></File><File path="Projects\Magstripe\Descriptors.h"></File><File path="Projects\Magstripe\Magstripe.c"></File><File path="Projects\Magstripe\Magstripe.h"></File><File path="Projects\Magstripe\MagstripeHW.h"></File><File path="Projects\Magstripe\makefile"></File><File path="Projects\Magstripe\Magstripe.txt"></File><File path="Projects\Magstripe\Doxygen.conf"></File><File path="Projects\Magstripe\CircularBitBuffer.c"></File><File path="Projects\Magstripe\CircularBitBuffer.h"></File></Folder><Folder name="AVRISP_Programmer"><File path="Projects\AVRISP_Programmer\AVRISP_Firmware_Design.txt"></File><File path="Projects\AVRISP_Programmer\AVRISP_Programmer.c"></File><File path="Projects\AVRISP_Programmer\AVRISP_Programmer.h"></File><File path="Projects\AVRISP_Programmer\AVRISP_Programmer.txt"></File><File path="Projects\AVRISP_Programmer\Descriptors.c"></File><File path="Projects\AVRISP_Programmer\makefile"></File><File path="Projects\AVRISP_Programmer\Sample_Programming_Session.txt"></File><File path="Projects\AVRISP_Programmer\RingBuff.c"></File><File path="Projects\AVRISP_Programmer\RingBuff.h"></File></Folder><File path="Projects\makefile"></File></Folder><Folder name="Bootloaders"><Folder name="DFU"><File path="Bootloaders\DFU\BootloaderDFU.c"></File><File path="Bootloaders\DFU\BootloaderDFU.h"></File><File path="Bootloaders\DFU\Descriptors.c"></File><File path="Bootloaders\DFU\Descriptors.h"></File><File path="Bootloaders\DFU\makefile"></File><File path="Bootloaders\DFU\BootloaderDFU.txt"></File><File path="Bootloaders\DFU\Doxygen.conf"></File></Folder><Folder name="CDC"><File path="Bootloaders\CDC\BootloaderCDC.c"></File><File path="Bootloaders\CDC\BootloaderCDC.h"></File><File path="Bootloaders\CDC\Descriptors.c"></File><File path="Bootloaders\CDC\Descriptors.h"></File><File path="Bootloaders\CDC\makefile"></File><File path="Bootloaders\CDC\LUFA CDC Bootloader.inf"></File><File path="Bootloaders\CDC\Doxygen.conf"></File><File path="Bootloaders\CDC\BootloaderCDC.txt"></File></Folder><Folder name="TeensyHID"><File path="Bootloaders\TeensyHID\Descriptors.c"></File><File path="Bootloaders\TeensyHID\Descriptors.h"></File><File path="Bootloaders\TeensyHID\makefile"></File><File path="Bootloaders\TeensyHID\TeensyHID.c"></File><File path="Bootloaders\TeensyHID\TeensyHID.h"></File><File path="Bootloaders\TeensyHID\TeensyHID.txt"></File></Folder><File path="Bootloaders\makefile"></File></Folder><File path="makefile"></File></Project> \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/LUFA/BuildingLinkableLibraries.txt b/digital/avr/modules/usb/lufa/LUFA/BuildingLinkableLibraries.txt
new file mode 100644
index 00000000..51fb973b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/BuildingLinkableLibraries.txt
@@ -0,0 +1,22 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_BuildLibrary Building as a Linkable Library
+ *
+ * The LUFA library can be built as a proper linkable library (with the extention .a) under AVR-GCC, so that
+ * the library does not need to be recompiled with each revision of a user project. Instructions for creating
+ * a library from a given source tree can be found in the AVR-GCC user manual included in the WinAVR install
+ * /Docs/ directory.
+ *
+ * However, building the library is <b>not recommended</b>, as the static (compile-time) options will be
+ * unable to be changed without a recompilation of the LUFA code. Therefore, if the library is to be built
+ * from the LUFA source, it should be made to be application-specific and compiled with the static options
+ * that are required for each project (which should be recorded along with the library).
+ *
+ * Normal library use has the library components compiled in at the same point as the application code, as
+ * demonstrated in the library demos and applications. This is the preferred method, as the library is recompiled
+ * each time to ensure that all static options for a particular application are applied.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/ChangeLog.txt b/digital/avr/modules/usb/lufa/LUFA/ChangeLog.txt
new file mode 100644
index 00000000..41967008
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/ChangeLog.txt
@@ -0,0 +1,387 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+ /** \page Page_ChangeLog Project Changelog
+ *
+ * \section Sec_ChangeLog090209 Version 090209
+ *
+ * - PWM timer mode in AudioOut demo changed to Fast PWM for speed
+ * - Updated Magstripe project to work with the latest hardware revision
+ * - Fixed library not responding to the BCERRI flag correctly in host mode, leading to device lockups
+ * - Fixed library handling Get Descriptor requests when not addressed as standard requests to the device or interface
+ * - Fixed serious data corruption issue in MassStorage demo dataflash write routine
+ * - Added new NO_CLEARSET_FEATURE_REQUEST compile time token
+ * - USB task now restores previous global interrupt state after execution, rather than forcing global interrupts to be enabled
+ * - Fixed USB_DeviceEnumerationComplete event firing after each configuration change, rather than once after the initial configuration
+ * - Added ENDPOINT_DOUBLEBANK_SUPPORTED() macros to Endpoint.h, altered ENDPOINT_MAX_SIZE() to allow user to specify endpoint
+ * - ENDPOINT_MAX_ENDPOINTS changed to ENDPOINT_TOTAL_ENDPOINTS, PIPE_MAX_PIPES changed to PIPE_TOTAL_PIPES
+ * - Endpoint and Pipe non-control stream functions now ensure endpoint or pipe is ready before reading or writing
+ * - Changed Teensy bootloader to use a watchdog reset when exiting rather than a software jump
+ * - Fixed integer promotion error in MassStorage and MassStorageHost demos, corrupting read/write transfers
+ * - SPI_SendByte is now SPI_TransferByte, added new SPI_SendByte and SPI_ReceiveByte functions for fast one-way transfer
+ * - MassStorage demo changed to use new fast one-way SPI transfers to increase throughput
+ * - MassStorage handling of Mass Storage Reset class request improved
+ * - Altered MassStorage demo dataflash block read code for speed
+ * - Added USB_IsSuspended global flag
+ * - Simplified internal Dual Mode (OTG) USB library code to reduce code size
+ * - Extended stream timeout period to 100ms from 50ms
+ * - Mass Storage Host demo commands now all return an error code from the Pipe_Stream_RW_ErrorCodes_t enum
+ * - Added SubErrorCode parameter to the USB_DeviceEnumerationFailed event
+ * - VBUS drop interrupt now disabled during the manual-to-auto VBUS delivery handoff
+ * - Simplified low level backend so that device/host mode initialization uses the same code paths
+ * - Added workaround for faulty Mass Storage devices which do not implement the required GET_MAX_LUN request
+ * - Removed buggy Telnet application from the RNDIS demo
+ * - Moved Mass Storage class requests in the Mass Storage Host demo to wrapper functions in MassStoreCommands.c
+ * - Fixed incorrect SCSI command size value in the Request Sense command in MassStoreCommands.c
+ * - Added SetProtocol request to HID class non-parser Mouse and Keyboard demos to force devices to use the correct Boot Protocol
+ * - Added new "dfu" and "flip" programming targets to project makefiles
+ * - HID_PARSE_Sucessful enum member typo corrected to HID_PARSE_Successful
+ * - Changed COLLECTION item strucutres in the HID descriptor parser to include the collection's Usage Page value
+ * - Serial driver now sets Tx line as output, enables pullup on Rx line
+ * - Fixed smaller USB AVRs raising multiple connection and disconnection events when NO_LIMITED_CONTROLLER_CONNECT is disabled
+ * - Added HOST_DEVICE_SETTLE_DELAY_MS to give the host delay after a device is connected before it is enumerated
+ * - Fixed KeyboardHostWithParser demo linking against the wrong global variables
+ * - Completed doxygen documentation of remaining library bootloaders, demos and projects
+ * - Fixed incorrect bootloader start address in the TeensyHID bootloader
+ * - Added HWB button whole-disk ASCII dump functionality to MassStoreHost demo
+ * - Replaced printf_P(PSTR("%c"), {Variable}) calls with putchar(<Variable>) for speed and size savings
+ * - Serial driver now accepts baud rates over 16-bits in size, added double speed flag option
+ * - Fixed incorrect callback abort return value in Pipe.c
+ * - Added new flip-ee and dfu-ee makefile targets (courtesy of Opendous Inc.)
+ * - Removed reboot-on-disconnect code from the TeensyHID bootloader, caused problems on some systems
+ * - Fixed AudioOutput and AudioInput demos looping on the endpoint data, rather than processing a sample at a time and returning
+ * each time the task runs to allow for other tasks to execute
+ * - Added support for the Atmel ATAVRUSBRF01 board
+ * - Added AVRISP Programmer Project, courtesy of Opendous Inc.
+ * - Fixed CDC Host demo not searching through both CDC interfaces for endpoints
+ * - Fixed incorrect Product String descriptor length in the DFU class bootloader
+ * - Fixed failed descriptor searches in ConfigDescriptor.c eating the last checked descriptor when another search is started
+ *
+ * \section Sec_ChangeLog081224 Version 081224
+ *
+ * - MyUSB name changed to LUFA, the Lightweight USB Framework for AVRs
+ * - Fixed Mass Storage Host demo's MassStore_SendCommand() delay in the incorrect place
+ * - Fixed USBtoSerial demo not calling ReconfigureUSART() after a change in the line encoding
+ * - Fixed infinite loop in host mode Host-to-Device control transfers with data stages
+ * - HID report parser now supports devices with multiple reports in one interface via Report IDs
+ * - Fixed RZUSBSTICK board LED driver header incorrect macro definition order causing compile errors
+ * - Calling USB_Init() when the USB interface is already configured now forces a complete interface reset
+ * and re-enumeration - fixes MyUSB DFU bootloader not switching to app code correctly when soft reset used
+ * - Fixed "No newline at end of file" warning when stream callbacks are enabled
+ * - DFU bootloader now uses fixed signature bytes per device, rather than reading them out dynamically for size
+ * - Added new FIXED_CONTROL_ENDPOINT_SIZE and USE_SINGLE_DEVICE_CONFIGURATION switches to statically define certain values to
+ * reduce compiled binary size
+ * - Added new NO_LIMITED_CONTROLLER_CONNECT switch to prevent the library from trying to determine bus connection
+ * state from the suspension and wake up events on the smaller USB AVRs
+ * - Added summary of all library compile time tokens to the documentation
+ * - Added overview of the LUFA scheduler to the documentation
+ * - Removed MANUAL_PLL_CONTROL compile time token, replaced with a mask for the USB_Init() Options parameter
+ * - CDC bootloader now uses the correct non-far or far versions of the pgm_* functions depending on if RAMPZ is defined
+ * - Doxygen documentation now contains documentation on all the projects, bootloaders and most demos included with the library
+ * - CDC bootloader now runs user application when USB disconnected rather than waiting for a hard reset
+ * - MouseHostWithParser and KeyboardHostWithParser now support multiple-report devices
+ * - RNDIS demo can now close connections correctly using the new TCP_APP_CLOSECONNECTION() macro - used in Webserver
+ * - Fixed the DFU bootloader, no longer freezes up when certain files are programmed into an AVR, made reading/writing faster
+ * - Fixed mouse/joystick up/down movements reversed - HID mouse X/Y coordinates use a left-handed coordinate system, not a normal
+ * right-handed system
+ * - Added stub code to the CDC and USBtoSerial demos showing how to read and set the RS-232 handshake lines - not currently used in
+ * the demos, but the example code and supporting defines are now in place
+ * - Interrupts are now disabled when processing a control request in device mode, to avoid exceeding the strict control request
+ * timing requirements.
+ * - All demos now use a central StatusUpdate() function rather than direct calls to the board LED functions, so that the demos can
+ * easily be altered to show different LED combinations (or do something else entirely) as the demo's status changes
+ * - Removed LED commands from the CDC bootloader, unused by most AVR910 programming software
+ * - Fixed RNDIS demo ICMP ping requests echoing back incorrect data
+ * - Added DHCP server code to RNDIS demo, allowing for hands-free autoconfiguration on any PC
+ * - Fixed DFU bootloader PID value for the ATMEGA16U4 AVR
+ * - Endpoint and Pipe configuration functions now return an error code indicating success or failure
+ * - USB Reset in device mode now resets and disables all device endpoints
+ * - Added intermediate states to the host mode state machine, reducing the USB task blocking time to no more than 1ms explicitly per
+ * invocation when in host mode
+ * - Added support for the ATMEGA32U6 microcontroller
+ * - Added STATIC_ENDPOINT_CONFIGURATION compile time option, enabled in the bootloaders to minimize space usage
+ * - Removed redudant code from the USB device GetStatus() chapter 9 processing routine
+ * - Added new TeensyHID bootloader, compatible with the Teensy HID protocol (http://www.pjrc.com/teensy/)
+ * - Versions are now numbered by release dates, rather than arbitrary major/minor revision numbers
+ * - USB_RemoteWakeupEnabled is now correctly set and cleared by SetFeature and ClearFeature requests from the host
+ * - Changed prototype of GetDescriptor, so that it now returns the descriptor size (or zero if the descriptor doesn't exist)
+ * rather than passing the size back to the caller through a parameter and returning a boolean
+ *
+ * \section Sec_ChangeLog153 Version 1.5.3 - Released 2nd October, 2008
+ *
+ * - Fixed CDC bootloader using pgmspace macros for some descriptors inappropriately
+ * - Updated all Mouse and Keyboard device demos to include boot protocol support (now works in BIOS)
+ * - Renamed bootloader directories to remove spaces, which were causing build problems on several OSes
+ * - Removed serial number strings from all but the MassStore demo where it is required - users were not
+ * modifing the code to either ommit the descriptor or use a unique serial per device causing problems
+ * when multiple units of the same device were plugged in at the same time
+ * - AudioOutput and AudioInput demos now correctly silence endpoints when not enabled by the host
+ * - Added KeyboardMouse demo (Keyboard and Mouse functionality combined into a single demo)
+ * - Added DriverStubs directory to house board level driver templates, to make MyUSB compatible custom board
+ * driver creation easier
+ * - Extended MassStorage demo to support multiple LUNs, 2 by default
+ * - Fixed incorrect device address mask, preventing the device from enumerating with addresses larger than 63
+ * - Fixed incorrect data direction mask in the GetStatus standard request, preventing it from being handled
+ * - Fixed incorrect GetStatus standard request for endpoints, now returns the endpoint STALL status correctly
+ * - Added in new USB_RemoteWakeupEnabled and USB_CurrentlySelfPowered flags rather than using fixed values
+ * - Added DualCDC demo to demonstrate the use of Interface Association Descriptors
+ * - Added pipe NAK detection and clearing API
+ * - Added pipe status change (NAK, STALL, etc.) interrupt API
+ * - Fixed MassStorageHost demo so that it no longer freezes randomly when issuing several commands in a row
+ * - Host demos configuration descriptor routines now return a unique error code when the returned data does
+ * not have a valid configuration descriptor header
+ * - Added Endpoint_WaitUntilReady() and Pipe_WaitUntilReady() functions
+ * - Stream functions now have software timeouts, timeout period can be set by the USB_STREAM_TIMEOUT_MS token
+ * - All demos now pass the USB.org automated Chapter 9 device compliance tests
+ * - All HID demos now pass the USB.org automated HID compliance tests
+ * - Polling interval of the interrupt endpoint in the CDC based demos changed to 0xFF to fix problems on Linux systems
+ * - Changed stream functions to accept a new callback function, with NO_STREAM_CALLBACKS used to disable all callbacks
+ * - Mass Storage demo dataflash management routines changed to use the endpoint stream functions
+ * - Added AVRStudio project files for each demo in addition to the existing Programmer's Notepad master project file
+ * - Re-added call to ReconfigureUSART() in USBtoSerial SetLineCoding request, so that baud rate changes
+ * are reflected in the hardware (change was previously lost)
+ *
+ *
+ * \section Sec_ChangeLog152 Version 1.5.2 - Released 31st July, 2008
+ *
+ * - Fixed SwapEndian_32() function in Common.h so that it now works correctly (wrong parameter types)
+ * - Updated RNDIS demo - notification endpoint is no longer blocking so that it works with faulty Linux RNDIS
+ * implementations (where the notification endpoint is ignored in favour of polling the control endpoint)
+ * - Fixed incorrect Vendor Description string return size in RNDIS demo for the OID_GEN_VENDOR_DESCRIPTION OID token
+ * - Added very basic TCP/IP stack and HTTP/TELNET servers to RNDIS demo
+ * - Fixed DFU bootloader exit causing programming software to complain about failed writes
+ * - Fixed DFU bootloader EEPROM programming mode wiping first flash page
+ * - Fixed Clear/Set Feature device standard request processing code (fixing MassStorage demo in the process)
+ * - Added support for the ATMEGA16U4 AVR microcontroller
+ * - Library licence changed from LGPLv3 to MIT license
+ *
+ *
+ * \section Sec_ChangeLog151 Version 1.5.1 - Released 31st July, 2008
+ *
+ * - Changed host demos to enable the host function task on the firing of the USB_DeviceEnumerationComplete event
+ * rather than the USB_DeviceAttached event
+ * - HID Usage Stack now forcefully cleared after an IN/OUT/FEATURE item has been completely processed to remove
+ * any referenced but not created usages
+ * - Changed USB_INT_DisableAllInterrupts() and USB_INT_ClearAllInterrupts(), USB_Host_GetNextDescriptorOfType(),
+ * USB_Host_GetNextDescriptorOfTypeBefore(), USB_Host_GetNextDescriptorOfTypeAfter() to normal functions (from inline)
+ * - Fixed USBtoSerial demo not sending data, only receiving
+ * - Fixed main makefile to make all by default, fixed MagStripe directory case to prevent case-sensitive path problems
+ * - ConfigDescriptor functions made normal, instead of static inline
+ * - Pipe/Endpoint *_Ignore_* functions changed to *_Discard_*, old names still present as aliases
+ * - Fixed ENDPOINT_MAX_SIZE define to be correct on limited USB controller AVRs
+ * - Changed endpoint and pipe size translation routines to use previous IF/ELSE IF cascade code, new algorithmic
+ * approach was buggy and caused problems
+ * - Bootloaders now compile with -fno-inline-small-functions option to reduce code size
+ * - Audio demos now use correct endpoint sizes for full and limited controller USB AVRs, double banking in all cases
+ * to be in line with the specification (isochronous endpoints MUST be double banked)
+ * - Added Interface Association descriptor to StdDescriptors.h, based on the relevant USB2.0 ECN
+ * - Fixed MIDI demo, corrected Audio Streaming descriptor to follow the MIDI-specific AS structure
+ * - Fixed HID class demo descriptors so that the HID interface's protocol is 0x00 (required for non-boot protocol HID
+ * devices) to prevent problems on hosts expecting the boot protocol functions to be supported
+ * - Added read/write control stream functions to Endpoint.h
+ * - Fixed AudioOut demo not setting port pins to inputs on USB disconnect properly
+ * - Added RNDISEthernet demo application
+ *
+ *
+ * \section Sec_ChangeLog150 Version 1.5.0 - Released 10 June, 2008
+ *
+ * - Fixed MIDI demo, now correctly waits for the endpoint to be ready between multiple note messages
+ * - Added CDC Host demo application
+ * - Added KeyboardFullInt demo application
+ * - Endpoint and Pipe creation routines now mask endpoint/pipe size with the size mask, to remove transaction
+ * size bits not required for the routines (improves compatibility with devices)
+ * - Fixed AudioInput demo - now correctly sends sampled audio to the host PC
+ * - Fixed AudioOutput demo oncemore -- apparently Windows requires endpoint packets to be >=192 bytes
+ * - Shrunk round-robbin scheduler code slightly via the use of struct pointers rather than array indexes
+ * - Fixed off-by-one error when determining if the Usage Stack is full inside the HID Report parser
+ * - Renamed Magstripe.h to MagstripeHW.h and moved driver out of the library and into the MagStripe demo folder
+ * - Added preprocessor checks to enable C linkage on the library components when used with a C++ compiler
+ * - Added Still Image Host demo application
+ * - The USB device task now restores the previously selected endpoint, allowing control requests to be transparently
+ * handled via interrupts while other endpoints are serviced through polling
+ * - Fixed device signature being sent in reverse order in the CDC bootloader
+ * - Host demos now have a seperate ConfigDescriptor.c/.h file for configuration descriptor processing
+ * - HostWithParser demos now have a seperate HIDReport.c/.h file for HID report processing and dumping
+ * - Removed non-mandatory commands from MassStorage demo to save space, fixed SENSE ResponseCode value
+ * - CDC demos now send empty packets after sending a full one to prevent buffering issues on the host
+ * - Updated demo descriptors to use VID/PID values donated by Atmel
+ * - Added DoxyGen documentation to the source files
+ * - Fixed Serial_IsCharRecieved() definition, was previously reversed
+ * - Removed seperate USB_Descriptor_Language_t descriptor, USB_Descriptor_String_t is used instead
+ * - Removed unused Device Qualifier descriptor structure
+ * - Renamed the USB_CreateEndpoints event to the more appropriate USB_ConfigurationChanged
+ * - Fixed MassStorageHost demo reading in the block data in reverse
+ * - Removed outdated typedefs in StdRequestType.h, superceeded by the macro masks
+ * - Corrected OTG.h is now included when the AVR supports both Host and Device modes, for creating OTG products
+ * - USB_DeviceEnumerationComplete event is now also fired when in device mode and the host has finished its enumeration
+ * - Interrupt driven demos now properly restore previously selected endpoint when ISR is complete
+ * - USB_HOST_TIMEOUT_MS is now overridable in the user project makefile to a custom fixed timeout value
+ * - Renamed USB_Host_SOFGeneration_* macros to more friendly USB_Host_SuspendBus(), USB_Host_ResumeBus()
+ * and USB_Host_IsBusSuspended()
+ * - Renamed *_*_Is* macros to *_Is* to make all flag checking macros consistant, Pipe_SetInterruptFreq() is now
+ * Pipe_SetInterruptPeriod() to use the correct terminology
+ * - UnicodeString member of USB_Descriptor_String_t struct changed to an ordinary int array type, so that the GCC
+ * Unicode strings (prefixed with an L before the opening quotation mark) can be used instead of explicit arrays
+ * of ASCII characters
+ * - Fixed Endpoint/Pipes being configured incorrectly if the maximum endpoint/pipe size for the selected USB AVR
+ * model was given as the bank size
+ * - HID device demos now use a true raw array for the HID report descriptor rather than a struct wrapped array
+ * - Added VERSION_BCD() macro, fixed reported HID and USB version numbers in demo descriptors
+ * - Cleaned up GetDescriptor device chapter 9 handler function
+ * - Added GET_REPORT class specific request to HID demos to make them complaint to the HID class
+ * - Cleaned up setting of USB_IsInitialized and USB_IsConnected values to only when needed
+ * - Removed Atomic.c and ISRMacro.h; the library was already only compatible with recent avr-lib-c for other reasons
+ * - All demos and library functions now use USB standardized names for the USB data (bRequest, wLength, etc.)
+ * - Added USE_NONSTANDARD_DESCRIPTOR_NAMES token to switch back to the non-standard descriptor element names
+ *
+ *
+ * \section Sec_ChangeLog141 Version 1.4.1 - Released 5 May, 2008
+ *
+ * - Enhanced KeyboardWithParser demo, now prints out pressed alphanumeric characters like the standard demo
+ * - Fixed MassStorage demo, read/writes using non mode-10 commands now work correctly
+ * - Corrected version number in Version.h
+ *
+ *
+ * \section Sec_ChangeLog140 Version 1.4.0 - Released 5 May, 2008
+ *
+ * - Added HID Report Parser API to the library
+ * - Added Mouse and Keyboard host demo applications, using the new HID report parser engine
+ * - Added MouseFullInt demo, which demonstrates a fully interrupt (including control requests) mouse device
+ * - Fixed incorrect length value in the audio control descriptor of the AudioOutput and AudioInput demos
+ * - Added MIDI device demo application to the library
+ * - Fixed problem preventing USB devices from being resumed from a suspended state
+ * - Added new CDC class bootloader to the library, based on the AVR109 bootloader protocol
+ * - Added header to each demo application indicating the mode, class, subclass, standards used and supported speed
+ * - Functions expecting endpoint/pipe numbers are no longer automatically masked against ENDPOINT_EPNUM_MASK or
+ * PIPE_PIPENUM_MASK - this should be manually added to code which requires it
+ * - Fixed DFU class bootloader - corrected frequency of flash page writes, greatly reducing programming time
+ * - Renamed AVR_HOST_GetDeviceConfigDescriptor() to USB_Host_GetDeviceConfigDescriptor() and AVR_HOST_GetNextDescriptor()
+ * to USB_Host_GetNextDescriptor()
+ * - Added new USB_Host_GetNextDescriptorOfTypeBefore() and USB_Host_GetNextDescriptorOfTypeAfter() routines
+ * - Moved configuration descriptor routines to MyUSB/Drivers/USB/Class/, new accompanying ConfigDescriptors.c file
+ * - Added new configuration descriptor comparator API for more powerful descriptor parsing, updated host demos to use the
+ * new comparator API
+ * - Fixed MassStorageHost demo capacity printout, and changed data read/write mode from little-endian to the correct
+ * big-endian for SCSI devices
+ * - Fixed macro/function naming consistancy; USB_HOST is now USB_Host, USB_DEV is now USB_Device
+ * - Added better error reporting to host demos
+ * - Added 10 microsecond delay after addressing devices in host mode, to prevent control stalls
+ *
+ *
+ * \section Sec_ChangeLog132 Version 1.3.2 - Released April 1st, 2008
+ *
+ * - Added call to ReconfigureUSART() in USBtoSerial SetLineCoding request, so that baud rate changes
+ * are reflected in the hardware
+ * - Fixed CDC and USBtoSerial demos - Stream commands do not work for control endpoints, and the
+ * GetLineCoding request had an incorrect RequestType mask preventing it from being processed
+ * - Improved reliability of the USBtoSerial demo, adding a busy wait while the buffer is full
+ * - Device control endpoint size is now determined from the device's descriptors rather than being fixed
+ * - Seperated out SPI code into new SPI driver in AT90USBXXX driver directory
+ * - Bootloader now returns correct PID for the selected USB AVR model, not just the AT90USB128X PID
+ * - Added support for the RZUSBSTICK board
+ * - Bicolour driver removed in favour of generic LEDs driver
+ * - Added support for the ATMEGA32U4 AVR
+ * - Added MANUAL_PLL_CONTROL compile time option to prevent the USB library from manipulating the PLL
+ *
+ *
+ * \section Sec_ChangeLog131 Version 1.3.1 - Released March 19th 2008
+ *
+ * - Fixed USB to Serial demo - class value in the descriptors was incorrect
+ * - Control endpoint size changed from 64 bytes to 8 bytes to save on USB FIFO RAM and to allow low
+ * speed mode devices to enumerate properly
+ * - USB to Serial demo data endpoints changed to dual-banked 16 byte to allow the demo to work
+ * on USB AVRs with limited USB FIFO RAM
+ * - Changed demo endpoint numbers to use endpoints 3 and 4 for double banking, to allow limited
+ * USB device controller AVRs (AT90USB162, AT90USB82) to function correctly
+ * - Updated Audio Out demo to use timer 1 for AVRs lacking a timer 3 for the PWM output
+ * - Fixed incorrect USB_DEV_OPT_HIGHSPEED entry in the Mass Storage device demo makefile
+ * - Optimized Mass Storage demo for a little extra transfer speed
+ * - Added LED indicators to the Keyboard demo for Caps Lock, Num Lock and Scroll Lock
+ * - Added Endpoint_Read_Stream, Endpoint_Write_Stream, Pipe_Read_Stream and Pipe_Write_Stream functions
+ * (including Big and Little Endian variants)
+ * - Made Dataflash functions inline for speed, removed now empty Dataflash.c driver file
+ * - Added new SetSystemClockPrescaler() macro - thanks to Joerg Wunsch
+ * - Fixed Endpoint_ClearStall() to function correctly on full USB controller AVRs (AT90USBXXX6/7)
+ * - Endpoint_Setup_In_Clear() and Endpoint_Setup_Out_Clear() no longer set FIFOCON, in line with the
+ * directives in the datasheet
+ * - Fixed PLL prescaler defines for all AVR models and frequencies
+ * - Fixed ENDPOINT_INT_IN and ENDPOINT_INT_OUT definitions
+ * - Added interrupt driven keyboard and mouse device demos
+ * - Combined USB_Device_ClearFeature and USB_Device_SetFeature requests into a single routine for code
+ * size savings
+ * - Added missing Pipe_GetCurrentPipe() macro to Pipe.h
+ *
+ *
+ * \section Sec_ChangeLog130 Version 1.3.0 - Released March 7th 2008
+ *
+ * - Unneccesary control endpoint config removed from device mode
+ * - Fixed device standard request interpreter accidentally processing some class-specific requests
+ * - Added USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS compile time options to instruct the library
+ * to use descriptors stored in RAM or EEPROM rather than flash memory
+ * - All demos now disable watchdog on startup, in case it has been enabled by fuses or the bootloader
+ * - USB_DEV_OPT_LOWSPEED option now works correctly
+ * - Added ability to set the USB options statically for a binary size reduction via the USE_STATIC_OPTIONS
+ * compile time define
+ * - USB_Init no longer takes a Mode parameter if compiled for a USB device with no host mode option, or
+ * if forced to a particular mode via the USB_HOST_ONLY or USB_DEVICE_ONLY compile time options
+ * - USB_Init no longer takes an Options parameter if options statically configured by USE_STATIC_OPTIONS
+ * - Endpoint_Ignore_* and Pipe_Ignore_* made smaller by making the dummy variable non-volatile so that the
+ * compiler can throw away the result more efficiently
+ * - Added in an optional GroupID value to each scheduler entry, so that groups of tasks can once again be
+ * controlled by the new Scheduler_SetGroupTaskMode() routine
+ * - Added support for AT90USB162 and AT90USB82 AVR models
+ * - Added support for the STK525 and STK526 boards
+ * - Added support for custom board drivers to be supplied by selecting the board type as BOARD_USER, and
+ * placing board drivers in {Application Directory}/Board/
+ * - PLL is now stopped and USB clock is frozen when detatched from host in device mode, to save power
+ * - Joystick defines are now in synch with the schematics - orientation will be rotated for the USBKEY
+ * - Fixed USB_DEV_IsUSBSuspended() - now checks the correct register
+ * - Fixed data transfers to devices when in host mode
+ * - Renamed USB_DEV_OPT_HIGHSPEED to USB_DEV_OPT_FULLSPEED and USB_HOST_IsDeviceHighSpeed() to
+ * USB_HOST_IsDeviceFullSpeed() to be in line with the official USB speed names (to avoid confusion with
+ * the real high speed mode, which is unavailable on the USB AVRs)
+ *
+ *
+ * \section Sec_ChangeLog120 Version 1.2.0 - Released February 4th, 2008
+ *
+ * - Added USB_DeviceEnumerationComplete event for host mode
+ * - Added new Scheduler_Init routine to preprepare the scheduler, so that tasks can be started and
+ * stopped before the scheduler has been started (via Scheduler_Start)
+ * - Connection events in both Device and Host mode are now interrupt-driven, allowing the USB management
+ * task to be stopped when the USB is not connected to a host or device
+ * - All demos updated to stop the USB task when not in use via the appropriate USB events
+ * - Mass Storage Host demo application updated to function correctly with all USB flash disks
+ * - Mass Storage Host demo application now prints out the capacity and number of LUNs in the attached
+ * device, and prints the first block as hexadecimal numbers rather than ASCII characters
+ * - Endpoint and Pipe clearing routines now clear the Endpoint/Pipe interrupt and status flags
+ * - Shifted error handling code in the host enum state machine to a single block, to reduce code complexity
+ * - Added in DESCRIPTOR_TYPE, DESCRIPTOR_SIZE and DESCRIPTOR_CAST macros to make config descriptor processing
+ * clearer in USB hosts and DESCRIPTOR_ADDRESS for convenience in USB devices
+ * - Added in alloca macro to common.h, in case the user is using an old version of avr-lib-c missing the macro
+ *
+ *
+ * \section Sec_ChangeLog130 Version 1.1.0 - Released January 25th 2008
+ *
+ * - Fixed DCONNI interrupt being enabled accidentally after a USB reset
+ * - Fixed DDISCI interrupt not being disabled when a device is not connected
+ * - Added workaround for powerless pullup devices causing false disconnect interrupts
+ * - Added USB_DeviceEnumerationFailed event for Host mode
+ * - AVR_HOST_GetDeviceConfigDescriptor routine no longer modifies ConfigSizePtr if a valid buffer
+ * pointer is passed
+ * - Added ALLOCABLE_BYTES to DynAlloc, and added code to make the size of key storage variables
+ * dependant on size of memory parameters passed in via the user project's makefile
+ * - Fixed incorrect device reset routine being called in USBTask
+ * - Devices which do not connect within the standard 300mS are now supported
+ * - Removed incorrect ATTR_PURE from Scheduler_SetTaskMode(), which was preventing tasks from being
+ * started/stopped, as well as USB_InitTaskPointer(), which was breaking dual device/host USB projects
+ * - Changed scheduler to use the task name rather than IDs for setting the task mode, eliminating the
+ * need to have a task ID list
+ * - ID transistion interrupt now raises the appropriate device/host disconnect event if device attached
+ * - Fixed double VBUS change (and VBUS -) event when detatching in device mode
+ * - Added ability to disable ANSI terminal codes by the defining of DISABLE_TERMINAL_CODES in makefile
+ * - Removed return from ConfigurePipe and ConfigureEndpoint functions - use Pipe_IsConfigured() and
+ * Endpoint_IsConfigured() after calling the config functions to determine success
+ */ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/LUFA/Common/BoardTypes.h b/digital/avr/modules/usb/lufa/LUFA/Common/BoardTypes.h
new file mode 100644
index 00000000..d4a36550
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Common/BoardTypes.h
@@ -0,0 +1,72 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file contains constants which can be passed to the compiler (via setting the macro BOARD) in the
+ * user project makefile using the -D option to configure the library board-specific drivers.
+ *
+ * \note Do not include this file directly, rather include the Common.h header file instead to gain this file's
+ * functionality.
+ */
+
+#ifndef __BOARDTYPES_H__
+#define __BOARDTYPES_H__
+
+ /* Preprocessor Checks: */
+ #if !defined(__COMMON_H__)
+ #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Selects the USBKEY specific board drivers, including Dataflash, Joystick and LED drivers. */
+ #define BOARD_USBKEY 0
+
+ /** Selects the STK525 specific board drivers, including Dataflash, Joystick and LED drivers. */
+ #define BOARD_STK525 1
+
+ /** Selects the STK526 specific board drivers, including Dataflash, Joystick and LED drivers. */
+ #define BOARD_STK526 2
+
+ /** Selects the RZUSBSTICK specific board drivers, including the driver for the boards LEDs. */
+ #define BOARD_RZUSBSTICK 3
+
+ /** Selects the ATAVRUSBRF01 specific board drivers, including the driver for the board LEDs. */
+ #define BOARD_ATAVRUSBRF01 4
+
+ /** Selects the user-defined board drivers, which should be placed in the user project's folder
+ * under a directory named /Board/. Each board driver should be named identically to the LUFA
+ * master board driver (i.e., driver in the LUFA/Drivers/Board director) so that the library
+ * can correctly identify it.
+ */
+ #define BOARD_USER 5
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Common/ButtLoadTag.h b/digital/avr/modules/usb/lufa/LUFA/Common/ButtLoadTag.h
new file mode 100644
index 00000000..54fab0f0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Common/ButtLoadTag.h
@@ -0,0 +1,77 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file contains macros for the embedding of compile-time strings into the resultant project binary for
+ * identification purposes. It is designed to prefix "tags" with the magic string of "@(#)" so that the tags
+ * can easily be identified in the binary data.
+ *
+ * These tags are compatible with the ButtLoad project at http://www.fourwalledcubicle.com/ButtLoad.php .
+ */
+
+#ifndef __BUTTLOADTAG_H__
+#define __BUTTLOADTAG_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Creates a new tag in the resultant binary, containing the specified data array. The macro id
+ * parameter is only for identification purposes (so that the tag data can be referenced in code)
+ * and is not visible in the compiled binary.
+ */
+ #define BUTTLOADTAG(id, data) const struct ButtLoadTagData BUTTTAG_##id \
+ PROGMEM __attribute__((used, externally_visible)) = \
+ {MagicString: BT_TAGHEADER, TagData: data}
+
+ /** Macro for retrieving a reference to the specified tag's contents. The tag data is located in
+ * the program memory (FLASH) space, and so must be read out with the macros in avr-libc which
+ * deal with embedded data.
+ */
+ #define BUTTLOADTAG_DATA(id) BUTTTAG_##id.TagData
+
+ /* Structures: */
+ /** Structure for ButtLoad compatible binary tags. */
+ struct ButtLoadTagData
+ {
+ char MagicString[4]; /**< Magic tag header, containing the string "@(#)". */
+ char TagData[]; /**< Tag contents as a char array. */
+ };
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define BT_TAGHEADER {'@','(','#',')'}
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Common/Common.h b/digital/avr/modules/usb/lufa/LUFA/Common/Common.h
new file mode 100644
index 00000000..97e9ce93
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Common/Common.h
@@ -0,0 +1,171 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file contains macros which are common to all library elements, and which may be useful in user code. It
+ * also includes other common headees, such as Atomic.h, FunctionAttributes.h and BoardTypes.h.
+ */
+
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdio.h>
+ #include <avr/version.h>
+
+ #include "FunctionAttributes.h"
+ #include "BoardTypes.h"
+
+ #include <alloca.h>
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Macro for encasing other multi-statment macros. This should be used along with an opening brace
+ * before the start of any multi-statement macro, so that the macros contents as a whole are treated
+ * as a discreete block and not as a list of seperate statements which may cause problems when used as
+ * a block (such as inline IF statments).
+ */
+ #define MACROS do
+
+ /** Macro for encasing other multi-statment macros. This should be used along with a preceeding closing
+ * brace at the end of any multi-statement macro, so that the macros contents as a whole are treated
+ * as a discreete block and not as a list of seperate statements which may cause problems when used as
+ * a block (such as inline IF statments).
+ */
+ #define MACROE while (0)
+
+ /** Defines a volatile NOP statment which cannot be optimized out by the compiler, and thus can always
+ * be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimizer
+ * removes/reorders code to the point where break points cannot reliably be set.
+ */
+ #define JTAG_DEBUG_POINT() asm volatile ("NOP" ::)
+
+ /** Defines an explicit JTAG break point in the resulting binary via the ASM BREAK statment. When
+ * a JTAG is used, this causes the program execution to halt when reached until manually resumed. */
+ #define JTAG_DEBUG_BREAK() asm volatile ("BREAK" ::)
+
+ /** Macro for testing condition "x" and breaking via JTAG_DEBUG_BREAK() if the condition is false. */
+ #define JTAG_DEBUG_ASSERT(x) MACROS{ if (!(x)) { JTAG_DEBUG_BREAK(); } }MACROE
+
+ /** Macro for testing condition "x" and writing debug data to the serial stream if false. As a
+ * prerequisite for this macro, the serial stream should be configured via the Serial_Stream driver.
+ *
+ * The serial output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion
+ * {x} failed."
+ */
+ #define SERIAL_STREAM_ASSERT(x) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \
+ "Assertion \"%s\" failed.\r\n"), \
+ __FILE__, __func__, __LINE__, #x); \
+ } }MACROE
+
+ /* Inline Functions: */
+ /** Function for reliably setting the AVR's system clock prescaler, using inline assembly. This function
+ * is guaranteed to operate reliably regardless of optimization setting or other compile time options.
+ *
+ * \param PrescalerMask The mask of the new prescaler setting for CLKPR
+ */
+ static inline void SetSystemClockPrescaler(uint8_t PrescalerMask)
+ {
+ uint8_t tmp = (1 << CLKPCE);
+ __asm__ __volatile__ (
+ "in __tmp_reg__,__SREG__" "\n\t"
+ "cli" "\n\t"
+ "sts %1, %0" "\n\t"
+ "sts %1, %2" "\n\t"
+ "out __SREG__, __tmp_reg__"
+ : /* no outputs */
+ : "d" (tmp),
+ "M" (_SFR_MEM_ADDR(CLKPR)),
+ "d" (PrescalerMask)
+ : "r0");
+ }
+
+ /** Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1,
+ * etc.
+ *
+ * \param Byte Byte of data whose bits are to be reversed
+ */
+ static inline uint8_t BitReverse(uint8_t Byte) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
+ static inline uint8_t BitReverse(uint8_t Byte)
+ {
+ Byte = (((Byte & 0xF0) >> 4) | ((Byte & 0x0F) << 4));
+ Byte = (((Byte & 0xCC) >> 2) | ((Byte & 0x33) << 2));
+ Byte = (((Byte & 0xAA) >> 1) | ((Byte & 0x55) << 1));
+
+ return Byte;
+ }
+
+ /** Function to reverse the byte ordering of the individual bytes in a 16 bit number.
+ *
+ * \param Word Word of data whose bytes are to be swapped
+ */
+ static inline uint16_t SwapEndian_16(uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
+ static inline uint16_t SwapEndian_16(uint16_t Word)
+ {
+ return ((Word >> 8) | (Word << 8));
+ }
+
+ /** Function to reverse the byte ordering of the individual bytes in a 32 bit number.
+ *
+ * \param DWord Double word of data whose bytes are to be swapped
+ */
+ static inline uint32_t SwapEndian_32(uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
+ static inline uint32_t SwapEndian_32(uint32_t DWord)
+ {
+ return (((DWord & 0xFF000000) >> 24) |
+ ((DWord & 0x00FF0000) >> 8) |
+ ((DWord & 0x0000FF00) << 8) |
+ ((DWord & 0x000000FF) << 24));
+ }
+
+ /** Function to reverse the byte ordering of the individual bytes in a n byte number.
+ *
+ * \param Data Pointer to a number containing an even number of bytes to be reversed
+ * \param Bytes Length of the data in bytes
+ */
+ static inline void SwapEndian_n(uint8_t* Data, uint8_t Bytes);
+ static inline void SwapEndian_n(uint8_t* Data, uint8_t Bytes)
+ {
+ uint8_t Temp;
+
+ while (Bytes)
+ {
+ Temp = *Data;
+ *Data = *(Data + Bytes - 1);
+ *(Data + Bytes) = Temp;
+
+ Data++;
+ Bytes -= 2;
+ }
+ }
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Common/FunctionAttributes.h b/digital/avr/modules/usb/lufa/LUFA/Common/FunctionAttributes.h
new file mode 100644
index 00000000..16503bb5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Common/FunctionAttributes.h
@@ -0,0 +1,110 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file contains macros for applying GCC specific attributes to functions to control various optimizer
+ * and code generation features of the compiler. Attributes may be placed in the function prototype in any
+ * order, and multiple attributes can be specified for a single function via a space seperated list.
+ *
+ * \note Do not include this file directly, rather include the Common.h header file instead to gain this file's
+ * functionality.
+ */
+
+#ifndef __FUNCATTR_H__
+#define __FUNCATTR_H__
+
+ /* Preprocessor Checks: */
+ #if !defined(__COMMON_H__)
+ #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Indicates to the compiler that the function can not ever return, so that any stack restoring or
+ * return code may be ommited by the compiler in the resulting binary.
+ */
+ #define ATTR_NO_RETURN __attribute__ ((noreturn))
+
+ /** Places the function in one of the initilization sections, which execute before the main function
+ * of the application. The init function number can be specified as "x", as an integer. Refer to the
+ * avr-libc manual for more information on the initialization sections.
+ */
+ #define ATTR_INIT_SECTION(x) __attribute__ ((naked, section (".init" #x )))
+
+ /** Indicates that the function returns a value which should not be ignored by the user code. When
+ * applied, any ignored return value from calling the function will produce a compiler warning.
+ */
+ #define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
+
+ /** Indicates that the specified parameters of the function are pointers which should never be NULL.
+ * When applied as a 1-based comma seperated list the compiler will emmit a warning if the specified
+ * parameters are known at compiler time to be NULL at the point of calling the function.
+ */
+ #define ATTR_NON_NULL_PTR_ARG(...) __attribute__ ((nonnull (__VA_ARGS__)))
+
+ /** Removes any preample or postample from the function. When used, the function will not have any
+ * register or stack saving code. This should be used with caution, and when used the programmer
+ * is responsible for maintaining stack and register integrity.
+ */
+ #define ATTR_NAKED __attribute__ ((naked))
+
+ /** Prevents the compiler from considering a specified function for inlining. When applied, the given
+ * function will not be inlined under any circumstances.
+ */
+ #define ATTR_NOINLINE __attribute__ ((noinline))
+
+ /** Forces the compiler to inline the specified function. When applied, the given function will be
+ * inlined under all circumstances.
+ */
+ #define ATTR_ALWAYSINLINE __attribute__ ((always_inline))
+
+ /** Indicates that the specified function is pure, in that it has no side-effects other than global
+ * or parameter variable access.
+ */
+ #define ATTR_PURE __attribute__ ((pure))
+
+ /** Indicates that the specified function is constant, in that it has no side effects other than
+ * parameter access.
+ */
+ #define ATTR_CONST __attribute__ ((const))
+
+ /** Marks a given function as deprecated, which produces a warning if the function is called. */
+ #define ATTR_DEPRECATED __attribute__ ((deprecated))
+
+ /** Marks a function as a weak reference, which can be overridden by other functions with an
+ * identical name (in which case the weak reference is discarded at link time).
+ */
+ #define ATTR_WEAK __attribute__ ((weak))
+
+ /** Marks a function as an alias for another function of name "x". */
+ #define ATTR_ALIAS(x) __attribute__ ((alias( #x )))
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/CompileTimeTokens.txt b/digital/avr/modules/usb/lufa/LUFA/CompileTimeTokens.txt
new file mode 100644
index 00000000..196132b9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/CompileTimeTokens.txt
@@ -0,0 +1,167 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page TokenSummary Summary of Compile Tokens
+ *
+ * The following lists all the possible tokens which can be defined in a project makefile, and passed to the
+ * compiler via the -D switch, to alter the LUFA library code. These tokens may alter the library behaviour,
+ * or remove features unused by a given application in order to save flash space.
+ *
+ * \section Sec_SummaryNonUSBTokens Non USB Related Tokens
+ * This section describes compile tokens which affect non-USB sections of the LUFA library.
+ *
+ * <b>DISABLE_TERMINAL_CODES</b> - TerminalCodes.h \n
+ * If an application contains ANSI terminal control codes listed in TerminalCodes.h, it might be desired to remove them
+ * at compile time for use with a terminal which is non-ANSI control code aware, without modifying the source code. If
+ * this token is defined, all ANSI control codes in the application code from the TerminalCodes.h header are removed from
+ * the source code at compile time.
+ *
+ * <b>NUM_BLOCKS</b> - DynAlloc.h \n
+ * Sets the number of allocable blocks in the psudo-heap of the dynamic memory allocation driver. This should be
+ * defined as a constant larger than zero.
+ *
+ * <b>BLOCK_SIZE</b> - DynAlloc.h \n
+ * Sets the size of each allocable block in the psudo-heap of the dynamic memory allocation driver. This should be
+ * defined as a constant larger than zero.
+ *
+ * <b>NUM_HANDLES</b> - DynAlloc.h \n
+ * Sets the maximum number of managed memory handles which can be handed out by the dynamic memory allocation driver
+ * simultaneously, before a handle (and its associated allocated memory) must be freed.
+ *
+ * \section Sec_SummaryUSBClassTokens USB Class Driver Related Tokens
+ * This section describes compile tokens which affect USB class-specific drivers in the LUFA library.
+ *
+ * <b>HID_ENABLE_FEATURE_PROCESSING</b> - HIDParser.h \n
+ * Define this token to enable the processing of FEATURE HID report items, if any, into the processed HID structure.
+ * By default FEATURE items (which are device features settable by the host but not directly visible by the user) are
+ * skipped when processing a device HID report.
+ *
+ * <b>HID_INCLUDE_CONSTANT_DATA_ITEMS</b> - HIDParser.h \n
+ * By default, constant data items (usually used as spacers to align seperate report items to a byte or word boundary)
+ * in the HID report are skipped during report processing. It is highly unusual for an application to make any use of
+ * constant data items (as they do not carry any useful data and only occupy limited RAM) however if required defining
+ * this switch will put constant data items into the processed HID report structure.
+ *
+ * <b>HID_STATETABLE_STACK_DEPTH</b> - HIDParser.h \n
+ * HID reports may contain PUSH and POP elements, to store and retrieve the current HID state table onto a stack. This
+ * allows for reports to save the state table before modifying it slightly for a data item, and then restore the previous
+ * state table in a compact manner. This token may be defined to a non-zero value to give the maximum depth of the state
+ * table stack. If not defined, this defaults to the value indicated in the HID.h file documentation.
+ *
+ * <b>HID_USAGE_STACK_DEPTH</b> - HIDParser.h \n
+ * HID reports generally contain many USAGE elements, which are assigned to INPUT, OUTPUT and FEATURE items in succession
+ * when multiple items are defined at once (via REPORT COUNT elements). This allows for several items to be defined with
+ * different usages in a compact manner. This token may be defined to a non-zero value to set the maximum depth of the
+ * usage stack, indicating the maximum number of USAGE items which can be stored tempoarily until the next INPUT, OUTPUT
+ * and FEATURE item. If not defined, this defaults to the value indicated in the HID.h file documentation.
+ *
+ * <b>HID_MAX_COLLECTIONS</b> - HIDParser.h \n
+ * HID reports generally contain several COLLECTION elements, used to group related data items together. Collection information
+ * is stored seperately in the processed usage structure (and referred to by the data elements in the structure) to save space.
+ * This token may be defined to a non-zero value to set the maximum number of COLLECTION items which can be processed by the
+ * parser into the resultant processed report structure. If not defined, this defaults to the value indicated in the HID.h file
+ * documentation.
+ *
+ * <b>HID_MAX_REPORTITEMS</b> - HIDParser.h \n
+ * All HID reports contain one or more INPUT, OUTPUT and/or FEATURE items describing the data which can be sent to and from the HID
+ * device. Each item has associated usages, bit offsets in the item reports and other associated data indicating the manner in which
+ * the report data should be interpreted by the host. This token may be defined to a non-zero value to set the maximum number of
+ * data elements which can be stored in the processed HID report strucuture, including INPUT, OUTPUT and (if enabled) FEATURE items.
+ * If a item has a multiple count (i.e. a REPORT COUNT of more than 1), each item in the report count is placed seperately in the
+ * processed HID report table. If not defined, this defaults to the value indicated in the HID.h file documentation.
+ *
+ * \section Sec_SummaryUSBTokens USB Driver Related Tokens
+ * This section describes compile tokens which affect USB driver stack as a whole in the LUFA library.
+ *
+ * <b>USE_RAM_DESCRIPTORS</b> - StdDescriptors.h \n
+ * Define this token to indicate to the USB driver that device descriptors are stored in RAM, rather than the default of
+ * the AVR's flash. RAM descriptors may be desirable in applications where speed or minimizing flash usage is more important
+ * than RAM usage, or applications where the descriptors need to be modified at runtime.
+ *
+ * <b>USE_EEPROM_DESCRIPTORS</b> - StdDescriptors.h \n
+ * Similar to USE_RAM_DESCRIPTORS, but descriptors are stored in the AVR's EEPROM memory rather than RAM.
+ *
+ * <b>USE_NONSTANDARD_DESCRIPTOR_NAMES</b> - StdDescriptors.h \n
+ * The USB 2.0 standard gives some rather obscure names for the elements in the standard descriptor types (device, configuration,
+ * string, endpoint, etc.). By default the LUFA library uses these names in its predefined descriptor structure types for
+ * compatibility. If this token is defined, the structure element names are switched to the LUFA-specific but more descriptive
+ * names documented in the StdDescriptors.h source file.
+ *
+ * <b>FIXED_CONTROL_ENDPOINT_SIZE</b> - Endpoint.h \n
+ * By default, the library determines the size of the control endpoint (when in device mode) by reading the device descriptor.
+ * Normally this reduces the amount of configuration required for the library, allows the value to change dynamically (if
+ * descriptors are stored in EEPROM or RAM rather than flash memory) and reduces code maintenance. However, this token can be
+ * defined to a non-zero value instead to give the size in bytes of the control endpoint, to reduce the size of the compiled
+ * binary at the expense of flexibility.
+ *
+ * <b>STATIC_ENDPOINT_CONFIGURATION</b> - Endpoint.h \n
+ * By default, the endpoint configuration routine is designed to accept dynamic inputs, so that the endpoints can be configured
+ * using variable values known only at runtime. This allows for a great deal of flexibility, however uses a small amount of binary
+ * space which may be wasted if all endpoint configurations are static and known at compile time. Define this token via the -D switch
+ * to optimize the endpoint configuration routine for constant inputs, to reduce the size of the compiled binary at the expense of
+ * flexibility. Note that with this option dynamic values may still be used, but will result in many times more code to be generated than
+ * if the option was disabled. This is designed to be used only if the FIXED_CONTROL_ENDPOINT_SIZE option is also used.
+ *
+ * <b>USE_SINGLE_DEVICE_CONFIGURATION</b> - DevChapter9.h \n
+ * By default, the library determines the number of configurations a USB device supports by reading the device descriptor. This reduces
+ * the amount of configuration required to set up the library, and allows the value to change dynamically (if descriptors are stored in
+ * EEPROM or RAM rather than flash memory) and reduces code maintenance. However, many USB device projects use only a single configuration.
+ * Defining this token enables single-configuration mode, reducing the compiled size of the binary at the expense of flexibility.
+ *
+ * <b>NO_CLEARSET_FEATURE_REQUEST</b> - DevChapter9.h \n
+ * In some limited USB device applications, the Get Feature and Set Feature requests are not used - this is when the device does not have
+ * device level features (such as remote wakeup) nor any data endpoints beyond the mandatory control endpoint. In such limited situations,
+ * this token may be defined to remove the handling of the Get Feature and Set Feature Chapter 9 requests to save space. Generally, this
+ * is usually only useful in (some) bootloaders.
+ *
+ * <b>NO_STREAM_CALLBACKS</b> - Endpoint.h, Pipe.h \n
+ * Both the endpoint and the pipe driver code contains stream functions, allowing for arrays of data to be sent to or from the
+ * host easily via a single function call (rather than complex routines worrying about sending full packets, waiting for the endpoint/
+ * pipe to become ready, etc.). By default, these stream functions require a callback function which is executed after each byte processed,
+ * allowing for early-aborts of stream transfers by the application. If callbacks are not required in an application, they can be removed
+ * by defining this token, reducing the compiled binary size. When removed, the stream functions no longer accept a callback function as
+ * a parameter.
+ *
+ * <b>USB_HOST_TIMEOUT_MS</b> - Host.h \n
+ * When a control transfer is initiated in host mode to an attached device, a timeout is used to abort the transfer if the attached
+ * device fails to respond within the timeout period. This token may be defined to a non-zero value to set the timeout period for
+ * control transfers, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.
+ *
+ * <b>HOST_DEVICE_SETTLE_DELAY_MS</b> - Host.h \n
+ * Some devices require a delay of up to 5 seconds after they are connected to VBUS before the enumeration process can be started, or
+ * they will fail to enumerate correctly. By placing a delay before the enumeration process, it can be ensured that the bus has settled
+ * back to a known idle state before communications occur with the device. This token may be defined to a non-zero value to set the
+ * device settle period, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.
+ *
+ * <b>USE_STATIC_OPTIONS</b> - LowLevel.h \n
+ * By default, the USB_Init() function accepts dynamic options at runtime to alter the library behaviour, including whether the USB pad
+ * voltage regulator is enabled, and the device speed when in device mode. By defining this token to a mask comprised of the USB options
+ * mask defines usually passed as the Options parameter to USB_Init(), the resulting compiled binary can be decreased in size by removing
+ * the dynamic options code, and replacing it with the statically set options. When defined, the USB_Init() function no longer accepts an
+ * Options parameter.
+ *
+ * <b>USB_DEVICE_ONLY</b> - LowLevel.h \n
+ * For the USB AVR models supporting both device and host USB modes, the USB_Init() function contains a Mode parameter which specifies the
+ * mode the library should be initialized to. If only device mode is required, the code for USB host mode can be removed from the binary to
+ * save space. When defined, the USB_Init() function no longer accepts a Mode parameter. This define is irrelevent on smaller USB AVRs which
+ * do not support host mode.
+ *
+ * <b>USB_HOST_ONLY</b> - LowLevel.h \n
+ * Same as USB_DEVICE_ONLY, except the library is fixed to USB host mode rather than USB device mode. Not available on some USB AVR models.
+ *
+ * <b>USB_STREAM_TIMEOUT_MS</b> - LowLevel.h \n
+ * When endpoint and/or pipe stream functions are used, by default there is a timeout between each transfer which the connected device or host
+ * must satisfy, or the stream function aborts the remaining data transfer. This token may be defined to a non-zero value to set the timeout
+ * period for stream transfers, specified in milliseconds. If not defined, the default value specified in LowLevel.h is used instead.
+ *
+ * <b>NO_LIMITED_CONTROLLER_CONNECT</b> - Events.h \n
+ * On the smaller USB AVRs, the USB controller lacks VBUS events to determine the physical connection state of the USB bus to a host. In lieu of
+ * VBUS events, the library attempts to determine the connection state via the bus suspension and wake up events instead. This however may be
+ * slightly inaccurate due to the possibility of the host suspending the bus while the device is still connected. If accurate connection status is
+ * required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the USB_IsConnected global
+ * can be accurately set and the USB_Connect and USB_Disconnect events manually raised by the RAISE_EVENT macro. When defined, this token disables
+ * the library's auto-detection of the connection state by the aformentioned suspension and wake up events.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/DirectorySummaries.txt b/digital/avr/modules/usb/lufa/LUFA/DirectorySummaries.txt
new file mode 100644
index 00000000..1abf3d49
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/DirectorySummaries.txt
@@ -0,0 +1,119 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \dir Common
+ * \brief Common library header files.
+ *
+ * This folder contains header files which are common to all parts of the LUFA library. They may be used freely in
+ * user applications.
+ *
+ * \dir MemoryAllocator
+ * \brief Auto-defragmenting dynamic memory allocation library.
+ *
+ * This folder contains a simple handle-based dynamic memory allocation library, capable of handing out memory in
+ * block chunks. As new memory is allocated, the library will defragment the already allocated memory to ensure
+ * optimal memory usage. It is not used within the LUFA library, and is provided as a convenience for user applications.
+ *
+ * \dir Scheduler
+ * \brief Simple round-robbin scheduler.
+ *
+ * This folder contains the simple LUFA round-robbin scheduler, provided as a convenience for user applications. It
+ * is very simple in design, and is intended to make code easier to read, rather than providing a complete RTOS kernel.
+ *
+ * \dir Drivers
+ * \brief Library hardware and software drivers.
+ *
+ * This folder contains all the library hardware and software drivers for each supported board and USB AVR
+ * microcontroller model.
+ *
+ * \dir Drivers/Misc
+ * \brief Miscellaneous driver files.
+ *
+ * This folder contains drivers for aspects other than the USB interface, board hardware or AVR peripherals.
+ *
+ * \dir Drivers/AT90USBXXX
+ * \brief USB AVR peripheral driver files.
+ *
+ * This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible with
+ * all USB AVR models.
+ *
+ * \dir Drivers/AT90USBXXX/AT90USBXXX67
+ * \brief AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 AVR model peripheral driver files. Its original name is due to legacy
+ * reasons.
+ *
+ * This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible only with
+ * the AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 USB AVR models, such as the AT90USB1287. Its contents should <b>not</b> be
+ * included by the user application - the dispatch header file located in the parent AT90USBXXX directory should be used
+ * instead.
+ *
+ * \dir Drivers/USB
+ * \brief USB controller peripheral driver files.
+ *
+ * This folder contains the main header files required to implement the USB interface in the USB supporting AVR models.
+ * The header files contained directly in this folder should be included in the user application in order to gain USB
+ * functionality, and the appropriate C source files in the LowLevel and HighLevel driver folders added to the compile
+ * and link stages.
+ *
+ * \dir Drivers/USB/LowLevel
+ * \brief Low level USB driver files.
+ *
+ * This folder contains low level USB driver source files required to implement USB functionality on the USB AVR microcontrollers.
+ *
+ * \dir Drivers/USB/HighLevel
+ * \brief High level USB driver files.
+ *
+ * This folder contains high level USB driver source files required to implement USB functionality on the USB AVR microcontrollers.
+ *
+ * \dir Drivers/USB/Class
+ * \brief USB Class helper driver files.
+ *
+ * This folder contains drivers for implementing functionality of standardized USB classes. These are not used directly by the library,
+ * but provide a standard and library-maintained way of implementing functionality from some of the defined USB classes without extensive
+ * development effort. Is is recommended that these drivers be used where possible to reduce maintenance of user applications.
+ *
+ * \dir Drivers/Board
+ * \brief Board hardware driver files.
+ *
+ * This folder contains drivers for interfacing with the physical hardware on supported commercial boards, primarily from
+ * the Atmel corporation. Header files in this folder should be included in user applications requring the functionality of
+ * hardware placed on supported boards.
+ *
+ * \dir Drivers/Board/USBKEY
+ * \brief USBKEY board hardware driver files.
+ *
+ * This folder contains drivers for hardware on the Atmel USBKEY demonstration board. The header files in this folder should
+ * not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
+ * should be included instead.
+ *
+ * \dir Drivers/Board/STK526
+ * \brief STK526 board hardware driver files.
+ *
+ * This folder contains drivers for hardware on the Atmel STK526 development board. The header files in this folder should
+ * not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
+ * should be included instead.
+ *
+ * \dir Drivers/Board/STK525
+ * \brief STK525 board hardware driver files.
+ *
+ * This folder contains drivers for hardware on the Atmel STK525 development board. The header files in this folder should
+ * not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
+ * should be included instead.
+ *
+ * \dir Drivers/Board/RZUSBSTICK
+ * \brief RZUSBSTICK board hardware driver files.
+ *
+ * This folder contains drivers for hardware on the Atmel RZUSBSTICK board, as used in the Atmel "Raven" wireless kits. The header
+ * files in this folder should not be included directly in user applications; the similarly named dispatch header files located in
+ * the parent Board directory should be included instead.
+ *
+ * \dir DriverStubs
+ * \brief Driver stub header files for custom boards, to allow the LUFA board drivers to operate.
+ *
+ * This contains stub files for the LUFA board drivers. If the LUFA board drivers are used with board hardare other than those
+ * directly supported by the library, the BOARD parameter of the application's makefile can be set to "USER", and these stub files
+ * copied to the "/Board/" directory of the application's folder. When fleshed out with working driver code for the custom board,
+ * the corresponding LUFA board APIs will work correctly with the non-standard board hardware.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/Doxygen.conf b/digital/avr/modules/usb/lufa/LUFA/Doxygen.conf
new file mode 100644
index 00000000..08685d10
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 090209
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Dataflash.h b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Dataflash.h
new file mode 100644
index 00000000..0bef94eb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Dataflash.h
@@ -0,0 +1,81 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ This is a stub driver header file, for implementing custom board
+ layout hardware with compatible LUFA board specific drivers. If
+ the library is configured to use the BOARD_USER board mode, this
+ driver file should be completed and copied into the "/Board/" folder
+ inside the application's folder.
+
+ This stub is for the board-specific component of the LUFA Dataflash
+ driver.
+*/
+
+#ifndef __DATAFLASH_USER_H__
+#define __DATAFLASH_USER_H__
+
+ /* Includes: */
+ // TODO: Add any required includes here
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define DATAFLASH_CHIPCS_MASK // TODO: Replace this with a mask of all the /CS pins of all dataflashes
+ #define DATAFLASH_CHIPCS_DDR // TODO: Replace with the DDR register name for the board's Dataflash ICs
+ #define DATAFLASH_CHIPCS_PORT // TODO: Replace with the PORT register name for the board's Dataflash ICs
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Constant indicating the total number of dataflash ICs mounted on the selected board. */
+ #define DATAFLASH_TOTALCHIPS // TODO: Replace with the number of dataflashes on the board, max 2
+
+ /** Mask for no dataflash chip selected. */
+ #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+
+ /** Mask for the first dataflash chip selected. */
+ #define DATAFLASH_CHIP1 // TODO: Replace with mask to select the first Dataflash chip
+
+ /** Mask for the second dataflash chip selected. */
+ #define DATAFLASH_CHIP2 // TODO: Replace with mask to select the second Dataflash chip, if available
+
+ /** Internal main memory page size for the board's dataflash ICs. */
+ #define DATAFLASH_PAGE_SIZE // TODO: Replace with the page size for the Dataflash ICs
+
+ /** Total number of pages inside each of the board's dataflash ICs. */
+ #define DATAFLASH_PAGES // TODO: Replace with the total number of pages inside one of the Dataflash ICs
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/DriverStubs/HWB.h b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/HWB.h
new file mode 100644
index 00000000..744828d8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/HWB.h
@@ -0,0 +1,84 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ This is a stub driver header file, for implementing custom board
+ layout hardware with compatible LUFA board specific drivers. If
+ the library is configured to use the BOARD_USER board mode, this
+ driver file should be completed and copied into the "/Board/" folder
+ inside the application's folder.
+
+ This stub is for the board-specific component of the LUFA HWB (Hardware
+ Button, a physical button on most Atmel USB boards) driver. This could
+ alternately be driven from any button connected to the USB AVR.
+*/
+
+#ifndef __HWB_USER_H__
+#define __HWB_USER_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ // TODO: Add any required includes here
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_HWB_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void HWB_Init(void)
+ {
+ // TODO: Initialize the appropriate port pin as an input here, with pullup
+ }
+
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline bool HWB_GetStatus(void)
+ {
+ // TODO: Return current button status here, debounced if required
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Joystick.h b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Joystick.h
new file mode 100644
index 00000000..415976a4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/Joystick.h
@@ -0,0 +1,99 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ This is a stub driver header file, for implementing custom board
+ layout hardware with compatible LUFA board specific drivers. If
+ the library is configured to use the BOARD_USER board mode, this
+ driver file should be completed and copied into the "/Board/" folder
+ inside the application's folder.
+
+ This stub is for the board-specific component of the LUFA Joystick
+ driver, a small surface mount four-way (plus button) digital joystick
+ on most USB AVR boards.
+*/
+
+#ifndef __JOYSTICK_USER_H__
+#define __JOYSTICK_USER_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ // TODO: Add any required includes here
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for the joystick being pushed in the left direction. */
+ #define JOY_LEFT // TODO: Add mask to indicate joystick left position here
+
+ /** Mask for the joystick being pushed in the right direction. */
+ #define JOY_RIGHT // TODO: Add mask to indicate joystick right position here
+
+ /** Mask for the joystick being pushed in the upward direction. */
+ #define JOY_UP // TODO: Add mask to indicate joystick up position here
+
+ /** Mask for the joystick being pushed in the downward direction. */
+ #define JOY_DOWN // TODO: Add mask to indicate joystick down position here
+
+ /** Mask for the joystick being pushed inward. */
+ #define JOY_PRESS // TODO: Add mask to indicate joystick pressed position here
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void Joystick_Init(void)
+ {
+ // TODO: Initialize joystick port pins as inputs with pullups
+ };
+
+ static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Joystick_GetStatus(void)
+ {
+ // TODO: Return current joystick position data which can be obtained by masking against the JOY_* macros
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/DriverStubs/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/LEDs.h
new file mode 100644
index 00000000..993481d8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/DriverStubs/LEDs.h
@@ -0,0 +1,121 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ This is a stub driver header file, for implementing custom board
+ layout hardware with compatible LUFA board specific drivers. If
+ the library is configured to use the BOARD_USER board mode, this
+ driver file should be completed and copied into the "/Board/" folder
+ inside the application's folder.
+
+ This stub is for the board-specific component of the LUFA LEDs driver,
+ for the LEDs (up to four) mounted on most USB AVR boards.
+*/
+
+#ifndef __LEDS_USER_H__
+#define __LEDS_USER_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ // TODO: Add any required includes here
+
+/* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 // TODO: Add mask for first board LED here
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 // TODO: Add mask for second board LED here
+
+ /** LED mask for the third LED on the board. */
+ #define LEDS_LED3 // TODO: Add mask for third board LED here
+
+ /** LED mask for the fourth LED on the board. */
+ #define LEDS_LED4 // TODO: Add mask for fourth board LED here
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ // TODO: Add code to initialize LED port pins as outputs here
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
+ {
+ // TODO: Add code to turn on LEDs given in the LedMask mask here, leave others as-is
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LedMask)
+ {
+ // TODO: Add code to turn off LEDs given in the LedMask mask here, leave others as-is
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LedMask)
+ {
+ // TODO: Add code to turn on only LEDs given in the LedMask mask here, all others off
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LedMask, const uint8_t ActiveMask)
+ {
+ // TODO: Add code to set the Leds in the given LedMask to the status given in ActiveMask here
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ // TODO: Add code to return the current LEDs status' here which can be masked against LED_LED* macros
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/ADC.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/ADC.h
new file mode 100644
index 00000000..341b4e19
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/ADC.h
@@ -0,0 +1,58 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file is the master dispatch header file for the device-specific ADC driver, for AVRs containing an ADC.
+ *
+ * User code should include this file, which will in turn include the correct ADC driver header file for the
+ * currently selected AVR model.
+ */
+
+#ifndef __ADC_H__
+#define __ADC_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_ADC_H
+ #define INCLUDE_FROM_CHIP_DRIVER
+ #endif
+
+ /* Includes: */
+ #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
+ defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
+ defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \
+ defined(__AVR_ATmega32U6__))
+ #include "AT90USBXXX67/ADC.h"
+ #else
+ #error "ADC is not available for the currently selected AVR model."
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/AT90USBXXX67/ADC.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/AT90USBXXX67/ADC.h
new file mode 100644
index 00000000..58027709
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/AT90USBXXX67/ADC.h
@@ -0,0 +1,177 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * ADC driver for the AT90USB1287, AT90USB1286, AT90USB647, AT90USB646, ATMEGA16U4 and ATMEGA32U4 AVRs.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the ADC driver
+ * dispatch header located in LUFA/Drivers/AT90USBXXX/ADC.h.
+ */
+
+#ifndef __ADC_AT90USBXXX67_H__
+#define __ADC_AT90USBXXX67_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_ADC_H)
+ #error Do not include this file directly. Include LUFA/Drivers/AT90USBXXX/ADC.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations.
+ * The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
+ * prescaler masks.
+ */
+ #define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE
+
+ /** Turns off the ADC. If this is called, any further ADC operations will require a call to the
+ * ADC_Init() macro before the ADC can be used again.
+ */
+ #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE
+
+ /** Indicates if the ADC is enabled. This macro will return boolean true if the ADC subsystem is
+ * currently enabled, or false otherwise.
+ */
+ #define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false)
+
+ /** Indicates if the current ADC conversion is completed, or still in progress. This returns boolean
+ * false if the reading is still taking place, or true if the conversion is complete and ready to be
+ * read out with ADC_GetResult().
+ */
+ #define ADC_IsReadingComplete() (!(ADCSRA & (1 << ADSC)))
+
+ /** Returns the result of the last conversion, as a 16-bit wide integer. */
+ #define ADC_GetResult() ADC
+
+ /** Reference mask, for using the voltage present at the AVR's AREF pin for the ADC reference. */
+ #define ADC_REFERENCE_AREF 0
+
+ /** Reference mask, for using the voltage present at the AVR's AVCC pin for the ADC reference. */
+ #define ADC_REFERENCE_AVCC (1 << REFS0)
+
+ /** Reference mask, for using the internally generated 2.56V reference voltage as the ADC reference. */
+ #define ADC_REFERENCE_INT2560MV ((1 << REFS1)| (1 << REFS0))
+
+ /** Left-adjusts the 10-bit ADC result, so that the upper 8 bits of the value returned by the
+ * ADC_GetResult() macro contain the 8 most significant bits of the result. */
+ #define ADC_LEFT_ADJUSTED (1 << ADLAR)
+
+ /** Right-adjusts the 10-bit ADC result, so that the lower 8 bits of the value returned by the
+ * ADC_GetResult() macro contain the 8 least significant bits of the result. */
+ #define ADC_RIGHT_ADJUSTED (0 << ADLAR)
+
+ /** Sets the ADC mode to free running, so that conversions take place continuously as fast as the ADC
+ * is capable of at the given input clock speed. */
+ #define ADC_FREE_RUNNING (1 << ADATE)
+
+ /** Sets the ADC mode to single conversion, so that only a single conversion will take place before
+ * the ADC returns to idle. */
+ #define ADC_SINGLE_CONVERSION (0 << ADATE)
+
+ /** Sets the ADC input clock to prescale by a factor of 2 the AVR's system clock. */
+ #define ADC_PRESCALE_2 (1 << ADPS0)
+
+ /** Sets the ADC input clock to prescale by a factor of 4 the AVR's system clock. */
+ #define ADC_PRESCALE_4 (1 << ADPS1)
+
+ /** Sets the ADC input clock to prescale by a factor of 8 the AVR's system clock. */
+ #define ADC_PRESCALE_8 ((1 << ADPS0) | (1 << ADPS1))
+
+ /** Sets the ADC input clock to prescale by a factor of 16 the AVR's system clock. */
+ #define ADC_PRESCALE_16 (1 << ADPS2)
+
+ /** Sets the ADC input clock to prescale by a factor of 32 the AVR's system clock. */
+ #define ADC_PRESCALE_32 ((1 << ADPS2) | (1 << ADPS0))
+
+ /** Sets the ADC input clock to prescale by a factor of 64 the AVR's system clock. */
+ #define ADC_PRESCALE_64 ((1 << ADPS2) | (1 << ADPS1))
+
+ /** Sets the ADC input clock to prescale by a factor of 128 the AVR's system clock. */
+ #define ADC_PRESCALE_128 ((1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0))
+
+ /* Inline Functions: */
+ /** Configures the given ADC channel, ready for ADC conversions. This function sets the
+ * associated port pin as an input and disables the digital portion of the I/O to reduce
+ * power consumption.
+ *
+ * \param Channel ADC channel number to set up for conversions
+ */
+ static inline void ADC_SetupChannel(const uint8_t Channel)
+ {
+ DDRD &= ~(1 << Channel);
+ DIDR0 |= (1 << Channel);
+ }
+
+ /** Starts the reading of the given channel, but does not wait until the conversion has completed.
+ * Once executed, the conversion status can be determined via the ADC_IsReadingComplete() macro and
+ * the result read via the ADC_GetResult() macro.
+ *
+ * \param MUXMask Mask comprising of an ADC channel number, reference mask and adjustment mask
+ */
+ static inline void ADC_StartReading(const uint8_t MUXMask)
+ {
+ ADMUX = MUXMask;
+
+ ADCSRA |= (1 << ADSC);
+ }
+
+ /** Performs a complete single reading from channel, including a polling spinloop to wait for the
+ * conversion to complete, and the returning of the converted value.
+ *
+ * \param MUXMask Mask comprising of an ADC channel number, reference mask and adjustment mask
+ */
+ static inline uint16_t ADC_GetChannelReading(const uint8_t MUXMask) ATTR_WARN_UNUSED_RESULT;
+ static inline uint16_t ADC_GetChannelReading(const uint8_t MUXMask)
+ {
+ ADC_StartReading(MUXMask);
+
+ while (!(ADC_IsReadingComplete()));
+
+ return ADC_GetResult();
+ }
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/SPI.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/SPI.h
new file mode 100644
index 00000000..0b333a80
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/SPI.h
@@ -0,0 +1,139 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Hardware SPI subsystem driver for the supported USB AVRs models.
+ */
+
+#ifndef __SPI_H__
+#define __SPI_H__
+
+ /* Includes: */
+ #include <stdbool.h>
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define SPI_USE_DOUBLESPEED (1 << 7)
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 2. */
+ #define SPI_SPEED_FCPU_DIV_2 SPI_USE_DOUBLESPEED
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 4. */
+ #define SPI_SPEED_FCPU_DIV_4 0
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 8. */
+ #define SPI_SPEED_FCPU_DIV_8 (SPI_USE_DOUBLESPEED | (1 << SPR0))
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 16. */
+ #define SPI_SPEED_FCPU_DIV_16 (1 << SPR0)
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 32. */
+ #define SPI_SPEED_FCPU_DIV_32 (SPI_USE_DOUBLESPEED | (1 << SPR1))
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 64. */
+ #define SPI_SPEED_FCPU_DIV_64 (SPI_USE_DOUBLESPEED | (1 << SPR1) | (1 < SPR0))
+
+ /** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 128. */
+ #define SPI_SPEED_FCPU_DIV_128 ((1 << SPR1) | (1 < SPR0))
+
+ /* Inline Functions: */
+ /** Initializes the SPI subsystem, ready for transfers. Must be called before calling any other
+ * SPI routines.
+ *
+ * \param PrescalerMask Prescaler mask to set the SPI clock speed
+ * \param Master If true, sets the SPI system to use master mode, slave if false
+ */
+ static inline void SPI_Init(const uint8_t PrescalerMask, const bool Master)
+ {
+ DDRB |= ((1 << 1) | (1 << 2));
+ PORTB |= ((1 << 0) | (1 << 3));
+
+ SPCR = ((1 << SPE) | (Master << MSTR) | (1 << CPOL) | (1 << CPHA) |
+ (PrescalerMask & ~SPI_USE_DOUBLESPEED));
+
+ if (PrescalerMask & SPI_USE_DOUBLESPEED)
+ SPSR = (1 << SPI2X);
+ }
+
+ /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.
+ *
+ * \param Byte Byte to send through the SPI interface
+ *
+ * \return Response byte from the attached SPI device
+ */
+ static inline uint8_t SPI_TransferByte(const uint8_t Byte) ATTR_ALWAYSINLINE;
+ static inline uint8_t SPI_TransferByte(const uint8_t Byte)
+ {
+ SPDR = Byte;
+ while (!(SPSR & (1 << SPIF)));
+ return SPDR;
+ }
+
+ /** Sends a byte through the SPI interface, blocking until the transfer is complete. The response
+ * byte sent to from the attached SPI device is ignored.
+ *
+ * \param Byte Byte to send through the SPI interface
+ */
+ static inline void SPI_SendByte(const uint8_t Byte) ATTR_ALWAYSINLINE;
+ static inline void SPI_SendByte(const uint8_t Byte)
+ {
+ SPDR = Byte;
+ while (!(SPSR & (1 << SPIF)));
+ }
+
+ /** Sends a dummy byte through the SPI interface, blocking until the transfer is complete. The response
+ * byte from the attached SPI device is returned.
+ *
+ * \return The response byte from the attached SPI device
+ */
+ static inline uint8_t SPI_ReceiveByte(void) ATTR_ALWAYSINLINE ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t SPI_ReceiveByte(void)
+ {
+ SPDR = 0x00;
+ while (!(SPSR & (1 << SPIF)));
+ return SPDR;
+ }
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.c
new file mode 100644
index 00000000..e1c74492
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.c
@@ -0,0 +1,65 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "Serial.h"
+
+void Serial_Init(const uint32_t BaudRate, const bool DoubleSpeed)
+{
+ UCSR1A = ((DoubleSpeed) ? (1 << U2X1) : 0);
+ UCSR1B = ((1 << RXEN1) | (1 << TXEN1));
+ UCSR1C = ((1 << UCSZ11) | (1 << UCSZ10));
+
+ DDRD |= (1 << 3);
+ PORTD |= (1 << 2);
+
+ UBRR1 = SERIAL_UBBRVAL(BaudRate);
+}
+
+void Serial_TxString_P(const char *FlashStringPtr)
+{
+ uint8_t CurrByte;
+
+ while ((CurrByte = pgm_read_byte(FlashStringPtr)) != 0x00)
+ {
+ Serial_TxByte(CurrByte);
+ FlashStringPtr++;
+ }
+}
+
+void Serial_TxString(const char *StringPtr)
+{
+ uint8_t CurrByte;
+
+ while ((CurrByte = *StringPtr) != 0x00)
+ {
+ Serial_TxByte(CurrByte);
+ StringPtr++;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.h
new file mode 100644
index 00000000..bbf3044f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial.h
@@ -0,0 +1,115 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Driver for the USART subsystem on supported USB AVRs.
+ */
+
+#ifndef __SERIAL_H__
+#define __SERIAL_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+ #include <stdbool.h>
+
+ #include "../../Common/Common.h"
+ #include "../Misc/TerminalCodes.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Indicates whether a character has been received through the USART - boolean false if no character
+ * has been received, or non-zero if a character is waiting to be read from the reception buffer.
+ */
+ #define Serial_IsCharReceived() ((UCSR1A & (1 << RXC1)) ? true : false)
+
+ /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is
+ * not set.
+ */
+ #define SERIAL_UBBRVAL(baud) (((F_CPU / 16) / baud) - 1)
+
+ /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is
+ * set.
+ */
+ #define SERIAL_2X_UBBRVAL(baud) (((F_CPU / 8) / baud) - 1)
+
+ /* Function Prototypes: */
+ /** Initializes the USART, ready for serial data transmission and reception.
+ *
+ * \param BaudRate Baud rate to configure the USART to
+ * \param DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
+ */
+ void Serial_Init(const uint32_t BaudRate, const bool DoubleSpeed);
+
+ /** Transmits a given string located in program space (FLASH) through the USART.
+ *
+ * \param FlashStringPtr Pointer to a string located in program space
+ */
+ void Serial_TxString_P(const char *FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Transmits a given string located in SRAM memory through the USART.
+ *
+ * \param StringPtr Pointer to a string located in SRAM space
+ */
+ void Serial_TxString(const char *StringPtr) ATTR_NON_NULL_PTR_ARG(1);
+
+ /* Inline Functions: */
+ /** Transmits a given byte through the USART.
+ *
+ * \param DataByte Byte to transmit through the USART
+ */
+ static inline void Serial_TxByte(const char DataByte)
+ {
+ while (!(UCSR1A & (1 << UDRE1)));
+ UDR1 = DataByte;
+ }
+
+ /** Receives a byte from the USART.
+ *
+ * \return Byte received from the USART
+ */
+ static inline char Serial_RxByte(void)
+ {
+ while (!(UCSR1A & (1 << RXC1)));
+ return UDR1;
+ }
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.c
new file mode 100644
index 00000000..d986af42
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.c
@@ -0,0 +1,45 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "Serial_Stream.h"
+
+FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);
+
+int SerialStream_TxByte(char DataByte, FILE *Stream)
+{
+ Serial_TxByte(DataByte);
+
+ return 0;
+}
+
+int SerialStream_RxByte(FILE *Stream)
+{
+ return Serial_RxByte();
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.h
new file mode 100644
index 00000000..adde5b95
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/AT90USBXXX/Serial_Stream.h
@@ -0,0 +1,82 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Serial stream driver for the USART subsystem on supported USB AVRs. This makes use of the functions in the
+ * regular USART driver, but allows the avr-libc standard stream functions (printf, puts, etc.) to work with the
+ * USART.
+ **/
+
+#ifndef __SERIAL_STREAM_H__
+#define __SERIAL_STREAM_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdio.h>
+
+ #include "Serial.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* External Variables: */
+ extern FILE USARTStream;
+
+ /* Function Prototypes: */
+ int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);
+ int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ /** Initializes the serial stream (and regular USART driver) so that both the stream and regular
+ * USART driver functions can be used. Must be called before any stream or regular USART functions.
+ *
+ * \param BaudRate Baud rate to configure the USART to
+ * \param DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
+ */
+ static inline void SerialStream_Init(const uint32_t BaudRate, const bool DoubleSpeed)
+ {
+ Serial_Init(BaudRate, DoubleSpeed);
+
+ stdout = &USARTStream;
+ }
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h
new file mode 100644
index 00000000..edf4f8c5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h
@@ -0,0 +1,79 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the ATAVRUSBRF01.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the HWB driver
+ * dispatch header located in LUFA/Drivers/Board/HWB.h.
+ */
+
+#ifndef __HWB_ATAVRUSBRF01_H__
+#define __HWB_ATAVRUSBRF01_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_HWB_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void HWB_Init(void)
+ {
+ DDRD &= ~(1 << 7);
+ PORTD |= (1 << 7);
+ }
+
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline bool HWB_GetStatus(void)
+ {
+ return (!(PIND & (1 << 7)));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
new file mode 100644
index 00000000..626d8cec
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
@@ -0,0 +1,120 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific LED driver header for the ATAVRUSBRF01.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver
+ * dispatch header located in LUFA/Drivers/Board/LEDs.h.
+ */
+
+#ifndef __LEDS_ATAVRUSBRF01_H__
+#define __LEDS_ATAVRUSBRF01_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2)
+ #define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4)
+
+ #define LEDS_PORTE_MASK_SHIFT 4
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 (1 << 0)
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 (1 << 1)
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ DDRD |= LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
+ {
+ PORTD |= (LEDMask & LEDS_ALL_LEDS);
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
+ {
+ PORTD &= ~(LEDMask & LEDS_ALL_LEDS);
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
+ {
+ PORTD = (PORTD & ~LEDS_ALL_LEDS) | (LEDMask & LEDS_ALL_LEDS);
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
+ {
+ PORTD = (PORTD & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS))
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ return (PORTD & LEDS_ALL_LEDS);
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Dataflash.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Dataflash.h
new file mode 100644
index 00000000..08deb50d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Dataflash.h
@@ -0,0 +1,210 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file is the master dispatch header file for the board-specific dataflash driver, for boards containing
+ * dataflash ICs for external non-volatile storage.
+ *
+ * User code should include this file, which will in turn include the correct dataflash driver header file for
+ * the currently selected board.
+ *
+ * If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project
+ * directory.
+ */
+
+#ifndef __DATAFLASH_H__
+#define __DATAFLASH_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_DATAFLASH_H
+ #define INCLUDE_FROM_BOARD_DRIVER
+ #endif
+
+ /* Includes: */
+ #include "../AT90USBXXX/SPI.h"
+ #include "../../Common/Common.h"
+
+ #if !defined(BOARD)
+ #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #elif (BOARD == BOARD_USBKEY)
+ #include "USBKEY/Dataflash.h"
+ #elif (BOARD == BOARD_STK525)
+ #include "STK525/Dataflash.h"
+ #elif (BOARD == BOARD_STK526)
+ #include "STK526/Dataflash.h"
+ #elif (BOARD == BOARD_USER)
+ #include "Board/Dataflash.h"
+ #else
+ #error The selected board does not contain a dataflash IC.
+ #endif
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Returns the mask of the currently selected Dataflash chip, either DATAFLASH_NO_CHIP or a
+ * DATAFLASH_CHIPn mask (where n is the chip number).
+ */
+ #define Dataflash_GetSelectedChip() (DATAFLASH_CHIPCS_PORT & DATAFLASH_CHIPCS_MASK)
+
+ /** Selects the dataflash chip given as a chip mask, in the form of DATAFLASH_CHIPn (where n
+ * is the chip number).
+ */
+ #define Dataflash_SelectChip(mask) MACROS{ DATAFLASH_CHIPCS_PORT = ((DATAFLASH_CHIPCS_PORT \
+ & ~DATAFLASH_CHIPCS_MASK) | mask); }MACROE
+
+ /** Deselects the current dataflash chip, so that no dataflash is selected. */
+ #define Dataflash_DeselectChip() Dataflash_SelectChip(DATAFLASH_NO_CHIP)
+
+ /* Inline Functions: */
+ /** Initializes the dataflash driver (including the SPI driver) so that commands and data may be
+ * sent to an attached dataflash IC.
+ *
+ * \param PrescalerMask SPI prescaler mask, see SPI.h documentation
+ */
+ static inline void Dataflash_Init(const uint8_t PrescalerMask)
+ {
+ DATAFLASH_CHIPCS_DDR |= DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK;
+
+ SPI_Init(PrescalerMask, true);
+ }
+
+ /** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
+ *
+ * \param Byte of data to send to the dataflash
+ *
+ * \return Last response byte from the dataflash
+ */
+ static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYSINLINE;
+ static inline uint8_t Dataflash_TransferByte(const uint8_t Byte)
+ {
+ return SPI_TransferByte(Byte);
+ }
+
+ /** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
+ *
+ * \param Byte of data to send to the dataflash
+ */
+ static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYSINLINE;
+ static inline void Dataflash_SendByte(const uint8_t Byte)
+ {
+ SPI_SendByte(Byte);
+ }
+
+ /** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
+ *
+ * \return Last response byte from the dataflash
+ */
+ static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYSINLINE ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Dataflash_ReceiveByte(void)
+ {
+ return SPI_ReceiveByte();
+ }
+
+ /** Toggles the select line of the currently selected dataflash IC, so that it is ready to receive
+ * a new command.
+ */
+ static inline void Dataflash_ToggleSelectedChipCS(void)
+ {
+ #if (DATAFLASH_TOTALCHIPS == 2)
+ uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
+
+ Dataflash_DeselectChip();
+ Dataflash_SelectChip(SelectedChipMask);
+ #else
+ Dataflash_DeselectChip();
+ Dataflash_SelectChip(DATAFLASH_CHIP1);
+ #endif
+ }
+
+ /** Spinloops while the currently selected dataflash is busy executing a command, such as a main
+ * memory page program or main memory to buffer transfer.
+ */
+ static inline void Dataflash_WaitWhileBusy(void)
+ {
+ Dataflash_ToggleSelectedChipCS();
+ Dataflash_SendByte(DF_CMD_GETSTATUS);
+ while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
+ }
+
+ /** Selects a dataflash IC from the given page number, which should range from 0 to
+ * ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). For boards containing only one
+ * dataflash IC, this will select DATAFLASH_CHIP1. If the given page number is outside the total number
+ * of pages contained in the boards dataflash ICs, all dataflash ICs are deselected.
+ *
+ * \param PageAddress Address of the page to manipulate, ranging from
+ * ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1).
+ */
+ static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
+ {
+ Dataflash_DeselectChip();
+
+ if (PageAddress >= (DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS))
+ return;
+
+ #if (DATAFLASH_TOTALCHIPS == 2)
+ if (PageAddress & 0x01)
+ Dataflash_SelectChip(DATAFLASH_CHIP2);
+ else
+ Dataflash_SelectChip(DATAFLASH_CHIP1);
+ #else
+ Dataflash_SelectChip(DATAFLASH_CHIP1);
+ #endif
+ }
+
+ /** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
+ * dataflash commands which require a complete 24-byte address.
+ *
+ * \param PageAddress Page address within the selected dataflash IC
+ * \param BufferByte Address within the dataflash's buffer
+ */
+ static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte)
+ {
+ #if (DATAFLASH_TOTALCHIPS == 2)
+ PageAddress >>= 1;
+ #endif
+
+ Dataflash_SendByte(PageAddress >> 5);
+ Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
+ Dataflash_SendByte(BufferByte);
+ }
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/HWB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/HWB.h
new file mode 100644
index 00000000..43aac9b5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/HWB.h
@@ -0,0 +1,87 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file is the master dispatch header file for the board-specific HWB driver, for boards containing a
+ * physical pushbutton connected to the AVR's HWB IO pin.
+ *
+ * User code should include this file, which will in turn include the correct HWB driver header file for the
+ * currently selected board.
+ *
+ * If the BOARD value is set to BOARD_USER, this will include the /Board/HWB.h file in the user project
+ * directory.
+ */
+
+#ifndef __HWB_H__
+#define __HWB_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_HWB_H
+ #define INCLUDE_FROM_BOARD_DRIVER
+ #endif
+
+ /* Includes: */
+ #include "../../Common/Common.h"
+
+ #if !defined(BOARD)
+ #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #elif (BOARD == BOARD_USBKEY)
+ #include "USBKEY/HWB.h"
+ #elif (BOARD == BOARD_STK525)
+ #include "STK525/HWB.h"
+ #elif (BOARD == BOARD_STK526)
+ #include "STK526/HWB.h"
+ #elif (BOARD == BOARD_ATAVRUSBRF01)
+ #include "ATAVRUSBRF01/HWB.h"
+ #elif (BOARD == BOARD_USER)
+ #include "Board/HWB.h"
+ #else
+ #error The selected board does not contain a HWB.
+ #endif
+
+ /* Psudo-Functions for Doxygen: */
+ #if defined(__DOXYGEN__)
+ /** Initializes the HWB driver, so that the current button position can be read. This sets the appropriate
+ * I/O pin to an input with pull-up enabled.
+ *
+ * This must be called before any HWB functions are used.
+ */
+ static inline void HWB_Init(void);
+
+ /** Returns the current position of the HWB button on the board.
+ *
+ * \return Boolean true if the button is currently pressed, false otherwise
+ */
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Joystick.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Joystick.h
new file mode 100644
index 00000000..1f57e62c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Joystick.h
@@ -0,0 +1,85 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file is the master dispatch header file for the board-specific Joystick driver, for boards containing a
+ * 5-way joystick.
+ *
+ * User code should include this file, which will in turn include the correct joystick driver header file for the
+ * currently selected board.
+ *
+ * If the BOARD value is set to BOARD_USER, this will include the /Board/Joystick.h file in the user project
+ * directory.
+ */
+
+#ifndef __JOYSTICK_H__
+#define __JOYSTICK_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_JOYSTICK_H
+ #define INCLUDE_FROM_BOARD_DRIVER
+ #endif
+
+ /* Includes: */
+ #include "../../Common/Common.h"
+
+ #if !defined(BOARD)
+ #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #elif (BOARD == BOARD_USBKEY)
+ #include "USBKEY/Joystick.h"
+ #elif (BOARD == BOARD_STK525)
+ #include "STK525/Joystick.h"
+ #elif (BOARD == BOARD_STK526)
+ #include "STK526/Joystick.h"
+ #elif (BOARD == BOARD_USER)
+ #include "Board/Joystick.h"
+ #else
+ #error The selected board does not contain a joystick.
+ #endif
+
+ /* Psudo-Functions for Doxygen: */
+ #if defined(__DOXYGEN__)
+ /** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate
+ * I/O pins to inputs with their pull-ups enabled.
+ */
+ static inline void Joystick_Init(void);
+
+ /** Returns the current status of the joystick, as a mask indicating the direction the joystick is
+ * currently facing in (multiple bits can be set).
+ *
+ * \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file
+ * for direction masks
+ */
+ static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/LEDs.h
new file mode 100644
index 00000000..cda15a42
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/LEDs.h
@@ -0,0 +1,113 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * This file is the master dispatch header file for the board-specific LED driver, for boards containing user
+ * controllable LEDs.
+ *
+ * User code should include this file, which will in turn include the correct LED driver header file for the
+ * currently selected board.
+ *
+ * If the BOARD value is set to BOARD_USER, this will include the /Board/LEDs.h file in the user project
+ * directory.
+ */
+
+#ifndef __LEDS_H__
+#define __LEDS_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_LEDS_H
+ #define INCLUDE_FROM_BOARD_DRIVER
+ #endif
+
+ /* Includes: */
+ #include "../../Common/Common.h"
+
+ #if !defined(BOARD)
+ #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #elif (BOARD == BOARD_USBKEY)
+ #include "USBKEY/LEDs.h"
+ #elif (BOARD == BOARD_STK525)
+ #include "STK525/LEDs.h"
+ #elif (BOARD == BOARD_STK526)
+ #include "STK526/LEDs.h"
+ #elif (BOARD == BOARD_RZUSBSTICK)
+ #include "RZUSBSTICK/LEDs.h"
+ #elif (BOARD == BOARD_ATAVRUSBRF01)
+ #include "ATAVRUSBRF01/LEDs.h"
+ #elif (BOARD == BOARD_USER)
+ #include "Board/LEDs.h"
+ #endif
+
+ /* Psudo-Functions for Doxygen: */
+ #if defined(__DOXYGEN__)
+ /** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port
+ * I/O pins as outputs, and sets the LEDs to default to off.
+ */
+ static inline void LEDs_Init(void);
+
+ /** Turns on the LEDs specified in the given LED mask.
+ *
+ * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
+ */
+ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask);
+
+ /** Turns off the LEDs specified in the given LED mask.
+ *
+ * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
+ */
+ static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask);
+
+ /** Turns off all LEDs not specified in the given LED mask, and turns on all the LEDs in the given LED
+ * mask.
+ *
+ * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
+ */
+ static inline void LEDs_SetAllLEDs(const uint8_t LEDMask);
+
+ /** Turns off all LEDs in the LED mask that are not set in the active mask, and turns on all the LEDs
+ * specified in both the LED and active masks.
+ *
+ * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
+ * \param ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off
+ */
+ static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask);
+
+ /** Returns the status of all the board LEDs; set LED masks in the return value indicate that the
+ * corresponding LED is on.
+ *
+ * \return Mask of the board LEDs which are currently turned on
+ */
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h
new file mode 100644
index 00000000..38cbed0c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h
@@ -0,0 +1,141 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific LED driver header for the RZUSBSTICK.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver
+ * dispatch header located in LUFA/Drivers/Board/LEDs.h.
+ */
+
+#ifndef __LEDS_RZUSBSTICK_H__
+#define __LEDS_RZUSBSTICK_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2)
+ #define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4)
+
+ #define LEDS_PORTE_MASK_SHIFT 4
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 (1 << 7)
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 (1 << 5)
+
+ /** LED mask for the third LED on the board. */
+ #define LEDS_LED3 ((1 << 6) >> LEDS_PORTE_MASK_SHIFT)
+
+ /** LED mask for the fourth LED on the board. */
+ #define LEDS_LED4 ((1 << 7) >> LEDS_PORTE_MASK_SHIFT)
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ DDRD |= LEDS_PORTD_LEDS;
+ PORTD &= ~LEDS_LED1;
+ PORTD |= LEDS_LED2;
+
+ DDRE |= (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
+ PORTE |= (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
+ {
+ PORTD |= (LEDMask & LEDS_LED1);
+ PORTD &= ~(LEDMask & LEDS_LED2);
+ PORTE &= ~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
+ {
+ PORTD &= ~(LEDMask & LEDS_LED1);
+ PORTD |= (LEDMask & LEDS_LED2);
+ PORTE |= ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
+ {
+ PORTD = (((PORTD & ~LEDS_LED1) | (LEDMask & LEDS_LED1)) |
+ ((PORTD | LEDS_LED2) & ~(LEDMask & LEDS_LED2)));
+ PORTE = ((PORTE | (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT)) &
+ ~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT));
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
+ {
+ PORTD = (((PORTD & ~(LEDMask & LEDS_LED1)) | (ActiveMask & LEDS_LED1)) |
+ ((PORTD | (LEDMask & LEDS_LED2)) & ~(ActiveMask & LEDS_LED2)));
+ PORTE = ((PORTE | ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT)) &
+ ~((ActiveMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT));
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ return (((PORTD & LEDS_LED1) | (~PORTD & LEDS_LED2)) |
+ ((~PORTE & (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT)) >> LEDS_PORTE_MASK_SHIFT));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/AT45DB321C.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/AT45DB321C.h
new file mode 100644
index 00000000..ac29967e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/AT45DB321C.h
@@ -0,0 +1,84 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific Dataflash commands header for the AT45DB321C as mounted on the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_CMDS_H__
+#define __DATAFLASH_CMDS_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #define DF_STATUS_READY (1 << 7)
+ #define DF_STATUS_COMPMISMATCH (1 << 6)
+ #define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
+
+ #define DF_MANUFACTURER_ATMEL 0x1F
+
+ #define DF_CMD_GETSTATUS 0xD7
+
+ #define DF_CMD_MAINMEMTOBUFF1 0x53
+ #define DF_CMD_MAINMEMTOBUFF2 0x55
+ #define DF_CMD_MAINMEMTOBUFF1COMP 0x60
+ #define DF_CMD_MAINMEMTOBUFF2COMP 0x61
+ #define DF_CMD_AUTOREWRITEBUFF1 0x58
+ #define DF_CMD_AUTOREWRITEBUFF2 0x59
+
+ #define DF_CMD_MAINMEMPAGEREAD 0xD2
+ #define DF_CMD_CONTARRAYREAD_LF 0xE8
+ #define DF_CMD_BUFF1READ_LF 0xD4
+ #define DF_CMD_BUFF2READ_LF 0xD6
+
+ #define DF_CMD_BUFF1WRITE 0x84
+ #define DF_CMD_BUFF2WRITE 0x87
+ #define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
+ #define DF_CMD_BUFF2TOMAINMEMWITHERASE 0x86
+ #define DF_CMD_BUFF1TOMAINMEM 0x88
+ #define DF_CMD_BUFF2TOMAINMEM 0x89
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
+
+ #define DF_CMD_PAGEERASE 0x81
+ #define DF_CMD_BLOCKERASE 0x50
+
+ #define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0xCF})
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0xCF
+
+ #define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Dataflash.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Dataflash.h
new file mode 100644
index 00000000..3f30f97b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Dataflash.h
@@ -0,0 +1,75 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_STK525_H__
+#define __DATAFLASH_STK525_H__
+
+ /* Includes: */
+ #include "AT45DB321C.h"
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define DATAFLASH_CHIPCS_MASK (1 << 4)
+ #define DATAFLASH_CHIPCS_DDR DDRB
+ #define DATAFLASH_CHIPCS_PORT PORTB
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Constant indicating the total number of dataflash ICs mounted on the selected board. */
+ #define DATAFLASH_TOTALCHIPS 1
+
+ /** Mask for no dataflash chip selected. */
+ #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+
+ /** Mask for the first dataflash chip selected. */
+ #define DATAFLASH_CHIP1 0
+
+ /** Internal main memory page size for the board's dataflash IC. */
+ #define DATAFLASH_PAGE_SIZE 512
+
+ /** Total number of pages inside the board's dataflash IC. */
+ #define DATAFLASH_PAGES 8192
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/HWB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/HWB.h
new file mode 100644
index 00000000..a0ff72de
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/HWB.h
@@ -0,0 +1,79 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the HWB driver
+ * dispatch header located in LUFA/Drivers/Board/HWB.h.
+ */
+
+#ifndef __HWB_STK525_H__
+#define __HWB_STK525_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_HWB_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void HWB_Init(void)
+ {
+ DDRE &= ~(1 << 2);
+ PORTE |= (1 << 2);
+ }
+
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline bool HWB_GetStatus(void)
+ {
+ return (!(PINE & (1 << 2)));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Joystick.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Joystick.h
new file mode 100644
index 00000000..58aed4f8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/Joystick.h
@@ -0,0 +1,104 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific joystick driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the joystick driver
+ * dispatch header located in LUFA/Drivers/Board/Joystick.h.
+ */
+
+#ifndef __JOYSTICK_STK525_H__
+#define __JOYSTICK_STK525_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
+ #define JOY_EMASK ((1 << 4) | (1 << 5))
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for the joystick being pushed in the left direction. */
+ #define JOY_LEFT (1 << 6)
+
+ /** Mask for the joystick being pushed in the right direction. */
+ #define JOY_RIGHT ((1 << 4) >> 1)
+
+ /** Mask for the joystick being pushed in the upward direction. */
+ #define JOY_UP (1 << 7)
+
+ /** Mask for the joystick being pushed in the downward direction. */
+ #define JOY_DOWN ((1 << 5) >> 1)
+
+ /** Mask for the joystick being pushed inward. */
+ #define JOY_PRESS (1 << 5)
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void Joystick_Init(void)
+ {
+ DDRB &= ~(JOY_BMASK);
+ DDRE &= ~(JOY_EMASK);
+
+ PORTB |= JOY_BMASK;
+ PORTE |= JOY_EMASK;
+ };
+
+ static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Joystick_GetStatus(void)
+ {
+ return (((uint8_t)~PINB & JOY_BMASK) | (((uint8_t)~PINE & JOY_EMASK) >> 1));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/LEDs.h
new file mode 100644
index 00000000..13f626c2
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK525/LEDs.h
@@ -0,0 +1,117 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific LED driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver
+ * dispatch header located in LUFA/Drivers/Board/LEDs.h.
+ */
+
+#ifndef __LEDS_STK525_H__
+#define __LEDS_STK525_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 (1 << 4)
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 (1 << 5)
+
+ /** LED mask for the third LED on the board. */
+ #define LEDS_LED3 (1 << 7)
+
+ /** LED mask for the fourth LED on the board. */
+ #define LEDS_LED4 (1 << 6)
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ DDRD |= LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
+ {
+ PORTD |= LedMask;
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LedMask)
+ {
+ PORTD &= ~LedMask;
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LedMask)
+ {
+ PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LedMask);
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LedMask, const uint8_t ActiveMask)
+ {
+ PORTD = ((PORTD & ~LedMask) | ActiveMask);
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ return (PORTD & LEDS_ALL_LEDS);
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/AT45DB642D.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/AT45DB642D.h
new file mode 100644
index 00000000..dd38ed1d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/AT45DB642D.h
@@ -0,0 +1,94 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific Dataflash commands header for the AT45DB642D as mounted on the STK526.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_CMDS_H__
+#define __DATAFLASH_CMDS_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #define DF_STATUS_READY (1 << 7)
+ #define DF_STATUS_COMPMISMATCH (1 << 6)
+ #define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
+ #define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
+
+ #define DF_MANUFACTURER_ATMEL 0x1F
+
+ #define DF_CMD_GETSTATUS 0xD7
+ #define DF_CMD_POWERDOWN 0xB9
+ #define DF_CMD_WAKEUP 0xAB
+
+ #define DF_CMD_MAINMEMTOBUFF1 0x53
+ #define DF_CMD_MAINMEMTOBUFF2 0x55
+ #define DF_CMD_MAINMEMTOBUFF1COMP 0x60
+ #define DF_CMD_MAINMEMTOBUFF2COMP 0x61
+ #define DF_CMD_AUTOREWRITEBUFF1 0x58
+ #define DF_CMD_AUTOREWRITEBUFF2 0x59
+
+ #define DF_CMD_MAINMEMPAGEREAD 0xD2
+ #define DF_CMD_CONTARRAYREAD_LF 0x03
+ #define DF_CMD_BUFF1READ_LF 0xD1
+ #define DF_CMD_BUFF2READ_LF 0xD3
+
+ #define DF_CMD_BUFF1WRITE 0x84
+ #define DF_CMD_BUFF2WRITE 0x87
+ #define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
+ #define DF_CMD_BUFF2TOMAINMEMWITHERASE 0x86
+ #define DF_CMD_BUFF1TOMAINMEM 0x88
+ #define DF_CMD_BUFF2TOMAINMEM 0x89
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
+
+ #define DF_CMD_PAGEERASE 0x81
+ #define DF_CMD_BLOCKERASE 0x50
+ #define DF_CMD_SECTORERASE 0x7C
+
+ #define DF_CMD_CHIPERASE ((char[]){0xC7, 0x94, 0x80, 0x9A})
+ #define DF_CMD_CHIPERASE_BYTE1 0xC7
+ #define DF_CMD_CHIPERASE_BYTE2 0x94
+ #define DF_CMD_CHIPERASE_BYTE3 0x80
+ #define DF_CMD_CHIPERASE_BYTE4 0x9A
+
+ #define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0x9A
+
+ #define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Dataflash.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Dataflash.h
new file mode 100644
index 00000000..177fefaa
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Dataflash.h
@@ -0,0 +1,75 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_STK526_H__
+#define __DATAFLASH_STK526_H__
+
+ /* Includes: */
+ #include "AT45DB642D.h"
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define DATAFLASH_CHIPCS_MASK (1 << 2)
+ #define DATAFLASH_CHIPCS_DDR DDRC
+ #define DATAFLASH_CHIPCS_PORT PORTC
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Constant indicating the total number of dataflash ICs mounted on the selected board. */
+ #define DATAFLASH_TOTALCHIPS 1
+
+ /** Mask for no dataflash chip selected. */
+ #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+
+ /** Mask for the first dataflash chip selected. */
+ #define DATAFLASH_CHIP1 0
+
+ /** Internal main memory page size for the board's dataflash IC. */
+ #define DATAFLASH_PAGE_SIZE 1024
+
+ /** Total number of pages inside the board's dataflash IC. */
+ #define DATAFLASH_PAGES 8192
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/HWB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/HWB.h
new file mode 100644
index 00000000..3bd2f995
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/HWB.h
@@ -0,0 +1,79 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the STK526.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the HWB driver
+ * dispatch header located in LUFA/Drivers/Board/HWB.h.
+ */
+
+#ifndef __HWB_STK526_H__
+#define __HWB_STK526_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_HWB_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void HWB_Init(void)
+ {
+ DDRD &= ~(1 << 7);
+ PORTD |= (1 << 7);
+ }
+
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline bool HWB_GetStatus(void)
+ {
+ return (!(PIND & (1 << 7)));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Joystick.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Joystick.h
new file mode 100644
index 00000000..e5cd2e47
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/Joystick.h
@@ -0,0 +1,101 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific joystick driver header for the STK526.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the joystick driver
+ * dispatch header located in LUFA/Drivers/Board/Joystick.h.
+ */
+
+#ifndef __JOYSTICK_STK526_H__
+#define __JOYSTICK_STK526_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define JOY_BMASK ((1 << 0) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7))
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for the joystick being pushed in the left direction. */
+ #define JOY_LEFT (1 << 4)
+
+ /** Mask for the joystick being pushed in the right direction. */
+ #define JOY_RIGHT (1 << 6)
+
+ /** Mask for the joystick being pushed in the upward direction. */
+ #define JOY_UP (1 << 5)
+
+ /** Mask for the joystick being pushed in the downward direction. */
+ #define JOY_DOWN (1 << 7)
+
+ /** Mask for the joystick being pushed inward. */
+ #define JOY_PRESS (1 << 0)
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void Joystick_Init(void)
+ {
+ DDRB &= ~JOY_BMASK;
+
+ PORTB |= JOY_BMASK;
+ };
+
+ static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Joystick_GetStatus(void)
+ {
+ return ((uint8_t)~PINB & JOY_BMASK);
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/LEDs.h
new file mode 100644
index 00000000..fc88a573
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/STK526/LEDs.h
@@ -0,0 +1,117 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific LED driver header for the STK526.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver
+ * dispatch header located in LUFA/Drivers/Board/LEDs.h.
+ */
+
+#ifndef __LEDS_STK526_H__
+#define __LEDS_STK526_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 (1 << 1)
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 (1 << 0)
+
+ /** LED mask for the third LED on the board. */
+ #define LEDS_LED3 (1 << 5)
+
+ /** LED mask for the fourth LED on the board. */
+ #define LEDS_LED4 (1 << 4)
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ DDRD |= LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
+ {
+ PORTD |= LedMask;
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LedMask)
+ {
+ PORTD &= ~LedMask;
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LedMask)
+ {
+ PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LedMask);
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LedMask, const uint8_t ActiveMask)
+ {
+ PORTD = ((PORTD & ~LedMask) | ActiveMask);
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ return (PORTD & LEDS_ALL_LEDS);
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.c
new file mode 100644
index 00000000..f908ac96
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.c
@@ -0,0 +1,60 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "Temperature.h"
+
+static const uint16_t PROGMEM Temperature_Lookup[] = {
+ 0x3B4, 0x3B0, 0x3AB, 0x3A6, 0x3A0, 0x39A, 0x394, 0x38E, 0x388, 0x381, 0x37A, 0x373,
+ 0x36B, 0x363, 0x35B, 0x353, 0x34A, 0x341, 0x338, 0x32F, 0x325, 0x31B, 0x311, 0x307,
+ 0x2FC, 0x2F1, 0x2E6, 0x2DB, 0x2D0, 0x2C4, 0x2B8, 0x2AC, 0x2A0, 0x294, 0x288, 0x27C,
+ 0x26F, 0x263, 0x256, 0x24A, 0x23D, 0x231, 0x225, 0x218, 0x20C, 0x200, 0x1F3, 0x1E7,
+ 0x1DB, 0x1CF, 0x1C4, 0x1B8, 0x1AC, 0x1A1, 0x196, 0x18B, 0x180, 0x176, 0x16B, 0x161,
+ 0x157, 0x14D, 0x144, 0x13A, 0x131, 0x128, 0x11F, 0x117, 0x10F, 0x106, 0x0FE, 0x0F7,
+ 0x0EF, 0x0E8, 0x0E1, 0x0DA, 0x0D3, 0x0CD, 0x0C7, 0x0C0, 0x0BA, 0x0B5, 0x0AF, 0x0AA,
+ 0x0A4, 0x09F, 0x09A, 0x096, 0x091, 0x08C, 0x088, 0x084, 0x080, 0x07C, 0x078, 0x074,
+ 0x071, 0x06D, 0x06A, 0x067, 0x064, 0x061, 0x05E, 0x05B, 0x058, 0x055, 0x053, 0x050,
+ 0x04E, 0x04C, 0x049, 0x047, 0x045, 0x043, 0x041, 0x03F, 0x03D, 0x03C, 0x03A, 0x038
+ };
+
+int8_t Temperature_GetTemperature(void)
+{
+ uint16_t Temp_ADC = ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | TEMP_ADC_CHANNEL);
+
+ if (Temp_ADC > pgm_read_word(&Temperature_Lookup[0]))
+ return TEMP_MIN_TEMP;
+
+ for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; Index++)
+ {
+ if (Temp_ADC > pgm_read_word(&Temperature_Lookup[Index]))
+ return (Index + TEMP_TABLE_OFFSET);
+ }
+
+ return TEMP_MAX_TEMP;
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.h
new file mode 100644
index 00000000..c205093a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/Temperature.h
@@ -0,0 +1,100 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Temperature sensor board driver for the USB boards which contain a temperature sensor.
+ */
+
+#ifndef __TEMPERATURE_H__
+#define __TEMPERATURE_H__
+
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define INCLUDE_FROM_BOARD_DRIVER
+ #endif
+
+ /* Includes: */
+ #include <avr/pgmspace.h>
+
+ #include "../AT90USBXXX/ADC.h"
+ #include "../../Common/Common.h"
+
+ #if !defined(BOARD)
+ #error #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #elif (BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && (BOARD != BOARD_STK526)
+ #error The selected board does not contain a temperature sensor.
+ #endif
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** ADC channel number for the temperature sensor. */
+ #define TEMP_ADC_CHANNEL 0
+
+ /** Minimum returnable temperature from the Temperature_GetTemperature() function. */
+ #define TEMP_MIN_TEMP TEMP_TABLE_OFFSET
+
+ /** Maximum returnable temperature from the Temperature_GetTemperature() function. */
+ #define TEMP_MAX_TEMP ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
+
+ /** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.
+ * This must be called before any other temperature sensor routines.
+ *
+ * The ADC itself (not the ADC channel) must be configured seperately before calling the temperature
+ * sensor functions.
+ */
+ #define Temperature_Init() ADC_SetupChannel(TEMP_ADC_CHANNEL);
+
+ /* Function Prototypes: */
+ /** Performs a complete ADC on the temperature sensor channel, and converts the result into a
+ * valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celcius.
+ *
+ * \return Signed temperature in degrees Celcius
+ */
+ int8_t Temperature_GetTemperature(void) ATTR_WARN_UNUSED_RESULT;
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define TEMP_TABLE_SIZE (sizeof(Temperature_Lookup) / sizeof(Temperature_Lookup[0]))
+ #define TEMP_TABLE_OFFSET -21
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/AT45DB642D.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/AT45DB642D.h
new file mode 100644
index 00000000..197be1c6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/AT45DB642D.h
@@ -0,0 +1,94 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific Dataflash commands header for the AT45DB642D as mounted on the USBKEY.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_CMDS_H__
+#define __DATAFLASH_CMDS_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #define DF_STATUS_READY (1 << 7)
+ #define DF_STATUS_COMPMISMATCH (1 << 6)
+ #define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
+ #define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
+
+ #define DF_MANUFACTURER_ATMEL 0x1F
+
+ #define DF_CMD_GETSTATUS 0xD7
+ #define DF_CMD_POWERDOWN 0xB9
+ #define DF_CMD_WAKEUP 0xAB
+
+ #define DF_CMD_MAINMEMTOBUFF1 0x53
+ #define DF_CMD_MAINMEMTOBUFF2 0x55
+ #define DF_CMD_MAINMEMTOBUFF1COMP 0x60
+ #define DF_CMD_MAINMEMTOBUFF2COMP 0x61
+ #define DF_CMD_AUTOREWRITEBUFF1 0x58
+ #define DF_CMD_AUTOREWRITEBUFF2 0x59
+
+ #define DF_CMD_MAINMEMPAGEREAD 0xD2
+ #define DF_CMD_CONTARRAYREAD_LF 0x03
+ #define DF_CMD_BUFF1READ_LF 0xD1
+ #define DF_CMD_BUFF2READ_LF 0xD3
+
+ #define DF_CMD_BUFF1WRITE 0x84
+ #define DF_CMD_BUFF2WRITE 0x87
+ #define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
+ #define DF_CMD_BUFF2TOMAINMEMWITHERASE 0x86
+ #define DF_CMD_BUFF1TOMAINMEM 0x88
+ #define DF_CMD_BUFF2TOMAINMEM 0x89
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
+ #define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
+
+ #define DF_CMD_PAGEERASE 0x81
+ #define DF_CMD_BLOCKERASE 0x50
+ #define DF_CMD_SECTORERASE 0x7C
+
+ #define DF_CMD_CHIPERASE ((char[]){0xC7, 0x94, 0x80, 0x9A})
+ #define DF_CMD_CHIPERASE_BYTE1 0xC7
+ #define DF_CMD_CHIPERASE_BYTE2 0x94
+ #define DF_CMD_CHIPERASE_BYTE3 0x80
+ #define DF_CMD_CHIPERASE_BYTE4 0x9A
+
+ #define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
+ #define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0x9A
+
+ #define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Dataflash.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Dataflash.h
new file mode 100644
index 00000000..848ae32d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Dataflash.h
@@ -0,0 +1,78 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the STK525.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the dataflash driver
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ */
+
+#ifndef __DATAFLASH_USBKEY_H__
+#define __DATAFLASH_USBKEY_H__
+
+ /* Includes: */
+ #include "AT45DB642D.h"
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define DATAFLASH_CHIPCS_MASK ((1 << 1) | (1 << 0))
+ #define DATAFLASH_CHIPCS_DDR DDRE
+ #define DATAFLASH_CHIPCS_PORT PORTE
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Constant indicating the total number of dataflash ICs mounted on the selected board. */
+ #define DATAFLASH_TOTALCHIPS 2
+
+ /** Mask for no dataflash chip selected. */
+ #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+
+ /** Mask for the first dataflash chip selected. */
+ #define DATAFLASH_CHIP1 (1 << 1)
+
+ /** Mask for the second dataflash chip selected. */
+ #define DATAFLASH_CHIP2 (1 << 0)
+
+ /** Internal main memory page size for the board's dataflash ICs. */
+ #define DATAFLASH_PAGE_SIZE 1024
+
+ /** Total number of pages inside each of the board's dataflash ICs. */
+ #define DATAFLASH_PAGES 8192
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/HWB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/HWB.h
new file mode 100644
index 00000000..750368b1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/HWB.h
@@ -0,0 +1,79 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific HWB driver header for the USBKEY.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the HWB driver
+ * dispatch header located in LUFA/Drivers/Board/HWB.h.
+ */
+
+#ifndef __HWB_USBKEY_H__
+#define __HWB_USBKEY_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_HWB_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void HWB_Init(void)
+ {
+ DDRE &= ~(1 << 2);
+ PORTE |= (1 << 2);
+ }
+
+ static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline bool HWB_GetStatus(void)
+ {
+ return (!(PINE & (1 << 2)));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Joystick.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Joystick.h
new file mode 100644
index 00000000..6c2d72ae
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/Joystick.h
@@ -0,0 +1,104 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific joystick driver header for the USBKEY.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the joystick driver
+ * dispatch header located in LUFA/Drivers/Board/Joystick.h.
+ */
+
+#ifndef __JOYSTICK_USBKEY_H__
+#define __JOYSTICK_USBKEY_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
+ #define JOY_EMASK ((1 << 4) | (1 << 5))
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for the joystick being pushed in the left direction. */
+ #define JOY_LEFT (1 << 6)
+
+ /** Mask for the joystick being pushed in the right direction. */
+ #define JOY_RIGHT ((1 << 4) >> 1)
+
+ /** Mask for the joystick being pushed in the upward direction. */
+ #define JOY_UP (1 << 7)
+
+ /** Mask for the joystick being pushed in the downward direction. */
+ #define JOY_DOWN ((1 << 5) >> 1)
+
+ /** Mask for the joystick being pushed inward. */
+ #define JOY_PRESS (1 << 5)
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void Joystick_Init(void)
+ {
+ DDRB &= ~(JOY_BMASK);
+ DDRE &= ~(JOY_EMASK);
+
+ PORTB |= JOY_BMASK;
+ PORTE |= JOY_EMASK;
+ };
+
+ static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Joystick_GetStatus(void)
+ {
+ return (((uint8_t)~PINB & JOY_BMASK) | (((uint8_t)~PINE & JOY_EMASK) >> 1));
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/LEDs.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/LEDs.h
new file mode 100644
index 00000000..07a2b750
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Board/USBKEY/LEDs.h
@@ -0,0 +1,117 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Board specific LED driver header for the USBKEY.
+ *
+ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver
+ * dispatch header located in LUFA/Drivers/Board/LEDs.h.
+ */
+
+#ifndef __LEDS_USBKEY_H__
+#define __LEDS_USBKEY_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks: */
+ #if !defined(INCLUDE_FROM_LEDS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** LED mask for the first LED on the board. */
+ #define LEDS_LED1 (1 << 4)
+
+ /** LED mask for the second LED on the board. */
+ #define LEDS_LED2 (1 << 5)
+
+ /** LED mask for the third LED on the board. */
+ #define LEDS_LED3 (1 << 7)
+
+ /** LED mask for the fourth LED on the board. */
+ #define LEDS_LED4 (1 << 6)
+
+ /** LED mask for all the LEDs on the board. */
+ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
+
+ /** LED mask for the none of the board LEDs */
+ #define LEDS_NO_LEDS 0
+
+ /* Inline Functions: */
+ #if !defined(__DOXYGEN__)
+ static inline void LEDs_Init(void)
+ {
+ DDRD |= LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ }
+
+ static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
+ {
+ PORTD |= LedMask;
+ }
+
+ static inline void LEDs_TurnOffLEDs(const uint8_t LedMask)
+ {
+ PORTD &= ~LedMask;
+ }
+
+ static inline void LEDs_SetAllLEDs(const uint8_t LedMask)
+ {
+ PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LedMask);
+ }
+
+ static inline void LEDs_ChangeLEDs(const uint8_t LedMask, const uint8_t ActiveMask)
+ {
+ PORTD = ((PORTD & ~LedMask) | ActiveMask);
+ }
+
+ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t LEDs_GetLEDs(void)
+ {
+ return (PORTD & LEDS_ALL_LEDS);
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/Misc/TerminalCodes.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/Misc/TerminalCodes.h
new file mode 100644
index 00000000..d6e58708
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/Misc/TerminalCodes.h
@@ -0,0 +1,176 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * ANSI terminal compatible escape sequences. These escape sequences are designed to be concatenated with existing
+ * strings to modify their display on a compatible terminal application.
+ *
+ * \note If desired, the macro DISABLE_TERMINAL_CODES can be defined in the project makefile and passed to the GCC
+ * compiler via the -D switch to disable the terminal codes without modifying the source, for use with non
+ * compatible terminals (any terminal code then equate to empty strings).
+ *
+ * Example Usage:
+ * \code
+ * printf("Some String, " ESC_BOLD_ON " Some bold string");
+ * \endcode
+ */
+
+#ifndef __TERMINALCODES_H__
+#define __TERMINALCODES_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #if !defined(DISABLE_TERMINAL_CODES)
+ /** Creates an ANSII escape sequence with the payload specified by "c". */
+ #define ANSI_ESCAPE_SEQUENCE(c) "\33[" c
+ #else
+ #define ANSI_ESCAPE_SEQUENCE(c)
+ #endif
+
+ /** Resets any escape sequence modifiers back to their defaults. */
+ #define ESC_RESET ANSI_ESCAPE_SEQUENCE("0m")
+
+ /** Turns on bold so that any following text is printed to the terminal in bold. */
+ #define ESC_BOLD_ON ANSI_ESCAPE_SEQUENCE("1m")
+
+ /** Turns on italics so that any following text is printed to the terminal in italics. */
+ #define ESC_ITALICS_ON ANSI_ESCAPE_SEQUENCE("3m")
+
+ /** Turns on underline so that any following text is printed to the terminal underlined. */
+ #define ESC_UNDERLINE_ON ANSI_ESCAPE_SEQUENCE("4m")
+
+ /** Turns on inverse so that any following text is printed to the terminal in inverted colours. */
+ #define ESC_INVERSE_ON ANSI_ESCAPE_SEQUENCE("7m")
+
+ /** Turns on strikethrough so that any following text is printed to the terminal with a line through the
+ * center.
+ */
+ #define ESC_STRIKETHROUGH_ON ANSI_ESCAPE_SEQUENCE("9m")
+
+ /** Turns off bold so that any following text is printed to the terminal in non bold. */
+ #define ESC_BOLD_OFF ANSI_ESCAPE_SEQUENCE("22m")
+
+ /** Turns off italics so that any following text is printed to the terminal in non italics. */
+ #define ESC_ITALICS_OFF ANSI_ESCAPE_SEQUENCE("23m")
+
+ /** Turns off underline so that any following text is printed to the terminal non underlined. */
+ #define ESC_UNDERLINE_OFF ANSI_ESCAPE_SEQUENCE("24m")
+
+ /** Turns off inverse so that any following text is printed to the terminal in non inverted colours. */
+ #define ESC_INVERSE_OFF ANSI_ESCAPE_SEQUENCE("27m")
+
+ /** Turns off strikethrough so that any following text is printed to the terminal without a line through
+ * the center.
+ */
+ #define ESC_STRIKETHROUGH_OFF ANSI_ESCAPE_SEQUENCE("29m")
+
+ /** Sets the foreground (text) colour to black. */
+ #define ESC_FG_BLACK ANSI_ESCAPE_SEQUENCE("30m")
+
+ /** Sets the foreground (text) colour to red. */
+ #define ESC_FG_RED ANSI_ESCAPE_SEQUENCE("31m")
+
+ /** Sets the foreground (text) colour to green. */
+ #define ESC_FG_GREEN ANSI_ESCAPE_SEQUENCE("32m")
+
+ /** Sets the foreground (text) colour to yellow. */
+ #define ESC_FG_YELLOW ANSI_ESCAPE_SEQUENCE("33m")
+
+ /** Sets the foreground (text) colour to blue. */
+ #define ESC_FG_BLUE ANSI_ESCAPE_SEQUENCE("34m")
+
+ /** Sets the foreground (text) colour to magenta. */
+ #define ESC_FG_MAGENTA ANSI_ESCAPE_SEQUENCE("35m")
+
+ /** Sets the foreground (text) colour to cyan. */
+ #define ESC_FG_CYAN ANSI_ESCAPE_SEQUENCE("36m")
+
+ /** Sets the foreground (text) colour to white. */
+ #define ESC_FG_WHITE ANSI_ESCAPE_SEQUENCE("37m")
+
+ /** Sets the foreground (text) colour to the terminal's default. */
+ #define ESC_FG_DEFAULT ANSI_ESCAPE_SEQUENCE("39m")
+
+ /** Sets the text background colour to black. */
+ #define ESC_BG_BLACK ANSI_ESCAPE_SEQUENCE("40m")
+
+ /** Sets the text background colour to red. */
+ #define ESC_BG_RED ANSI_ESCAPE_SEQUENCE("41m")
+
+ /** Sets the text background colour to green. */
+ #define ESC_BG_GREEN ANSI_ESCAPE_SEQUENCE("42m")
+
+ /** Sets the text background colour to yellow. */
+ #define ESC_BG_YELLOW ANSI_ESCAPE_SEQUENCE("43m")
+
+ /** Sets the text background colour to blue. */
+ #define ESC_BG_BLUE ANSI_ESCAPE_SEQUENCE("44m")
+
+ /** Sets the text background colour to magenta. */
+ #define ESC_BG_MAGENTA ANSI_ESCAPE_SEQUENCE("45m")
+
+ /** Sets the text background colour to cyan. */
+ #define ESC_BG_CYAN ANSI_ESCAPE_SEQUENCE("46m")
+
+ /** Sets the text background colour to white. */
+ #define ESC_BG_WHITE ANSI_ESCAPE_SEQUENCE("47m")
+
+ /** Sets the text background colour to the terminal's default. */
+ #define ESC_BG_DEFAULT ANSI_ESCAPE_SEQUENCE("49m")
+
+ /** Sets the cursor position to the given line and column. */
+ #define ESC_CURSOR_POS(L, C) ANSI_ESCAPE_SEQUENCE(#L ";" #C "H")
+
+ /** Moves the cursor up the given number of lines. */
+ #define ESC_CURSOR_UP(L) ANSI_ESCAPE_SEQUENCE(#L "A")
+
+ /** Moves the cursor down the given number of lines. */
+ #define ESC_CURSOR_DOWN(L) ANSI_ESCAPE_SEQUENCE(#L "B")
+
+ /** Moves the cursor to the right the given number of columns. */
+ #define ESC_CURSOR_FORWARD(C) ANSI_ESCAPE_SEQUENCE(#C "C")
+
+ /** Moves the cursor to the left the given number of columns. */
+ #define ESC_CURSOR_BACKWARD(C) ANSI_ESCAPE_SEQUENCE(#C "D")
+
+ /** Saves the current cursor position so that it may be restored with ESC_CURSOR_POS_RESTORE. */
+ #define ESC_CURSOR_POS_SAVE ANSI_ESCAPE_SEQUENCE("s")
+
+ /** Restores the cursor position to the last position saved with ESC_CURSOR_POS_SAVE. */
+ #define ESC_CURSOR_POS_RESTORE ANSI_ESCAPE_SEQUENCE("u")
+
+ /** Erases the entire display, returning the cursor to the top left. */
+ #define ESC_ERASE_DISPLAY ANSI_ESCAPE_SEQUENCE("2J")
+
+ /** Erases the current line, returning the cursor to the far left. */
+ #define ESC_ERASE_LINE ANSI_ESCAPE_SEQUENCE("K")
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.c
new file mode 100644
index 00000000..5a40705c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.c
@@ -0,0 +1,135 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "ConfigDescriptor.h"
+
+uint8_t USB_Host_GetDeviceConfigDescriptor(uint16_t* const ConfigSizePtr, void* BufferPtr)
+{
+ uint8_t ErrorCode;
+
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_GetDescriptor,
+ wValue: (DTYPE_Configuration << 8),
+ wIndex: 0,
+ wLength: sizeof(USB_Descriptor_Configuration_Header_t),
+ };
+
+ if (BufferPtr == NULL)
+ {
+ uint8_t ConfigHeader[sizeof(USB_Descriptor_Configuration_Header_t)];
+
+ ErrorCode = USB_Host_SendControlRequest(ConfigHeader);
+
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
+ *ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).TotalConfigurationSize;
+ #else
+ *ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).wTotalLength;
+ #endif
+ }
+ else
+ {
+ USB_HostRequest.wLength = *ConfigSizePtr;
+
+ ErrorCode = USB_Host_SendControlRequest(BufferPtr);
+ }
+
+ return ErrorCode;
+}
+
+void USB_Host_GetNextDescriptorOfType(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type)
+{
+ while (*BytesRem)
+ {
+ USB_Host_GetNextDescriptor(BytesRem, CurrConfigLoc);
+
+ if (DESCRIPTOR_TYPE(*CurrConfigLoc) == Type)
+ return;
+ }
+}
+
+void USB_Host_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type,
+ const uint8_t BeforeType)
+{
+ while (*BytesRem)
+ {
+ USB_Host_GetNextDescriptor(BytesRem, CurrConfigLoc);
+
+ if (DESCRIPTOR_TYPE(*CurrConfigLoc) == Type)
+ {
+ return;
+ }
+ else if (DESCRIPTOR_TYPE(*CurrConfigLoc) == BeforeType)
+ {
+ *BytesRem = 0;
+ return;
+ }
+ }
+}
+
+void USB_Host_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type,
+ const uint8_t AfterType)
+{
+ USB_Host_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, AfterType);
+
+ if (*BytesRem)
+ USB_Host_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
+}
+
+uint8_t USB_Host_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
+ uint8_t (* const ComparatorRoutine)(void*))
+{
+ uint8_t ErrorCode;
+
+ while (*BytesRem)
+ {
+ uint8_t** PrevDescLoc = CurrConfigLoc;
+ uint16_t PrevBytesRem = *BytesRem;
+
+ USB_Host_GetNextDescriptor(BytesRem, CurrConfigLoc);
+
+ if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != Descriptor_Search_NotFound)
+ {
+ CurrConfigLoc = PrevDescLoc;
+ *BytesRem = PrevBytesRem;
+
+ return ErrorCode;
+ }
+ }
+
+ return Descriptor_Search_Comp_EndOfDescriptor;
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.h
new file mode 100644
index 00000000..d1f8927f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/ConfigDescriptor.h
@@ -0,0 +1,258 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Configuration descriptor parser API. This section of the library gives a friendly API which can be used in
+ * host applications to easily parse an attached device's configuration descriptor so that endpoint, interface
+ * and other descriptor data can be extracted and used as needed.
+ */
+
+#ifndef __CONFIGDESCRIPTOR_H__
+#define __CONFIGDESCRIPTOR_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+ #include "../LowLevel/HostChapter9.h"
+ #include "../HighLevel/StdDescriptors.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Casts a pointer to a descriptor inside the configuration descriptor into a pointer to the given
+ * descriptor type.
+ *
+ * Usage Example:
+ * \code
+ * uint8_t* CurrDescriptor = &ConfigDescriptor[0]; // Pointing to the configuration header
+ * USB_Descriptor_Configuration_Header_t* ConfigHeaderPtr = DESCRIPTOR_PCAST(CurrDescriptor,
+ * USB_Descriptor_Configuration_Header_t);
+ *
+ * // Can now access elements of the configuration header struct using the -> indirection operator
+ * \endcode
+ */
+ #define DESCRIPTOR_PCAST(DescriptorPtr, Type) ((Type*)DescriptorPtr)
+
+ /** Casts a pointer to a descriptor inside the configuration descriptor into the given descriptor
+ * type (as an actual struct instance rather than a pointer to a struct).
+ *
+ * Usage Example:
+ * \code
+ * uint8_t* CurrDescriptor = &ConfigDescriptor[0]; // Pointing to the configuration header
+ * USB_Descriptor_Configuration_Header_t ConfigHeader = DESCRIPTOR_CAST(CurrDescriptor,
+ * USB_Descriptor_Configuration_Header_t);
+ *
+ * // Can now access elements of the configuration header struct using the . operator
+ * \endcode
+ */
+ #define DESCRIPTOR_CAST(DescriptorPtr, Type) (*DESCRIPTOR_PCAST(DescriptorPtr, Type))
+
+ /** Returns the descriptor's type, expressed as the 8-bit type value in the header of the descriptor.
+ * This value's meaning depends on the descriptor's placement in the descriptor, but standard type
+ * values can be accessed in the DescriptorTypes_t enum located in USB/HighLevel/StdDescriptors.h.
+ */
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type
+ #else
+ #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bDescriptorType
+ #endif
+
+ /** Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes. */
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size
+ #else
+ #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength
+ #endif
+
+ /** Creates a prototype for or begins a descriptor comparitor routine. Descriptor comparitor routines are
+ * small search routines which are passed a pointer to the current sub descriptor in the configuration
+ * descriptor, and which analyse the sub descriptor to determine whether or not it matches the routine's
+ * search parameters. Comparitor routines provide a powerful way to scan through the config descriptor
+ * for certain descriptors matching unique criteria.
+ *
+ * Comparitor routines are passed in a single pointer named CurrentDescriptor, and should return a value
+ * of a member of the DSEARCH_Return_ErrorCodes_t enum.
+ */
+ #define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor)
+
+ /** Searches for the next descriptor in the given configuration descriptor using a premade comparator
+ * function. The routine updates the position and remaining configuration descriptor bytes values
+ * automatically. If a comparator routine fails a search, the descriptor pointer is retreated back
+ * so that the next descriptor search invocation will start from the descriptor which first caused the
+ * original search to fail. This behaviour allows for one comparator to be used immediately after another
+ * has failed, starting the second search from the descriptor which failed the first.
+ *
+ * \param DSize Pointer to an int storing the remaining bytes in the configuration descriptor
+ * \param DPos Pointer to the current position in the configuration descriptor
+ * \param DSearch Name of the comparitor search function to use on the configuration descriptor
+ *
+ * \return Value of one of the members of the DSEARCH_Comp_Return_ErrorCodes_t enum
+ *
+ * Usage Example:
+ * \code
+ * DESCRIPTOR_COMPARATOR(EndpointSearcher); // Comparator Prototype
+ *
+ * DESCRIPTOR_COMPARATOR(EndpointSearcher)
+ * {
+ * if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ * return Descriptor_Search_Found;
+ * else
+ * return Descriptor_Search_NotFound;
+ * }
+ *
+ * //...
+ * // After retrieving configuration descriptor:
+ * if (USB_Host_GetNextDescriptorComp(&BytesRemaining, &ConfigDescriptorData, EndpointSearcher) ==
+ * Descriptor_Search_Comp_Found)
+ * {
+ * // Do something with the endpoint descriptor
+ * }
+ * \endcode
+ */
+ #define USB_Host_GetNextDescriptorComp(DSize, DPos, DSearch) \
+ USB_Host_GetNextDescriptorComp_P(DSize, DPos, DCOMP_##DSearch)
+ /* Enums: */
+ /** Enum for return values of a descriptor comparator made with DESCRIPTOR_COMPARATOR. */
+ enum DSEARCH_Return_ErrorCodes_t
+ {
+ Descriptor_Search_Found = 0, /**< Current descriptor matches comparator criteria. */
+ Descriptor_Search_Fail = 1, /**< No further descriptor could possibly match criteria, fail the search. */
+ Descriptor_Search_NotFound = 2, /**< Current descriptor does not match comparator criteria. */
+ };
+
+ /** Enum for return values of USB_Host_GetNextDescriptorComp() */
+ enum DSEARCH_Comp_Return_ErrorCodes_t
+ {
+ Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to decriptor which matches
+ * search criteria of the given comparator function. */
+ Descriptor_Search_Comp_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */
+ Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */
+ };
+
+ /* Function Prototypes: */
+ /** Retrieves the configuration descriptor data or size from an attached device via a standard request.
+ *
+ * \param ConfigSizePtr Pointer to a uint16_t for either storing or retrieving the configuration
+ * descriptor size
+ *
+ * \param BufferPtr Pointer to the buffer for storing the configuration descriptor data. If this is
+ * NULL, the size of the configuration descriptor will be retrieved instead and
+ * placed in the variable pointed to by ConfigSizePtr. If this is non-NULL, the number
+ * of bytes indicated by ConfigSizePtr of the configuration descriptor will be loaded
+ * into the buffer
+ */
+ uint8_t USB_Host_GetDeviceConfigDescriptor(uint16_t* const ConfigSizePtr, void* BufferPtr)
+ ATTR_NON_NULL_PTR_ARG(1);
+
+ /* Inline Functions: */
+ /** Skips over the current sub-descriptor inside the configuration descriptor, so that the pointer then
+ points to the next sub-descriptor. The bytes remaining value is automatically decremented.
+ *
+ * \param BytesRem Pointer to the number of bytes remaining of the configuration descriptor
+ * \param CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor
+ */
+ static inline void USB_Host_GetNextDescriptor(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+ static inline void USB_Host_GetNextDescriptor(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc)
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
+ uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
+ #else
+ uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).bLength;
+ #endif
+
+ *CurrConfigLoc += CurrDescriptorSize;
+ *BytesRem -= CurrDescriptorSize;
+ }
+
+ /** Skips to the next sub-descriptor inside the configuration descriptor of the specified type value.
+ * The bytes remaining value is automatically decremented.
+ *
+ * \param BytesRem Pointer to the number of bytes remaining of the configuration descriptor
+ * \param CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor
+ * \param Type Descriptor type value to search for
+ */
+ void USB_Host_GetNextDescriptorOfType(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+
+ /** Skips to the next sub-descriptor inside the configuration descriptor of the specified type value,
+ * which must come before a descriptor of the second given type value. If the BeforeType type
+ * descriptor is reached first, the number of bytes remaining to process is set to zero and the
+ * function exits. The bytes remaining value is automatically decremented.
+ *
+ * \param BytesRem Pointer to the number of bytes remaining of the configuration descriptor
+ * \param CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor
+ * \param Type Descriptor type value to search for
+ * \param BeforeType Descriptor type value which must not be reached before the given Type descriptor
+ */
+ void USB_Host_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type,
+ const uint8_t BeforeType)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+
+ /** Skips to the next sub-descriptor inside the configuration descriptor of the specified type value,
+ * which must come after a descriptor of the second given type value. The bytes remaining value is
+ * automatically decremented.
+ *
+ * \param BytesRem Pointer to the number of bytes remaining of the configuration descriptor
+ * \param CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor
+ * \param Type Descriptor type value to search for
+ * \param AfterType Descriptor type value which must be reached before the given Type descriptor
+ */
+ void USB_Host_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
+ uint8_t** const CurrConfigLoc,
+ const uint8_t Type,
+ const uint8_t AfterType)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Function Prototypes: */
+ uint8_t USB_Host_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
+ uint8_t (* const ComparatorRoutine)(void* const));
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.c
new file mode 100644
index 00000000..35b280b5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.c
@@ -0,0 +1,326 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "HIDParser.h"
+
+uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
+{
+ HID_StateTable_t StateTable[HID_STATETABLE_STACK_DEPTH];
+ HID_StateTable_t* CurrStateTable = &StateTable[0];
+ uint16_t UsageStack[HID_USAGE_STACK_DEPTH];
+ uint8_t UsageStackSize = 0;
+ uint16_t BitOffsetIn = 0;
+ uint16_t BitOffsetOut = 0;
+#if defined(HID_ENABLE_FEATURE_PROCESSING)
+ uint16_t BitOffsetFeature = 0;
+#endif
+ HID_CollectionPath_t* CurrCollectionPath = NULL;
+
+ memset((void*)ParserData, 0x00, sizeof(HID_ReportInfo_t));
+ memset((void*)StateTable, 0x00, sizeof(StateTable));
+
+ while (ReportSize)
+ {
+ uint32_t ReportItemData = 0;
+
+ switch (*ReportData & DATA_SIZE_MASK)
+ {
+ case DATA_SIZE_4:
+ ReportItemData = *((uint32_t*)(ReportData + 1));
+ break;
+ case DATA_SIZE_2:
+ ReportItemData = *((uint16_t*)(ReportData + 1));
+ break;
+ case DATA_SIZE_1:
+ ReportItemData = *((uint8_t*)(ReportData + 1));
+ break;
+ }
+
+ switch (*ReportData & (TYPE_MASK | TAG_MASK))
+ {
+ case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
+ if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH])
+ return HID_PARSE_HIDStackOverflow;
+
+ memcpy((CurrStateTable - 1),
+ CurrStateTable,
+ sizeof(HID_ReportItem_t));
+
+ CurrStateTable++;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_POP):
+ if (CurrStateTable == &StateTable[0])
+ return HID_PARSE_HIDStackUnderflow;
+
+ CurrStateTable--;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
+ CurrStateTable->Attributes.Usage.Page = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN):
+ CurrStateTable->Attributes.Logical.Minimum = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX):
+ CurrStateTable->Attributes.Logical.Maximum = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN):
+ CurrStateTable->Attributes.Physical.Minimum = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX):
+ CurrStateTable->Attributes.Physical.Maximum = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP):
+ CurrStateTable->Attributes.Unit.Exponent = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
+ CurrStateTable->Attributes.Unit.Type = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
+ CurrStateTable->Attributes.BitSize = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
+ CurrStateTable->ReportCount = ReportItemData;
+ break;
+ case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
+ CurrStateTable->ReportID = ReportItemData;
+ break;
+ case (TYPE_LOCAL | TAG_LOCAL_USAGE):
+ if (UsageStackSize == HID_USAGE_STACK_DEPTH)
+ return HID_PARSE_UsageStackOverflow;
+
+ UsageStack[UsageStackSize++] = ReportItemData;
+ break;
+ case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
+ CurrStateTable->Attributes.Usage.MinMax.Minimum = ReportItemData;
+ break;
+ case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
+ CurrStateTable->Attributes.Usage.MinMax.Maximum = ReportItemData;
+ break;
+ case (TYPE_MAIN | TAG_MAIN_COLLECTION):
+ if (CurrCollectionPath == NULL)
+ {
+ CurrCollectionPath = &ParserData->CollectionPaths[0];
+ }
+ else
+ {
+ HID_CollectionPath_t* ParentCollectionPath = CurrCollectionPath;
+
+ CurrCollectionPath = &ParserData->CollectionPaths[1];
+
+ while (CurrCollectionPath->Parent != NULL);
+ {
+ if (CurrCollectionPath == &ParserData->CollectionPaths[HID_MAX_COLLECTIONS])
+ return HID_PARSE_InsufficientCollectionPaths;
+
+ CurrCollectionPath++;
+ }
+
+ CurrCollectionPath->Parent = ParentCollectionPath;
+ }
+
+ CurrCollectionPath->Type = ReportItemData;
+ CurrCollectionPath->Usage.Page = CurrStateTable->Attributes.Usage.Page;
+
+ if (UsageStackSize)
+ {
+ CurrCollectionPath->Usage.Usage = UsageStack[0];
+
+ for (uint8_t i = 0; i < UsageStackSize; i++)
+ UsageStack[i] = UsageStack[i + 1];
+
+ UsageStackSize--;
+ }
+ else
+ {
+ CurrCollectionPath->Usage.Usage = 0;
+ }
+
+ break;
+ case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
+ if (CurrCollectionPath == NULL)
+ return HID_PARSE_UnexpectedEndCollection;
+
+ CurrCollectionPath = CurrCollectionPath->Parent;
+
+ break;
+ case (TYPE_MAIN | TAG_MAIN_INPUT):
+ case (TYPE_MAIN | TAG_MAIN_OUTPUT):
+#if defined(HID_ENABLE_FEATURE_PROCESSING)
+ case (TYPE_MAIN | TAG_MAIN_FEATURE):
+#endif
+ for (uint8_t ReportItemNum = 0; ReportItemNum < CurrStateTable->ReportCount; ReportItemNum++)
+ {
+ HID_ReportItem_t* CurrReportItem = &ParserData->ReportItems[ParserData->TotalReportItems];
+
+ if (ParserData->TotalReportItems == HID_MAX_REPORTITEMS)
+ return HID_PARSE_InsufficientReportItems;
+
+ memcpy(&CurrReportItem->Attributes,
+ &CurrStateTable->Attributes,
+ sizeof(HID_ReportItem_Attributes_t));
+
+ CurrReportItem->ItemFlags = ReportItemData;
+ CurrReportItem->CollectionPath = CurrCollectionPath;
+ CurrReportItem->ReportID = CurrStateTable->ReportID;
+
+ if (UsageStackSize)
+ {
+ CurrReportItem->Attributes.Usage.Usage = UsageStack[0];
+
+ for (uint8_t i = 0; i < UsageStackSize; i++)
+ UsageStack[i] = UsageStack[i + 1];
+
+ UsageStackSize--;
+ }
+ else
+ {
+ CurrReportItem->Attributes.Usage.Usage = 0;
+ }
+
+ switch (*ReportData & TAG_MASK)
+ {
+ case TAG_MAIN_INPUT:
+ CurrReportItem->ItemType = REPORT_ITEM_TYPE_In;
+ CurrReportItem->BitOffset = BitOffsetIn;
+
+ BitOffsetIn += CurrStateTable->Attributes.BitSize;
+
+ break;
+ case TAG_MAIN_OUTPUT:
+ CurrReportItem->ItemType = REPORT_ITEM_TYPE_Out;
+ CurrReportItem->BitOffset = BitOffsetOut;
+
+ BitOffsetOut += CurrStateTable->Attributes.BitSize;
+
+ break;
+#if defined(HID_ENABLE_FEATURE_PROCESSING)
+ case TAG_MAIN_FEATURE:
+ CurrReportItem->ItemType = REPORT_ITEM_TYPE_Feature;
+ CurrReportItem->BitOffset = BitOffsetFeature;
+
+ BitOffsetFeature += CurrStateTable->Attributes.BitSize;
+
+ break;
+#endif
+ }
+
+#if !defined(HID_INCLUDE_CONSTANT_DATA_ITEMS)
+ if (!(ReportItemData & IOF_CONSTANT))
+ ParserData->TotalReportItems++;
+#else
+ ParserData->TotalReportItems++;
+#endif
+ }
+
+ UsageStackSize = 0;
+
+ break;
+ }
+
+ if ((*ReportData & TYPE_MASK) == TYPE_MAIN)
+ {
+ CurrStateTable->Attributes.Usage.MinMax.Minimum = 0;
+ CurrStateTable->Attributes.Usage.MinMax.Maximum = 0;
+ UsageStackSize = 0;
+ }
+
+ switch (*ReportData & DATA_SIZE_MASK)
+ {
+ case DATA_SIZE_4:
+ ReportSize -= 5;
+ ReportData += 5;
+ break;
+ case DATA_SIZE_2:
+ ReportSize -= 3;
+ ReportData += 3;
+ break;
+ case DATA_SIZE_1:
+ ReportSize -= 2;
+ ReportData += 2;
+ break;
+ case DATA_SIZE_0:
+ ReportSize -= 1;
+ ReportData += 1;
+ break;
+ }
+ }
+
+ return HID_PARSE_Successful;
+}
+
+bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
+{
+ uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
+ uint16_t CurrentBit = ReportItem->BitOffset;
+ uint32_t BitMask = (1 << 0);
+
+ ReportItem->Value = 0;
+
+ if (ReportItem->ReportID)
+ {
+ if (ReportItem->ReportID != ReportData[0])
+ return false;
+
+ ReportData++;
+ }
+
+ while (DataBitsRem--)
+ {
+ if (ReportData[CurrentBit / 8] & (1 << (CurrentBit % 8)))
+ ReportItem->Value |= BitMask;
+
+ CurrentBit++;
+ BitMask <<= 1;
+ }
+
+ return true;
+}
+
+void SetReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)
+{
+ uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
+ uint16_t CurrentBit = ReportItem->BitOffset;
+ uint32_t BitMask = (1 << 0);
+
+ if (ReportItem->ReportID)
+ {
+ ReportData[0] = ReportItem->ReportID;
+ ReportData++;
+ }
+
+ while (DataBitsRem--)
+ {
+ if (ReportItem->Value & (1 << (CurrentBit % 8)))
+ ReportData[CurrentBit / 8] |= BitMask;
+
+ CurrentBit++;
+ BitMask <<= 1;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.h
new file mode 100644
index 00000000..314d0807
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDParser.h
@@ -0,0 +1,252 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Human Interface Device (HID) Class report descriptor processing routines. This file allows for the easy
+ * parsing of the complex HID report descriptor, which describes the data that the device transmits to the host.
+ *
+ * The processed report is presented back to the user application as a flat structure containing each report
+ * item's IN, OUT and FEATURE (if desired) items along with each item's attributes.
+ *
+ * This library portion also allows for easy setting and retrieval of data from a HID report, including devices
+ * with multiple reports on the one HID interface.
+ *
+ * By default, FEATURE reports and IN/OUT reports with constant data are ignored in the HID report when processed
+ * to save on memory. This can be overridden by defining the HID_ENABLE_FEATURE_PROCESSING or
+ * HID_INCLUDE_CONSTANT_DATA_ITEMS tokens in the user project makefile, passing them to the compiler via the -D
+ * switch.
+ */
+
+#ifndef __HIDPARSER_H__
+#define __HIDPARSER_H__
+
+ /* Includes: */
+ #include <string.h>
+ #include <stdbool.h>
+
+ #include "HIDReportData.h"
+
+ #include "../../../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor checks and defines: */
+ #if !defined(HID_STATETABLE_STACK_DEPTH) || defined(__DOXYGEN__)
+ /** Constant indicating the maximum stack depth of the state table. A larger state table
+ * allows for more PUSH/POP report items to be nested, but consumes more memory. By default
+ * this is set to 3 levels (allowing for two PUSHes to be nested) but this can be overridden by
+ * defining HID_STATETABLE_STACK_DEPTH to another value in the user project makefile, passing the
+ * define to the compiler using the -D compiler switch.
+ */
+ #define HID_STATETABLE_STACK_DEPTH 3
+ #endif
+
+ #if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)
+ /** Constant indicating the maximum stack depth of the usage table. A larger usage table
+ * allows for more USAGE items to be indicated sequentially for REPORT COUNT entries of more than
+ * one, but requires more stack space. By default this is set to 8 levels (allowing for a report
+ * item with a count of 8) but this can be overridden by defining HID_USAGE_STACK_DEPTH to another
+ * value in the user project makefile, passing the define to the compiler using the -D compiler
+ * switch.
+ */
+ #define HID_USAGE_STACK_DEPTH 8
+ #endif
+
+ #if !defined(HID_MAX_COLLECTIONS) || defined(__DOXYGEN__)
+ /** Constant indicating the maximum number of COLLECTION items (nested or unnested) that can be
+ * processed in the report item descriptor. A large value allows for more COLLECTION items to be
+ * processed, but consumes more memory. By default this is set to 5 collections, but this can be
+ * overridden by defining HID_MAX_COLLECTIONS to another value in the user project makefile, passing
+ * the define to the compiler using the -D compiler switch.
+ */
+ #define HID_MAX_COLLECTIONS 5
+ #endif
+
+ #if !defined(HID_MAX_REPORTITEMS) || defined(__DOXYGEN__)
+ /** Constant indicating the maximum number of report items (IN, OUT or FEATURE if enabled) that can be
+ * processed in the report item descriptor. A large value allows for more report items to be
+ * processed, but consumes more memory. By default this is set to 30 items, but this can be
+ * overridden by defining HID_MAX_REPORTITEMS to another value in the user project makefile, passing
+ * the define to the compiler using the -D compiler switch.
+ */
+ #define HID_MAX_REPORTITEMS 30
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Enums: */
+ /** Enum for indicating what type of report item an entry in a HID_ReportInfo_t ReportItem array is */
+ enum HID_ReportItemTypes_t
+ {
+ REPORT_ITEM_TYPE_In = 0, /**< Indicates that the item is an IN report type. */
+ REPORT_ITEM_TYPE_Out = 1, /**< Indicates that the item is an OUT report type. */
+ REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */
+ };
+
+ /** Enum for the possible error codes in the return value of the ProcessHIDReport() function */
+ enum HID_Parse_ErrorCodes_t
+ {
+ HID_PARSE_Successful = 0, /**< Successful parse of the HID report descriptor, no error. */
+ HID_PARSE_HIDStackOverflow = 1, /**< More than HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */
+ HID_PARSE_HIDStackUnderflow = 2, /**< A POP was found when the state table stack was empty. */
+ HID_PARSE_InsufficientReportItems = 3, /**< More than HID_MAX_REPORTITEMS report items in the report. */
+ HID_PARSE_UnexpectedEndCollection = 4, /**< END COLLECTION found without matching COLLECTION item. */
+ HID_PARSE_InsufficientCollectionPaths = 5, /**< More than HID_MAX_COLLECTIONS collections in the report. */
+ HID_PARSE_UsageStackOverflow = 6, /**< More than HID_USAGE_STACK_DEPTH usages listed in a row. */
+ };
+
+ /* Type Defines: */
+ /** Type define for an attribute with both minimum and maximum values (e.g. Logical Min/Max). */
+ typedef struct
+ {
+ uint32_t Minimum; /**< Minimum value for the attribute. */
+ uint32_t Maximum; /**< Maximum value for the attribute. */
+ } HID_MinMax_t;
+
+ /** Type define for the Unit attributes of a report item. */
+ typedef struct
+ {
+ uint32_t Type; /**< Unit type (refer to HID specifications for details). */
+ uint8_t Exponent; /**< Unit exponent (refer to HID specifications for details). */
+ } HID_Unit_t;
+
+ /** Type define for the Usage attributes of a report item. */
+ typedef struct
+ {
+ uint16_t Page; /**< Usage page of the report item. */
+ uint16_t Usage; /**< Usage of the report item. */
+ HID_MinMax_t MinMax; /**< Usage minimum and maximum of the report item. */
+ } HID_Usage_t;
+
+ /** Type define for a COLLECTION object. Contains the collection attributes and a reference to the
+ * parent collection if any.
+ */
+ typedef struct CollectionPath
+ {
+ uint8_t Type; /**< Collection type (for example "Generic Desktop"). */
+ HID_Usage_t Usage; /**< Collection usage. */
+ struct CollectionPath* Parent; /**< Reference to parent collection, or NULL if root collection. */
+ } HID_CollectionPath_t;
+
+ /** Type define for all the data attributes of a report item, except flags. */
+ typedef struct
+ {
+ uint8_t BitSize; /**< Size in bits of the report item's data. */
+
+ HID_Usage_t Usage; /**< Usage of the report item. */
+ HID_Unit_t Unit; /**< Unit type and exponent of the report item. */
+ HID_MinMax_t Logical; /**< Logical minimum and maximum of the report item. */
+ HID_MinMax_t Physical; /**< Physical minimum and maximum of the report item. */
+ } HID_ReportItem_Attributes_t;
+
+ /** Type define for a report item (IN, OUT or FEATURE) attributes and other details. */
+ typedef struct
+ {
+ uint16_t BitOffset; /**< Bit offset in the IN, OUT or FEATURE report of the item. */
+ uint8_t ItemType; /**< Report item type, a value in HID_Types_t. */
+ uint16_t ItemFlags; /**< Item data flags, such as constant/variable, etc. */
+ uint8_t ReportID; /**< Report ID this item belongs to, or 0x00 if device has only one report */
+ HID_CollectionPath_t* CollectionPath; /**< Collection path of the item. */
+
+ HID_ReportItem_Attributes_t Attributes; /**< Report item attributes. */
+
+ uint32_t Value; /**< Current value of the report item. */
+ } HID_ReportItem_t;
+
+ /** Type define for a complete processed HID report, including all report item data and collections. */
+ typedef struct
+ {
+ uint8_t TotalReportItems; /**< Total number of report items stored in the
+ * ReportItems array. */
+
+ HID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS]; /**< Report items array, including
+ * all IN, OUT and FEATURE items. */
+
+ HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]; /**< All collection items, referenced
+ * by the report items. */
+ } HID_ReportInfo_t;
+
+ /* Function Prototypes: */
+ /** Function to process a given HID report returned from an attached device, and store it into a given
+ * HID_ReportInfo_t structure.
+ *
+ * \param ReportData Buffer containing the device's HID report table
+ * \param ReportSize Size in bytes of the HID report table
+ * \param ParserData Pointer to a HID_ReportInfo_t instance for the parser output
+ *
+ * \return A value in the HID_Parse_ErrorCodes_t enum
+ */
+ uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
+ ATTR_NON_NULL_PTR_ARG(1, 3);
+
+ /** Extracts the given report item's value out of the given HID report and places it into the Value
+ * member of the report item's HID_ReportItem_t structure.
+ *
+ * \param ReportData Buffer containing an IN or FEATURE report from an attached device
+ * \param ReportItem Pointer to the report item of interest in a HID_ReportInfo_t ReportItem array
+ *
+ * \returns Boolean true if the item to retrieve was located in the given report, false otherwise
+ */
+ bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+
+ /** Retreives the given report item's value out of the Value member of the report item's
+ * HID_ReportItem_t structure and places it into the correct position in the HID report
+ * buffer. The report buffer is assumed to have the appropriate bits cleared before calling
+ * this function (i.e., the buffer should be explicitly cleared before report values are added).
+ *
+ * If the device has multiple HID reports, the report ID is set to the report ID of the given item.
+ *
+ * \param ReportData Buffer holding the current OUT report data
+ * \param ReportItem Pointer to the report item of interest in a HID_ReportInfo_t ReportItem array
+ */
+ void SetReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)
+ ATTR_NON_NULL_PTR_ARG(1, 2);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Type Defines: */
+ typedef struct
+ {
+ HID_ReportItem_Attributes_t Attributes;
+ uint8_t ReportCount;
+ uint8_t ReportID;
+ } HID_StateTable_t;
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDReportData.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDReportData.h
new file mode 100644
index 00000000..1bb8676d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/Class/HIDReportData.h
@@ -0,0 +1,128 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Constants for HID report item attributes. Refer to the HID specification for details on each
+ * flag's meaning when applied to an IN, OUT or FEATURE item.
+ */
+
+#ifndef __HIDREPORTDATA_H__
+#define __HIDREPORTDATA_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** HID_ReportItem_t.ItemFlags flag for constant data. */
+ #define IOF_CONSTANT (1 << 0)
+
+ /** HID_ReportItem_t.ItemFlags flag for data. */
+ #define IOF_DATA (0 << 0)
+
+ /** HID_ReportItem_t.ItemFlags flag for variable data. */
+ #define IOF_VARIABLE (1 << 1)
+
+ /** HID_ReportItem_t.ItemFlags flag for array data. */
+ #define IOF_ARRAY (0 << 1)
+
+ /** HID_ReportItem_t.ItemFlags flag for relative data. */
+ #define IOF_RELATIVE (1 << 2)
+
+ /** HID_ReportItem_t.ItemFlags flag for absolute data. */
+ #define IOF_ABSOLUTE (0 << 2)
+
+ /** HID_ReportItem_t.ItemFlags flag for wrapped value data. */
+ #define IOF_WRAP (1 << 3)
+
+ /** HID_ReportItem_t.ItemFlags flag for non-wrapped value data. */
+ #define IOF_NOWRAP (0 << 3)
+
+ /** HID_ReportItem_t.ItemFlags flag for non linear data. */
+ #define IOF_NONLINEAR (1 << 4)
+
+ /** HID_ReportItem_t.ItemFlags flag for linear data. */
+ #define IOF_LINEAR (0 << 4)
+
+ /** HID_ReportItem_t.ItemFlags flag for no preferred state. */
+ #define IOF_NOPREFERRED (1 << 5)
+
+ /** HID_ReportItem_t.ItemFlags flag for preferred state items. */
+ #define IOF_PREFERREDSTATE (0 << 5)
+
+ /** HID_ReportItem_t.ItemFlags flag for null state items. */
+ #define IOF_NULLSTATE (1 << 6)
+
+ /** HID_ReportItem_t.ItemFlags flag for no null position data. */
+ #define IOF_NONULLPOSITION (0 << 6)
+
+ /** HID_ReportItem_t.ItemFlags flag for buffered bytes. */
+ #define IOF_BUFFEREDBYTES (1 << 8)
+
+ /** HID_ReportItem_t.ItemFlags flag for bitfield data. */
+ #define IOF_BITFIELD (0 << 8)
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define DATA_SIZE_MASK 0b00000011
+ #define TYPE_MASK 0b00001100
+ #define TAG_MASK 0b11110000
+
+ #define DATA_SIZE_0 0b00000000
+ #define DATA_SIZE_1 0b00000001
+ #define DATA_SIZE_2 0b00000010
+ #define DATA_SIZE_4 0b00000011
+
+ #define TYPE_MAIN 0b00000000
+ #define TYPE_GLOBAL 0b00000100
+ #define TYPE_LOCAL 0b00001000
+
+ #define TAG_MAIN_INPUT 0b10000000
+ #define TAG_MAIN_OUTPUT 0b10010000
+ #define TAG_MAIN_COLLECTION 0b10100000
+ #define TAG_MAIN_FEATURE 0b10110000
+ #define TAG_MAIN_ENDCOLLECTION 0b11000000
+ #define TAG_GLOBAL_USAGEPAGE 0b00000000
+ #define TAG_GLOBAL_LOGICALMIN 0b00010000
+ #define TAG_GLOBAL_LOGICALMAX 0b00100000
+ #define TAG_GLOBAL_PHYSMIN 0b00110000
+ #define TAG_GLOBAL_PHYSMAX 0b01000000
+ #define TAG_GLOBAL_UNITEXP 0b01010000
+ #define TAG_GLOBAL_UNIT 0b01100000
+ #define TAG_GLOBAL_REPORTSIZE 0b01110000
+ #define TAG_GLOBAL_REPORTID 0b10000000
+ #define TAG_GLOBAL_REPORTCOUNT 0b10010000
+ #define TAG_GLOBAL_PUSH 0b10100000
+ #define TAG_GLOBAL_POP 0b10110000
+ #define TAG_LOCAL_USAGE 0b00000000
+ #define TAG_LOCAL_USAGEMIN 0b00010000
+ #define TAG_LOCAL_USAGEMAX 0b00100000
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.c
new file mode 100644
index 00000000..dbc428aa
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.c
@@ -0,0 +1,39 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "../LowLevel/USBMode.h"
+
+#define INCLUDE_FROM_EVENTS_C
+#include "Events.h"
+
+void USB_Event_Stub(void)
+{
+
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.h
new file mode 100644
index 00000000..eeb0ed37
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/Events.h
@@ -0,0 +1,440 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** Library events module. This module contains macros and functions relating to the management of library
+ * events, which are small pieces of code similar to ISRs which are run when a given condition is met. Each
+ * event can be fired from multiple places in the user or library code, which may or may not be inside an ISR,
+ * thus each handler should be written to be as small and fast as possible to prevent possible problems.
+ *
+ * Events can be hooked by the user application using the EVENT_HANDLER() and HANDLES_EVENT() macros. If an
+ * event with no associated handler is fired within the library, it by default fires an internal empty stub
+ * function. This is achieved through the use of the GCC compiler's "alias" attribute.
+ *
+ * Each event must only have one associated event handler, but can be raised by multiple sources.
+ */
+
+#ifndef __USBEVENTS_H__
+#define __USBEVENTS_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include "../../../Common/Common.h"
+ #include "../LowLevel/USBMode.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Raises a given event name, with the specified parameters. For events with no parameters the
+ * only argument to the macro is the event name, events with parameters list the parameter values
+ * after the name as a comma seperated list.
+ *
+ * When a given event is fired, its corresponding event handler code is executed.
+ *
+ * Usage Examples:
+ * \code
+ * // Raise the USB_VBUSChange event, which takes no parameters
+ * RAISE_EVENT(USB_VBUSChange);
+ *
+ * // Raise the USB_UnhandledControlPacket event which takes two parameters
+ * RAISE_EVENT(USB_UnhandledControlPacket, 0, 1);
+ * \endcode
+ *
+ * \see RAISES_EVENT()
+ */
+ #define RAISE_EVENT(e, ...) Event_ ## e (__VA_ARGS__)
+
+ /** Indicates that a given module can raise a given event. This is the equivelent of putting the
+ * event function's prototype into the module, but in a cleaner way. Each event which may be
+ * fired via the RAISE_EVENT macro in the module should have an accompanying RAISES_EVENT
+ * prototype in the module's header file.
+ *
+ * Usage Examples:
+ * \code
+ * // Module can raise the USB_VBUSChange event
+ * RAISES_EVENT(USB_VBUSChange);
+ *
+ * // ...
+ * // Inside a block of code in a function of the module, raise the USB_VBUSChange event
+ * RAISE_EVENT(USB_VBUSChange);
+ * \endcode
+ *
+ * \see RAISE_EVENT()
+ */
+ #define RAISES_EVENT(e) HANDLES_EVENT(e)
+
+ /** Defines an event handler for the given event. Event handlers should be short in length, as they
+ * may be raised from inside an ISR. The user application can react to each event as it sees fit,
+ * such as logging the event, indicating the change to the user or performing some other action.
+ *
+ * Only one event handler may be defined in any user project for each individual event. Events may
+ * or may not have parameters - for each event, refer to its documentation elsewhere in this module
+ * to determine the presense and purpose of any event parameters.
+ *
+ * Usage Example:
+ * \code
+ * // Create an event handler for the USB_VBUSChange event
+ * EVENT_HANDLER(USB_VBUSChange)
+ * {
+ * // Code to execute when the VBUS level changes
+ * }
+ * \endcode
+ *
+ * \see HANDLES_EVENT()
+ */
+ #define EVENT_HANDLER(e) void Event_ ## e e ## _P
+
+ /** Indicates that a given module handles an event. This is the equivelent of putting the
+ * event function's prototype into the module, but in a cleaner way. Each event which may be
+ * handled via the EVENT_HANDLER macro in the module should have an accompanying HANDLES_EVENT
+ * prototype in the module's header file.
+ *
+ * Usage Examples:
+ * \code
+ * // Module handles the USB_VBUSChange event
+ * HANDLES_EVENT(USB_VBUSChange);
+ *
+ * // Create the USB_VBUSChange event handler
+ * EVENT_HANDLER(USB_VBUSChange)
+ * {
+ * // Event handler code here
+ * }
+ * \endcode
+ *
+ * \see EVENT_HANDLER()
+ */
+ #define HANDLES_EVENT(e) EVENT_HANDLER(e)
+
+ /* Psudo-Functions for Doxygen: */
+ #if defined(__DOXYGEN__)
+ /** Event for VBUS level change. This event fires when the VBUS line of the USB AVR changes from
+ * high to low or vice-versa.
+ *
+ * \note This event is only available on USB AVR models which support VBUS notification interrupts.
+ */
+ void USB_VBUSChange(void);
+
+ /** Event for VBUS attachment. This event fires when the VBUS line of the USB AVR changes from
+ * low to high, signalling the attachment of the USB device to a host, before the enumeration
+ * process has begun.
+ *
+ * \note This event is only available on USB AVR models which support VBUS notification interrupts.
+ */
+ void USB_VBUSConnect(void);
+
+ /** Event for VBUS detachment. This event fires when the VBUS line of the USB AVR changes from
+ * high to low, signalling the USB device has been removed from a host whether it has been enumerated
+ * or not.
+ *
+ * \note This event is only available on USB AVR models which support VBUS notification interrupts.
+ */
+ void USB_VBUSDisconnect(void);
+
+ /** Event for USB device connection. This event fires when the AVR is in USB host mode and a device
+ * has been attached (but not yet fully enumerated), or when in device mode and the device is connected
+ * to a host, beginning the enumeration process.
+ *
+ * When in device mode, this can be used to progmatically start the USB management task to reduce
+ * CPU usage.
+ *
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection
+ * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually.
+ *
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.
+ */
+ void USB_Connect(void);
+
+ /** Event for USB device disconnection. This event fires when the AVR is in USB host mode and an
+ * attached and enumerated device has been disconnected, or when in device mode and the device is
+ * disconnected from the host.
+ *
+ * When in device mode, this can be used to progmatically stop the USB management task to reduce
+ * CPU usage.
+ *
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection
+ * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually.
+ *
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.
+ */
+ void USB_Disconnect(void);
+
+ /** Event for USB device power on failure. This event fires when the USB interface fails to
+ * initialize correctly due to a hardware or software fault.
+ *
+ * \param ErrorCode Error code indicating the failure reason, a value in USB_PowerOnErrorCodes_t
+ * located in LowLevel.h.
+ */
+ void USB_PowerOnFail(const uint8_t ErrorCode);
+
+ /** Event for USB mode pin level change. This event fires when the USB interface is set to dual role
+ * mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires
+ * before the mode is switched to the newly indicated mode.
+ *
+ * \note This event only exists on USB AVR models which support dual role modes.
+ *
+ * \note This event does not exist if the USB_DEVICE_ONLY or USB_HOST_ONLY tokens have been supplied
+ * to the compiler (see LowLevel.h documentation).
+ */
+ void USB_UIDChange(void);
+
+ /** Event for USB host error. This event fires when a hardware fault has occurred whilst the USB
+ * interface is in host mode.
+ *
+ * \param ErrorCode Error code indicating the failure reason, a value in USB_Host_ErrorCodes_t
+ * located in Host.h.
+ *
+ * \note This event only exists on USB AVR models which supports host mode.
+ *
+ * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ */
+ void USB_HostError(const uint8_t ErrorCode);
+
+ /** Event for USB device attachment. This event fires when a the USB interface is in host mode, and
+ * a USB device has been connected to the USB interface. This is interrupt driven, thus fires before
+ * the standard USB_DeviceConnect event and so can be used to programatically start the USB management
+ * task to reduce CPU consumption.
+ *
+ * \note This event only exists on USB AVR models which supports host mode.
+ *
+ * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ *
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.
+ */
+ void USB_DeviceAttached(void);
+
+ /** Event for USB device removal. This event fires when a the USB interface is in host mode, and
+ * a USB device has been removed the USB interface whether or not it has been enumerated. This
+ * can be used to programatically stop the USB management task to reduce CPU consumption.
+ *
+ * \note This event only exists on USB AVR models which supports host mode.
+ *
+ * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ *
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.
+ */
+ void USB_DeviceUnattached(void);
+
+ /** Event for USB device enumeration failure. This event fires when a the USB interface is
+ * in host mode, and an attached USB device has failed to enumerate completely.
+ *
+ * \param ErrorCode Error code indicating the failure reason, a value in
+ * USB_Host_EnumerationErrorCodes_t located in Host.h.
+ *
+ * \param SubErrorCode Sub error code indicating the reason for failure - for example, if the
+ * ErrorCode parameter indicates a control error, this will give the error
+ * code returned by the USB_Host_SendControlRequest() function.
+ *
+ * \note This event only exists on USB AVR models which supports host mode.
+ *
+ * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ */
+ void USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
+
+ /** Event for USB device enumeration completion. This event fires when a the USB interface is
+ * in host mode and an attached USB device has been completely enumerated and is ready to be
+ * controlled by the user application, or when the library is in device mode, and the Host
+ * has finished enumerating the device.
+ */
+ void USB_DeviceEnumerationComplete(void);
+
+ /** Event for unhandled control requests. This event fires when a the USB host issues a control
+ * request to the control endpoint (address 0) that the library does not handle. This may either
+ * be a standard request that the library has no handler code for, or a class specific request
+ * issued to the device which must be handled appropriately. Due to the strict timing requirements
+ * on control transfers, interrupts are disabled during control request processing.
+ *
+ * \param bRequest Request value, indicating what command the host has issued.
+ * \param bmRequestType Mask indicating the request data direction (if any), type and recipient.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ *
+ * \note Requests should be handled in the same manner as described in the USB 2.0 Specification,
+ * or appropriate class' specification. In all instances, the library has already read the
+ * request bmRequestType and bRequest values out (into the Request and RequestType parameters
+ * respectively) so that it can correctly determine if it is able to handle the request
+ * internally, or hand off the request to the user application via this event. Other request
+ * parameters (wValue, wIndex, wLength, and Data) remain in the control endpoint bank until
+ * read out by the user application for processing.
+ */
+ void USB_UnhandledControlPacket(const uint8_t bRequest, const uint8_t bmRequestType);
+
+ /** Event for USB configuration number changed. This event fires when a the USB host changes the
+ * selected configuration number while in device mode. This event should be hooked in device
+ * applications to create the endpoints and configure the device for the selected configuration.
+ *
+ * This event fires after the value of USB_ConfigurationNumber has been changed.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ */
+ void USB_ConfigurationChanged(void);
+
+ /** Event for USB suspend. This event fires when a the USB host suspends the device by halting its
+ * transmission of Start Of Frame pulses to the device. This is generally hooked in order to move
+ * the device over to a low power state until the host wakes up the device.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ *
+ * \see USB_WakeUp() event for accompanying Wake Up event.
+ */
+ void USB_Suspend(void);
+
+ /** Event for USB wake up. This event fires when a the USB interface is suspended while in device
+ * mode, and the host wakes up the device by supplying Start Of Frame pulses. This is generally
+ * hooked to pull the user application out of a lowe power state and back into normal operating
+ * mode.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ *
+ * \see USB_Suspend() event for accompanying Suspend event.
+ */
+ void USB_WakeUp(void);
+
+ /** Event for USB interface reset. This event fires when a the USB interface is in device mode, and
+ * a the USB host requests that the device reset its interface. This is generally hooked so that
+ * the USB control endpoint can be switched to interrupt driven mode, by selecting it and calling
+ * USB_INT_Enable(ENDPOINT_INT_SETUP). Before this event fires, all device endpoints are reset and
+ * disabled.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ */
+ void USB_Reset(void);
+
+ /** Event for USB device mode error. This event fires when the USB interface is in device mode,
+ * and an error occurs which prevents it from operating normally.
+ *
+ * \param ErrorCode Error code indicating the source of the error. One of the values in the
+ * USB_Device_ErrorCodes_t enum located in Device.h.
+ *
+ * \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see
+ * LowLevel.h documentation).
+ */
+ void USB_DeviceError(const uint8_t ErrorCode);
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define ALIAS_STUB(e) EVENT_HANDLER(e) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ #define USB_VBUSChange_P (void)
+ #define USB_VBUSConnect_P (void)
+ #define USB_VBUSDisconnect_P (void)
+ #endif
+
+ #define USB_Connect_P (void)
+ #define USB_Disconnect_P (void)
+ #define USB_DeviceEnumerationComplete_P (void)
+
+ #if defined(USB_CAN_BE_BOTH)
+ #define USB_PowerOnFail_P (const uint8_t ErrorCode)
+ #define USB_UIDChange_P (void)
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ #define USB_HostError_P (const uint8_t ErrorCode)
+ #define USB_DeviceAttached_P (void)
+ #define USB_DeviceUnattached_P (void)
+ #define USB_DeviceEnumerationFailed_P (const uint8_t ErrorCode, const uint8_t SubErrorCode)
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ #define USB_UnhandledControlPacket_P (const uint8_t bRequest, const uint8_t bmRequestType)
+ #define USB_ConfigurationChanged_P (void)
+ #define USB_Suspend_P (void)
+ #define USB_WakeUp_P (void)
+ #define USB_Reset_P (void)
+ #define USB_DeviceError_P (const uint8_t ErrorCode)
+ #endif
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_EVENTS_C)
+ void USB_Event_Stub (void) ATTR_CONST;
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ ALIAS_STUB(USB_VBUSChange);
+ ALIAS_STUB(USB_VBUSConnect);
+ ALIAS_STUB(USB_VBUSDisconnect);
+ #endif
+
+ ALIAS_STUB(USB_Connect);
+ ALIAS_STUB(USB_Disconnect);
+ ALIAS_STUB(USB_DeviceEnumerationComplete);
+
+ #if defined(USB_CAN_BE_BOTH)
+ ALIAS_STUB(USB_PowerOnFail);
+ ALIAS_STUB(USB_UIDChange);
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ ALIAS_STUB(USB_HostError);
+ ALIAS_STUB(USB_DeviceAttached);
+ ALIAS_STUB(USB_DeviceUnattached);
+ ALIAS_STUB(USB_DeviceEnumerationFailed);
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ ALIAS_STUB(USB_UnhandledControlPacket);
+ ALIAS_STUB(USB_ConfigurationChanged);
+ ALIAS_STUB(USB_Suspend);
+ ALIAS_STUB(USB_WakeUp);
+ ALIAS_STUB(USB_Reset);
+ ALIAS_STUB(USB_DeviceError);
+ #endif
+ #endif
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.c
new file mode 100644
index 00000000..5fdc72e8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.c
@@ -0,0 +1,43 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "../LowLevel/USBMode.h"
+#if defined(USB_CAN_BE_DEVICE)
+
+#include "StdDescriptors.h"
+
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ RAISE_EVENT(USB_DeviceError, DEVICE_ERROR_GetDescriptorNotHooked);
+
+ return 0;
+};
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
new file mode 100644
index 00000000..d9075cc7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
@@ -0,0 +1,523 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
+ * strucutures and macros for the easy creation of standard USB descriptors in USB device projects.
+ *
+ * All standard descriptors have their elements named in an identical manner to the official USB specification,
+ * however slightly more verbose alternate (non-standard) names are also supplied if the macro
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES is defined in the user project makefile and passed to the compiler at
+ * compilation time using the -D option.
+ *
+ * The non-standard names are documented here - if USE_NONSTANDARD_DESCRIPTOR_NAMES is not defined, then all
+ * descriptors will contain elements named identically to the official USB specification. The alternately
+ * named descriptor elements are placed in the same order inside the descriptor structures as their officially
+ * named counterparts, thus they can be correlated easily with the official USB specification.
+ */
+
+#ifndef __USBDESCRIPTORS_H__
+#define __USBDESCRIPTORS_H__
+
+ /* Includes: */
+ #include <avr/pgmspace.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+ #include "../LowLevel/USBMode.h"
+ #include "Events.h"
+
+ #if defined(USB_CAN_BE_DEVICE)
+ #include "../LowLevel/Device.h"
+ #endif
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors
+ * for string descriptor indexes, or may be use as a return value for GetDescriptor when the specified
+ * descriptor does not exist.
+ */
+ #define NO_DESCRIPTOR 0
+
+ /** Macro to calculate the power value for the device descriptor, from a given number of milliamps. */
+ #define USB_CONFIG_POWER_MA(x) (x >> 1)
+
+ /** Macro to calculate the Unicode length of a string with a given number of Unicode characters.
+ * Should be used in string descriptor's headers for giving the string descriptor's byte length.
+ */
+ #define USB_STRING_LEN(x) (sizeof(USB_Descriptor_Header_t) + (x << 1))
+
+ /** Macro to encode a given four digit floating point version number (e.g. 01.23) into Binary Coded
+ * Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the
+ * standard device descriptor.
+ */
+ #define VERSION_BCD(x) ((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | \
+ ((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x)))
+
+ /** String language ID for the English language. Should be used in USB_Descriptor_Language_t descriptors
+ * to indicate that the English language is supported by the device in its string descriptors.
+ */
+ #define LANGUAGE_ID_ENG 0x0409
+
+ /** Can be masked with an endpoint address for a USB_Descriptor_Endpoint_t endpoint descriptor's
+ * EndpointAddress value to indicate to the host that the endpoint is of the IN direction (i.e, from
+ * device to host).
+ */
+ #define ENDPOINT_DESCRIPTOR_DIR_IN 0x80
+
+ /** Can be masked with an endpoint address for a USB_Descriptor_Endpoint_t endpoint descriptor's
+ * EndpointAddress value to indicate to the host that the endpoint is of the OUT direction (i.e, from
+ * host to device).
+ */
+ #define ENDPOINT_DESCRIPTOR_DIR_OUT 0x00
+
+ /** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
+ * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
+ * from the host's VBUS line.
+ */
+ #define USB_CONFIG_ATTR_BUSPOWERED 0b10000000
+
+ /** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
+ * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
+ * from the device's own power source.
+ */
+ #define USB_CONFIG_ATTR_SELFPOWERED 0b11000000
+
+ /** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
+ * descriptor's ConfigAttributes value to indicate that the specified configuration supports the
+ * remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon
+ * request.
+ */
+ #define USB_CONFIG_ATTR_REMOTEWAKEUP 0b10100000
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is not synchronized.
+ *
+ * \see The USB specification for more details on the possible Endpoint attributes.
+ */
+ #define ENDPOINT_ATTR_NO_SYNC (0b00 << 2)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is asynchronous.
+ *
+ * \see The USB specification for more details on the possible Endpoint attributes.
+ */
+ #define ENDPOINT_ATTR_ASYNC (0b01 << 2)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is adaptive.
+ *
+ * \see The USB specification for more details on the possible Endpoint attributes.
+ */
+ #define ENDPOINT_ATTR_ADAPTIVE (0b10 << 2)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is synchronized.
+ *
+ * \see The USB specification for more details on the possible Endpoint attributes.
+ */
+ #define ENDPOINT_ATTR_SYNC (0b11 << 2)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is used for data transfers.
+ *
+ * \see The USB specification for more details on the possible Endpoint usage attributes.
+ */
+ #define ENDPOINT_USAGE_DATA (0b00 << 4)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is used for feedback.
+ *
+ * \see The USB specification for more details on the possible Endpoint usage attributes.
+ */
+ #define ENDPOINT_USAGE_FEEDBACK (0b01 << 4)
+
+ /** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
+ * Attributes value to indicate that the specified endpoint is used for implicit feedback.
+ *
+ * \see The USB specification for more details on the possible Endpoint usage attributes.
+ */
+ #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (0b10 << 4)
+
+ /** Gives a void pointer to the specified descriptor (of any type). */
+ #define DESCRIPTOR_ADDRESS(Descriptor) ((void*)&Descriptor)
+
+ /* Events: */
+ #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
+ /** This module raises the Device Error event while in device mode, if the USB_GetDescriptor()
+ * routine is not hooked in the user application to properly return descriptors to the library.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceError);
+ #endif
+
+ /* Enums: */
+ /** Enum for the possible standard descriptor types, as given in each descriptor's header. */
+ enum USB_DescriptorTypes_t
+ {
+ DTYPE_Device = 0x01, /**< Indicates that the descriptor is a device descriptor. */
+ DTYPE_Configuration = 0x02, /**< Indicates that the descriptor is a configuration descriptor. */
+ DTYPE_String = 0x03, /**< Indicates that the descriptor is a string descriptor. */
+ DTYPE_Interface = 0x04, /**< Indicates that the descriptor is an interface descriptor. */
+ DTYPE_Endpoint = 0x05, /**< Indicates that the descriptor is an endpoint descriptor. */
+ DTYPE_DeviceQualifier = 0x06, /**< Indicates that the descriptor is a device qualifier descriptor. */
+ DTYPE_Other = 0x07, /**< Indicates that the descriptor is of other type. */
+ DTYPE_InterfacePower = 0x08, /**< Indicates that the descriptor is an interface power descriptor. */
+ DTYPE_InterfaceAssociation = 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */
+ };
+
+ /* Type Defines: */
+ /** Type define for all descriptor's header, indicating the descriptor's length and type.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ uint8_t Size; /**< Size of the descriptor, in bytes. */
+ uint8_t Type; /**< Type of the descriptor, either a value in DescriptorTypes_t or a value
+ * given by the specific class.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ #endif
+ } USB_Descriptor_Header_t;
+
+ /** Type define for a standard device descriptor.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ uint16_t USBSpecification; /**< BCD of the supported USB specification. */
+ uint8_t Class; /**< USB device class. */
+ uint8_t SubClass; /**< USB device subclass. */
+ uint8_t Protocol; /**< USB device protocol. */
+
+ uint8_t Endpoint0Size; /**< Size of the control (address 0) endpoint's bank in bytes. */
+
+ uint16_t VendorID; /**< Vendor ID for the USB product. */
+ uint16_t ProductID; /**< Unique product ID for the USB product. */
+ uint16_t ReleaseNumber; /**< Product release (version) number. */
+
+ uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The
+ * host will request this string via a seperate
+ * control request for the string descriptor.
+ *
+ * \note If no string supplied, use NO_DESCRIPTOR.
+ */
+ uint8_t ProductStrIndex; /**< String index for the product name/details.
+ *
+ * \see ManufacturerStrIndex structure entry.
+ */
+ uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal
+ * serial number, in uppercase Unicoded ASCII.
+ *
+ * \see ManufacturerStrIndex structure entry.
+ */
+
+ uint8_t NumberOfConfigurations; /**< Total number of configurations supported by
+ * the device.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint16_t bcdUSB;
+ uint8_t bDeviceClass;
+ uint8_t bDeviceSubClass;
+ uint8_t bDeviceProtocol;
+ uint8_t bMaxPacketSize0;
+ uint16_t idVendor;
+ uint16_t idProduct;
+ uint16_t bcdDevice;
+ uint8_t iManufacturer;
+ uint8_t iProduct;
+ uint8_t iSerialNumber;
+ uint8_t bNumConfigurations;
+ #endif
+ } USB_Descriptor_Device_t;
+
+ /** Type define for a standard configuration descriptor.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header,
+ * and all sub descriptors inside the configuration.
+ */
+ uint8_t TotalInterfaces; /**< Total number of interfaces in the configuration. */
+
+ uint8_t ConfigurationNumber; /**< Configuration index of the current configuration. */
+ uint8_t ConfigurationStrIndex; /**< Index of a string descriptor describing the configuration. */
+
+ uint8_t ConfigAttributes; /**< Configuration attributes, comprised of a mask of zero or
+ * more USB_CONFIG_ATTR_* masks.
+ */
+
+ uint8_t MaxPowerConsumption; /**< Maximum power consumption of the device while in the
+ * current configuration, calculated by the USB_CONFIG_POWER_MA()
+ * macro.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint16_t wTotalLength;
+ uint8_t bNumInterfaces;
+ uint8_t bConfigurationValue;
+ uint8_t iConfiguration;
+ uint8_t bmAttributes;
+ uint8_t bMaxPower;
+ #endif
+ } USB_Descriptor_Configuration_Header_t;
+
+ /** Type define for a standard interface descriptor.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ uint8_t InterfaceNumber; /**< Index of the interface in the current configuration. */
+ uint8_t AlternateSetting; /**< Alternate setting for the interface number. The same
+ * interface number can have multiple alternate settings
+ * with different endpoint configurations, which can be
+ * selected by the host.
+ */
+ uint8_t TotalEndpoints; /**< Total number of endpoints in the interface. */
+
+ uint8_t Class; /**< Interface class ID. */
+ uint8_t SubClass; /**< Interface subclass ID. */
+ uint8_t Protocol; /**< Interface protocol ID. */
+
+ uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the
+ * interface.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bInterfaceNumber;
+ uint8_t bAlternateSetting;
+ uint8_t bNumEndpoints;
+ uint8_t bInterfaceClass;
+ uint8_t bInterfaceSubClass;
+ uint8_t bInterfaceProtocol;
+ uint8_t iInterface;
+ #endif
+ } USB_Descriptor_Interface_t;
+
+ /** Type define for a standard interface association descriptor.
+ *
+ * This descriptor has been added as a suppliment to the USB2.0 standard, in the ECN located at
+ * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
+ * devices with multiple interfaces related to the same function to have the multiple interfaces bound
+ * together at the point of enumeration, loading one generic driver for all the interfaces in the single
+ * function. Read the ECN for more information.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */
+ uint8_t TotalInterfaces; /** Total number of associated interfaces. */
+
+ uint8_t Class; /**< Interface class ID. */
+ uint8_t SubClass; /**< Interface subclass ID. */
+ uint8_t Protocol; /**< Interface protocol ID. */
+
+ uint8_t IADStrIndex; /**< Index of the string descriptor describing the
+ * interface association.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bFirstInterface;
+ uint8_t bInterfaceCount;
+ uint8_t bFunctionClass;
+ uint8_t bFunctionSubClass;
+ uint8_t bFunctionProtocol;
+ uint8_t iFunction;
+ #endif
+ } USB_Descriptor_Interface_Association_t;
+
+ /** Type define for a standard endpoint descriptor.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ uint8_t EndpointAddress; /**< Logical address of the endpoint within the device
+ * for the current configuration, including direction
+ * mask.
+ */
+ uint8_t Attributes; /**< Endpoint attributes, comprised of a mask of the
+ * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
+ * masks.
+ */
+ uint16_t EndpointSize; /**< Size of the endpoint bank, in bytes. This indicates the
+ * maximum packet size that the endpoint can receive at a time.
+ */
+
+ uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpont
+ * if it is an INTERRUPT or ISOCHRONOUS type.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bEndpointAddress;
+ uint8_t bmAttributes;
+ uint16_t wMaxPacketSize;
+ uint8_t bInterval;
+ #endif
+ } USB_Descriptor_Endpoint_t;
+
+ /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
+ * of the descriptor for placement in the descriptor header must be determined by the USB_STRING_LEN()
+ * macro rather than by the size of the descriptor structure, as the length is not fixed.
+ *
+ * This structure should also be used for string index 0, which contains the supported language IDs for
+ * the device as an array.
+ *
+ * \note The non-standard structure element names are documented here - see the StdDescriptors.h file
+ * documentation for more information on the two descriptor naming schemes. If the
+ * USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements with names
+ * identical to those listed in the USB standard.
+ */
+ typedef struct
+ {
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
+ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
+
+ int16_t UnicodeString[]; /**< String data, as unicode characters (alternatively,
+ * string language IDs). If normal ASCII characters are
+ * to be used, they must be added as an array of characters
+ * rather than a normal C string so that they are widened to
+ * Unicode size.
+ *
+ * Under GCC, strings prefixed with the "L" character (before
+ * the opening string quotation mark) are considered to be
+ * Unicode strings, and may be used instead of an explicit
+ * array of ASCII characters.
+ */
+ #else
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ int16_t bString[];
+ #endif
+ } USB_Descriptor_String_t;
+
+ typedef struct
+ {
+ uint16_t Size;
+ void* Address;
+ } USB_Descriptor_Details_t;
+
+ /* Function Prototypes: */
+ /** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
+ * index and language ID. This function MUST be overridden in the user application (added with full, identical
+ * prototype and name except for the ATTR_WEAK attribute) so that the library can call it to retrieve descriptor
+ * data.
+ *
+ * \param wValue The type of the descriptor to retrieve in the upper byte, and the index in the
+ * lower byte (when more than one descriptor of the given type exists, such as the
+ * case of string descriptors). The type may be one of the standard types defined
+ * in the DescriptorTypes_t enum, or may be a class-specific descriptor type value.
+ * \param wIndex The language ID of the string to return if the wValue type indicates DTYPE_String,
+ * otherwise zero for standard descriptors, or as defined in a class-specific
+ * standards.
+ * \param DescriptorAddress Pointer to the descriptor in memory. This should be set by the routine to
+ * the location of the descriptor, found by the DESCRIPTOR_ADDRESS macro.
+ *
+ * \note By default, the library expects all descriptors to be located in flash memory via the PROGMEM attribute.
+ * If descriptors should be located in RAM or EEPROM instead (to speed up access in the case of RAM, or to
+ * allow the descriptors to be changed dynamically at runtime) either the USE_SRAM_DESCRIPTORS or the
+ * USE_EEPROM_DESCRIPTORS tokens may be defined in the project makefile and passed to the compiler by the -D
+ * switch.
+ *
+ * \return Size in bytes of the descriptor if it exists, zero or NO_DESCRIPTOR otherwise
+ */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_WEAK ATTR_NON_NULL_PTR_ARG(3);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define VERSION_TENS(x) (int)(x / 10)
+ #define VERSION_ONES(x) (int)(x - (10 * VERSION_TENS(x)))
+ #define VERSION_TENTHS(x) (int)((x - (int)x) * 10)
+ #define VERSION_HUNDREDTHS(x) (int)(((x - (int)x) * 100) - (10 * VERSION_TENTHS(x)))
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
new file mode 100644
index 00000000..58faa69d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.c
@@ -0,0 +1,252 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "../LowLevel/USBMode.h"
+#include "USBInterrupt.h"
+
+void USB_INT_DisableAllInterrupts(void)
+{
+ #if defined(USB_FULL_CONTROLLER)
+ USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
+ #elif defined(USB_MODIFIED_FULL_CONTROLLER)
+ USBCON &= ~(1 << VBUSTE);
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ UHIEN = 0;
+ OTGIEN = 0;
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ UDIEN = 0;
+ #endif
+}
+
+void USB_INT_ClearAllInterrupts(void)
+{
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ USBINT = 0;
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ UHINT = 0;
+ OTGINT = 0;
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ UDINT = 0;
+ #endif
+}
+
+ISR(USB_GEN_vect, ISR_BLOCK)
+{
+ #if defined(USB_CAN_BE_DEVICE)
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ if (USB_INT_HasOccurred(USB_INT_VBUS) && USB_INT_IsEnabled(USB_INT_VBUS))
+ {
+ USB_INT_Clear(USB_INT_VBUS);
+
+ RAISE_EVENT(USB_VBUSChange);
+
+ if (USB_VBUS_GetStatus())
+ {
+ RAISE_EVENT(USB_VBUSConnect);
+
+ if (USB_IsConnected)
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_ResetInterface();
+
+ USB_IsConnected = true;
+
+ RAISE_EVENT(USB_Connect);
+ }
+ else
+ {
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_Detach();
+ USB_CLK_Freeze();
+ USB_PLL_Off();
+ USB_REG_Off();
+
+ USB_IsConnected = false;
+
+ RAISE_EVENT(USB_VBUSDisconnect);
+
+ USB_INT_Clear(USB_INT_VBUS);
+ }
+ }
+ #endif
+
+ if (USB_INT_HasOccurred(USB_INT_SUSPEND) && USB_INT_IsEnabled(USB_INT_SUSPEND))
+ {
+ USB_INT_Clear(USB_INT_SUSPEND);
+
+ USB_INT_Disable(USB_INT_SUSPEND);
+ USB_INT_Enable(USB_INT_WAKEUP);
+
+ USB_CLK_Freeze();
+
+ if (!(USB_Options & USB_OPT_MANUAL_PLL))
+ USB_PLL_Off();
+
+ USB_IsSuspended = true;
+
+ RAISE_EVENT(USB_Suspend);
+
+ #if defined(USB_LIMITED_CONTROLLER) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
+ if (USB_IsConnected)
+ {
+ USB_IsConnected = false;
+ RAISE_EVENT(USB_Disconnect);
+ }
+ #endif
+ }
+
+ if (USB_INT_HasOccurred(USB_INT_WAKEUP) && USB_INT_IsEnabled(USB_INT_WAKEUP))
+ {
+ if (!(USB_Options & USB_OPT_MANUAL_PLL))
+ {
+ USB_PLL_On();
+ while (!(USB_PLL_IsReady()));
+ }
+
+ USB_CLK_Unfreeze();
+
+ USB_INT_Clear(USB_INT_WAKEUP);
+
+ USB_INT_Disable(USB_INT_WAKEUP);
+ USB_INT_Enable(USB_INT_SUSPEND);
+
+ #if defined(USB_LIMITED_CONTROLLER) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
+ if (!(USB_IsConnected))
+ {
+ USB_IsConnected = true;
+ RAISE_EVENT(USB_Connect);
+ }
+ #endif
+
+ USB_IsSuspended = false;
+
+ RAISE_EVENT(USB_WakeUp);
+ }
+
+ if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
+ {
+ USB_INT_Clear(USB_INT_EORSTI);
+
+ USB_ConfigurationNumber = 0;
+
+ USB_INT_Clear(USB_INT_SUSPEND);
+ USB_INT_Disable(USB_INT_SUSPEND);
+ USB_INT_Enable(USB_INT_WAKEUP);
+
+ Endpoint_ClearEndpoints();
+
+ Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
+ ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
+ ENDPOINT_BANK_SINGLE);
+
+ RAISE_EVENT(USB_Reset);
+ }
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ if (USB_INT_HasOccurred(USB_INT_DDISCI) && USB_INT_IsEnabled(USB_INT_DDISCI))
+ {
+ USB_INT_Clear(USB_INT_DDISCI);
+ USB_INT_Clear(USB_INT_DCONNI);
+ USB_INT_Disable(USB_INT_DDISCI);
+
+ RAISE_EVENT(USB_DeviceUnattached);
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_ResetInterface();
+ }
+
+ if (USB_INT_HasOccurred(USB_INT_VBERRI) && USB_INT_IsEnabled(USB_INT_VBERRI))
+ {
+ USB_INT_Clear(USB_INT_VBERRI);
+
+ USB_Host_VBUS_Manual_Off();
+ USB_Host_VBUS_Auto_Off();
+
+ RAISE_EVENT(USB_HostError, HOST_ERROR_VBusVoltageDip);
+ RAISE_EVENT(USB_DeviceUnattached);
+
+ USB_HostState = HOST_STATE_Unattached;
+ }
+
+ if (USB_INT_HasOccurred(USB_INT_SRPI) && USB_INT_IsEnabled(USB_INT_SRPI))
+ {
+ USB_INT_Clear(USB_INT_SRPI);
+ USB_INT_Disable(USB_INT_SRPI);
+
+ RAISE_EVENT(USB_DeviceAttached);
+
+ USB_INT_Enable(USB_INT_DDISCI);
+
+ USB_HostState = HOST_STATE_Attached;
+ }
+
+ if (USB_INT_HasOccurred(USB_INT_BCERRI) && USB_INT_IsEnabled(USB_INT_BCERRI))
+ {
+ USB_INT_Clear(USB_INT_BCERRI);
+
+ RAISE_EVENT(USB_DeviceEnumerationFailed, HOST_ENUMERROR_NoDeviceDetected, 0);
+ RAISE_EVENT(USB_DeviceUnattached);
+
+ if (USB_IsConnected)
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_ResetInterface();
+ }
+ #endif
+
+ #if defined(USB_CAN_BE_BOTH)
+ if (USB_INT_HasOccurred(USB_INT_IDTI) && USB_INT_IsEnabled(USB_INT_IDTI))
+ {
+ USB_INT_Clear(USB_INT_IDTI);
+
+ if (USB_IsConnected)
+ {
+ if (USB_CurrentMode == USB_MODE_HOST)
+ RAISE_EVENT(USB_DeviceUnattached);
+ else
+ RAISE_EVENT(USB_Disconnect);
+ }
+
+ RAISE_EVENT(USB_UIDChange);
+
+ USB_ResetInterface();
+ }
+ #endif
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.h
new file mode 100644
index 00000000..8438a589
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBInterrupt.h
@@ -0,0 +1,224 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main USB interrupt vector handler. This file manages the main USB interrupt vector, for handling such
+ * events as VBUS interrupts (on supported USB AVR models), device connections and disconnections, etc.
+ */
+
+#ifndef __USBINTERRUPT_H__
+#define __USBINTERRUPT_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+ #include "../LowLevel/LowLevel.h"
+ #include "../LowLevel/USBMode.h"
+ #include "Events.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Vector name for the common endpoint and pipe vector. This can be used to write an ISR handler
+ * for the endpoint and pipe events, to make certain USB functions interrupt rather than poll
+ * driven.
+ */
+ #define ENDPOINT_PIPE_vect USB_COM_vect
+
+ /** Enables the given USB interrupt vector (such as the ENDPOINT_INT_* and PIPE_INT_* vectors in
+ * Endpoint.h and Pipe.h).
+ */
+ #define USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE
+
+ /** Disables the given USB interrupt vector.
+ *
+ * \see USB_INT_Enable()
+ */
+ #define USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE
+
+ /** Resets the given USB interrupt flag, so that the interrupt is re-primed for the next firing. */
+ #define USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE
+
+ /** Returns boolean false if the given USB interrupt is disabled, or true if the interrupt is currently
+ * enabled.
+ */
+ #define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)
+
+ /** Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred,
+ * but the interrupt vector is not neccesarily enabled), otherwise returns false.
+ */
+ #define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false)
+
+ /* Throwable Events: */
+ /** This module raises the USB Connected interrupt when the AVR is attached to a host while in device
+ * USB mode.
+ *
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection
+ * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually.
+ */
+ RAISES_EVENT(USB_Connect);
+
+ /** This module raises the USB Disconnected interrupt when the AVR is removed from a host while in
+ * device USB mode.
+ *
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection
+ * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually.
+ */
+ RAISES_EVENT(USB_Disconnect);
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** This module raises the VBUS Change event when the current VBUS status (present or not present) has
+ * changed.
+ *
+ * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_VBUSChange);
+
+ /** This module raises the VBUS Connect event when the VBUS line is powered.
+ *
+ * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_VBUSConnect);
+
+ /** This module raises the VBUS Disconnect event when power is removed from the VBUS line.
+ *
+ * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_VBUSDisconnect);
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
+ /** This module raises the Suspended event when the host suspends the USB interface of the AVR
+ * whilst running in device mode.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_Suspend);
+
+ /** This module raises the Wake Up event when the host resumes the USB interface of the AVR
+ * whilst running in device mode.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_WakeUp);
+
+ /** This module raises the USB Reset event when the host resets the USB interface of the AVR
+ * whilst running in device mode.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_Reset);
+ #endif
+
+ #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
+ /** This module raises the Host Error event when the VBUS line voltage dips below the minimum threshold
+ * while running in host mode.
+ *
+ * \note Not all USB AVR models support host mode; this event only exists on supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_HostError);
+
+ /** This module raises the Device Unattached event when an attached device is removed from the AVR whilst
+ * running in host mode.
+ *
+ * \note Not all USB AVR models support host mode; this event only exists on supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceUnattached);
+ #endif
+
+ #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
+ /** This module raises the UID Change event when the UID line changes in value on dual-role devices.
+ *
+ * \note Not all USB AVR models support host mode and thus the UID pin; this event only exists on
+ * supported AVRs.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_UIDChange);
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define USB_INT_GET_EN_REG(a, b, c, d) a
+ #define USB_INT_GET_EN_MASK(a, b, c, d) b
+ #define USB_INT_GET_INT_REG(a, b, c, d) c
+ #define USB_INT_GET_INT_MASK(a, b, c, d) d
+
+ #define USB_INT_VBUS USBCON, (1 << VBUSTE) , USBINT, (1 << VBUSTI)
+ #define USB_INT_IDTI USBCON, (1 << IDTE) , USBINT, (1 << IDTI)
+ #define USB_INT_WAKEUP UDIEN , (1 << WAKEUPE), UDINT , (1 << WAKEUPI)
+ #define USB_INT_SUSPEND UDIEN , (1 << SUSPE) , UDINT , (1 << SUSPI)
+ #define USB_INT_EORSTI UDIEN , (1 << EORSTE) , UDINT , (1 << EORSTI)
+ #define USB_INT_DCONNI UHIEN , (1 << DCONNE) , UHINT , (1 << DCONNI)
+ #define USB_INT_DDISCI UHIEN , (1 << DDISCE) , UHINT , (1 << DDISCI)
+ #define USB_INT_BCERRI OTGIEN, (1 << BCERRE) , OTGINT, (1 << BCERRI)
+ #define USB_INT_VBERRI OTGIEN, (1 << VBERRE) , OTGINT, (1 << VBERRI)
+ #define USB_INT_SOFI UDIEN, (1 << SOFE) , UDINT , (1 << SOFI)
+ #define USB_INT_HSOFI UHIEN, (1 << HSOFE) , UHINT , (1 << HSOFI)
+ #define USB_INT_RSTI UHIEN , (1 << RSTE) , UHINT , (1 << RSTI)
+ #define USB_INT_SRPI OTGIEN, (1 << SRPE) , OTGINT, (1 << SRPI)
+
+ /* Function Prototypes: */
+ void USB_INT_ClearAllInterrupts(void);
+ void USB_INT_DisableAllInterrupts(void);
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.c
new file mode 100644
index 00000000..32b4db32
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.c
@@ -0,0 +1,257 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "../LowLevel/USBMode.h"
+
+#define INCLUDE_FROM_USBTASK_C
+#include "USBTask.h"
+
+volatile bool USB_IsSuspended;
+volatile bool USB_IsConnected;
+volatile bool USB_IsInitialized;
+
+#if defined(USB_CAN_BE_HOST)
+volatile uint8_t USB_HostState;
+#endif
+
+TASK(USB_USBTask)
+{
+ #if defined(USB_HOST_ONLY)
+ USB_HostTask();
+ #elif defined(USB_DEVICE_ONLY)
+ USB_DeviceTask();
+ #else
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ USB_DeviceTask();
+ else if (USB_CurrentMode == USB_MODE_HOST)
+ USB_HostTask();
+ #endif
+}
+
+#if defined(USB_CAN_BE_DEVICE)
+static void USB_DeviceTask(void)
+{
+ if (USB_IsConnected)
+ {
+ uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
+
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+
+ if (Endpoint_IsSetupReceived())
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ USB_Device_ProcessControlPacket();
+ }
+ }
+
+ Endpoint_SelectEndpoint(PrevEndpoint);
+ }
+}
+#endif
+
+#if defined(USB_CAN_BE_HOST)
+static void USB_HostTask(void)
+{
+ uint8_t ErrorCode = HOST_ENUMERROR_NoError;
+ uint8_t SubErrorCode = HOST_ENUMERROR_NoError;
+
+ static uint16_t WaitMSRemaining;
+ static uint8_t PostWaitState;
+
+ switch (USB_HostState)
+ {
+ case HOST_STATE_WaitForDevice:
+ if (WaitMSRemaining)
+ {
+ if ((SubErrorCode = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
+ {
+ USB_HostState = PostWaitState;
+ ErrorCode = HOST_ENUMERROR_WaitStage;
+ break;
+ }
+
+ WaitMSRemaining--;
+ }
+ else
+ {
+ USB_HostState = PostWaitState;
+ }
+
+ break;
+ case HOST_STATE_Attached:
+ WaitMSRemaining = HOST_DEVICE_SETTLE_DELAY_MS;
+
+ USB_HostState = HOST_STATE_Attached_WaitForDeviceSettle;
+ break;
+ case HOST_STATE_Attached_WaitForDeviceSettle:
+ _delay_ms(1);
+
+ if (!(WaitMSRemaining--))
+ {
+ USB_Host_VBUS_Manual_Off();
+
+ USB_OTGPAD_On();
+ USB_Host_VBUS_Auto_Enable();
+ USB_Host_VBUS_Auto_On();
+
+ USB_HostState = HOST_STATE_Attached_WaitForConnect;
+ }
+
+ break;
+ case HOST_STATE_Attached_WaitForConnect:
+ if (USB_INT_HasOccurred(USB_INT_DCONNI))
+ {
+ USB_INT_Clear(USB_INT_DCONNI);
+ USB_INT_Clear(USB_INT_DDISCI);
+
+ USB_INT_Clear(USB_INT_VBERRI);
+ USB_INT_Enable(USB_INT_VBERRI);
+
+ USB_IsConnected = true;
+ RAISE_EVENT(USB_Connect);
+
+ USB_Host_ResumeBus();
+ Pipe_ClearPipes();
+
+ HOST_TASK_NONBLOCK_WAIT(100, HOST_STATE_Attached_DoReset);
+ }
+
+ break;
+ case HOST_STATE_Attached_DoReset:
+ USB_Host_ResetDevice();
+
+ HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered);
+ break;
+ case HOST_STATE_Powered:
+ Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
+ PIPE_TOKEN_SETUP, PIPE_CONTROLPIPE,
+ PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE);
+
+ if (!(Pipe_IsConfigured()))
+ {
+ ErrorCode = HOST_ENUMERROR_PipeConfigError;
+ SubErrorCode = 0;
+ break;
+ }
+
+ USB_HostState = HOST_STATE_Default;
+ break;
+ case HOST_STATE_Default:
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_GetDescriptor,
+ wValue: (DTYPE_Device << 8),
+ wIndex: 0,
+ wLength: PIPE_CONTROLPIPE_DEFAULT_SIZE,
+ };
+
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
+ uint8_t* DataBuffer = alloca(offsetof(USB_Descriptor_Device_t, Endpoint0Size) + 1);
+ #else
+ uint8_t* DataBuffer = alloca(offsetof(USB_Descriptor_Device_t, bMaxPacketSize0) + 1);
+ #endif
+
+ if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful)
+ {
+ ErrorCode = HOST_ENUMERROR_ControlError;
+ break;
+ }
+
+ #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
+ USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, Endpoint0Size)];
+ #else
+ USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, bMaxPacketSize0)];
+ #endif
+
+ USB_Host_ResetDevice();
+
+ HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset);
+ break;
+ case HOST_STATE_Default_PostReset:
+ Pipe_DisablePipe();
+ Pipe_DeallocateMemory();
+ Pipe_ResetPipe(PIPE_CONTROLPIPE);
+
+ Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
+ PIPE_TOKEN_SETUP, PIPE_CONTROLPIPE,
+ USB_ControlPipeSize, PIPE_BANK_SINGLE);
+
+ if (!(Pipe_IsConfigured()))
+ {
+ ErrorCode = HOST_ENUMERROR_PipeConfigError;
+ SubErrorCode = 0;
+ break;
+ }
+
+ Pipe_SetInfiniteINRequests();
+
+ USB_HostRequest = (USB_Host_Request_Header_t)
+ {
+ bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ bRequest: REQ_SetAddress,
+ wValue: USB_HOST_DEVICEADDRESS,
+ wIndex: 0,
+ wLength: 0,
+ };
+
+ if ((SubErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ {
+ ErrorCode = HOST_ENUMERROR_ControlError;
+ break;
+ }
+
+ HOST_TASK_NONBLOCK_WAIT(100, HOST_STATE_Default_PostAddressSet);
+ break;
+ case HOST_STATE_Default_PostAddressSet:
+ USB_Host_SetDeviceAddress(USB_HOST_DEVICEADDRESS);
+
+ RAISE_EVENT(USB_DeviceEnumerationComplete);
+ USB_HostState = HOST_STATE_Addressed;
+
+ break;
+ }
+
+ if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))
+ {
+ RAISE_EVENT(USB_DeviceEnumerationFailed, ErrorCode, SubErrorCode);
+
+ USB_Host_VBUS_Auto_Off();
+
+ RAISE_EVENT(USB_DeviceUnattached);
+
+ if (USB_IsConnected)
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_ResetInterface();
+ }
+}
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.h
new file mode 100644
index 00000000..1fcc2bbb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/HighLevel/USBTask.h
@@ -0,0 +1,198 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main library USB management task for both Host and Device mode operations. This contains the master
+ * USB_USBTask task which should be periodically run to service both host and device USB projects.
+ */
+
+#ifndef __USBTASK_H__
+#define __USBTASK_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/interrupt.h>
+ #include <util/atomic.h>
+ #include <stdbool.h>
+ #include <stddef.h>
+
+ #include "../../../Scheduler/Scheduler.h"
+ #include "../LowLevel/LowLevel.h"
+ #include "../LowLevel/HostChapter9.h"
+ #include "../LowLevel/USBMode.h"
+ #include "Events.h"
+ #include "StdDescriptors.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Global Variables: */
+ /** Indicates if the USB interface is currently connected to a host if in device mode, or to a
+ * device while running in host mode.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ *
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection
+ * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually.
+ */
+ extern volatile bool USB_IsConnected;
+
+ /** Indicates if the USB interface is currently initialized but not neccesarily connected to a host
+ * or device (i.e. if USB_Init() has been run). If this is false, all other library globals are invalid.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern volatile bool USB_IsInitialized;
+
+ #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
+ /** Indicates if the USB interface is currently suspended by the host when in device mode. When suspended,
+ * the device should consume minimal power, and cannot communicate to the host. If Remote Wakeup is
+ * supported by the device and USB_RemoteWakeupEnabled is true, suspension can be terminated by the device
+ * by issuing a Remote Wakup request.
+ *
+ * \note This global is only present if the user application can be a USB device.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern volatile bool USB_IsSuspended;
+ #endif
+
+ #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
+ /** Indicates the current host state machine state. When in host mode, this indicates the state
+ * via one of the values of the USB_Host_States_t enum values in Host.h.
+ *
+ * This value may be altered by the user application to implement the HOST_STATE_Addressed,
+ * HOST_STATE_Configured, HOST_STATE_Ready and HOST_STATE_Suspended states which are not implemented
+ * by the library.
+ *
+ * \note This global is only present if the user application can be a USB host.
+ */
+ extern volatile uint8_t USB_HostState;
+ #endif
+
+ /* Throwable Events: */
+ #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
+ /** This module raises the USB Connect event when a USB device has been connected whilst in host
+ * mode, but not yet enumerated.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_Connect);
+
+ /** This module raises the USB Device Attached event when in host mode, and a device is attached
+ * to the AVR's USB interface.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceAttached);
+
+ /** This module raises the USB Device Unattached event when in host mode, and a device is removed
+ * from the AVR's USB interface.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceUnattached);
+
+ /** This module raises the USB Device Enumeration Failed event when in host mode, and an
+ * attached USB device has failed to successfully enumerated.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceEnumerationFailed);
+
+ /** This module raises the USB Device Enumeration Complete event when in host mode, and an
+ * attached USB device has been successfully enumerated and ready to be used by the user
+ * application.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceEnumerationComplete);
+
+ /** This module raises the USB Disconnect event when an attached USB device is removed from the USB
+ * bus.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_Disconnect);
+ #endif
+
+ /* Tasks: */
+ /** This is the main USB management task. The USB driver requires that this task be executed
+ * continuously when the USB system is active (device attached in host mode, or attached to a host
+ * in device mode) in order to manage USB communications. This task may be executed inside an RTOS,
+ * scheduler (e.g. the simple LUFA Scheduler), fast timer ISR or the main user application loop.
+ *
+ * The USB task must be serviced within 50mS in all modes, when needed. The task may be serviced
+ * at all times, or (for minimum CPU consumption):
+ *
+ * - In device mode, it may be disabled at startup, enabled on the firing of the USB_Connect event
+ * and disabled again on the firing of the USB_Disconnect event.
+ *
+ * - In host mode, it may be disabled at startup, enabled on the firing of the USB_DeviceAttached
+ * event and disabled again on the firing of the USB_DeviceUnattached event.
+ *
+ * \see Events.h for more information on the USB events.
+ */
+ TASK(USB_USBTask);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_USBTASK_C)
+ #if defined(USB_CAN_BE_HOST)
+ static void USB_HostTask(void);
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ static void USB_DeviceTask(void);
+ #endif
+ #endif
+
+ /* Macros: */
+ #define HOST_TASK_NONBLOCK_WAIT(duration, nextstate) {USB_HostState = HOST_STATE_WaitForDevice; WaitMSRemaining = duration; PostWaitState = nextstate; }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.c
new file mode 100644
index 00000000..9ea3f417
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.c
@@ -0,0 +1,313 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBMode.h"
+#if defined(USB_CAN_BE_DEVICE)
+
+#define INCLUDE_FROM_DEVCHAPTER9_C
+#include "DevChapter9.h"
+
+uint8_t USB_ConfigurationNumber;
+bool USB_RemoteWakeupEnabled;
+bool USB_CurrentlySelfPowered;
+
+void USB_Device_ProcessControlPacket(void)
+{
+ uint8_t bmRequestType = Endpoint_Read_Byte();
+ uint8_t bRequest = Endpoint_Read_Byte();
+ bool RequestHandled = false;
+
+ switch (bRequest)
+ {
+ case REQ_GetStatus:
+ if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) ||
+ (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT)))
+ {
+ USB_Device_GetStatus(bmRequestType);
+ RequestHandled = true;
+ }
+
+ break;
+#if !defined(NO_CLEARSET_FEATURE_REQUEST)
+ case REQ_ClearFeature:
+ case REQ_SetFeature:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT))
+ {
+ USB_Device_ClearSetFeature(bRequest, bmRequestType);
+ RequestHandled = true;
+ }
+
+ break;
+#endif
+ case REQ_SetAddress:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
+ {
+ USB_Device_SetAddress();
+ RequestHandled = true;
+ }
+
+ break;
+ case REQ_GetDescriptor:
+ if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) ||
+ (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE)))
+ {
+ USB_Device_GetDescriptor();
+ RequestHandled = true;
+ }
+
+ break;
+ case REQ_GetConfiguration:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
+ {
+ USB_Device_GetConfiguration();
+ RequestHandled = true;
+ }
+
+ break;
+ case REQ_SetConfiguration:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
+ {
+ USB_Device_SetConfiguration();
+ RequestHandled = true;
+ }
+
+ break;
+ }
+
+ if (!(RequestHandled))
+ RAISE_EVENT(USB_UnhandledControlPacket, bRequest, bmRequestType);
+
+ if (Endpoint_IsSetupReceived())
+ {
+ Endpoint_StallTransaction();
+ Endpoint_ClearSetupReceived();
+ }
+}
+
+static void USB_Device_SetAddress(void)
+{
+ uint8_t wValue_LSB = Endpoint_Read_Byte();
+
+ Endpoint_ClearSetupReceived();
+
+ while (!(Endpoint_IsSetupINReady()));
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupINReady()));
+
+ UDADDR = ((1 << ADDEN) | (wValue_LSB & 0x7F));
+
+ return;
+}
+
+static void USB_Device_SetConfiguration(void)
+{
+ uint8_t wValue_LSB = Endpoint_Read_Byte();
+ bool AlreadyConfigured = (USB_ConfigurationNumber != 0);
+
+#if defined(USE_SINGLE_DEVICE_CONFIGURATION)
+ if (wValue_LSB > 1)
+#else
+ USB_Descriptor_Device_t* DevDescriptorPtr;
+
+ if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr) == NO_DESCRIPTOR) ||
+ #if defined(USE_RAM_DESCRIPTORS)
+ (wValue_LSB > DevDescriptorPtr->NumberOfConfigurations))
+ #elif defined (USE_EEPROM_DESCRIPTORS)
+ (wValue_LSB > eeprom_read_byte(&DevDescriptorPtr->NumberOfConfigurations)))
+ #else
+ (wValue_LSB > pgm_read_byte(&DevDescriptorPtr->NumberOfConfigurations)))
+ #endif
+#endif
+ {
+ return;
+ }
+
+ Endpoint_ClearSetupReceived();
+
+ USB_ConfigurationNumber = wValue_LSB;
+
+ Endpoint_ClearSetupIN();
+
+ if (!(AlreadyConfigured) && USB_ConfigurationNumber)
+ RAISE_EVENT(USB_DeviceEnumerationComplete);
+
+ RAISE_EVENT(USB_ConfigurationChanged);
+}
+
+void USB_Device_GetConfiguration(void)
+{
+ Endpoint_ClearSetupReceived();
+
+ Endpoint_Write_Byte(USB_ConfigurationNumber);
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+}
+
+static void USB_Device_GetDescriptor(void)
+{
+ uint16_t wValue = Endpoint_Read_Word_LE();
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ void* DescriptorPointer;
+ uint16_t DescriptorSize;
+
+ bool SendZLP;
+
+ if ((DescriptorSize = USB_GetDescriptor(wValue, wIndex, &DescriptorPointer)) == NO_DESCRIPTOR)
+ return;
+
+ Endpoint_ClearSetupReceived();
+
+ if (wLength > DescriptorSize)
+ wLength = DescriptorSize;
+
+ while (wLength)
+ {
+ while (!(Endpoint_IsSetupINReady()))
+ {
+ if (Endpoint_IsSetupOUTReceived())
+ {
+ Endpoint_ClearSetupOUT();
+ return;
+ }
+ }
+
+ while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
+ {
+ #if defined(USE_RAM_DESCRIPTORS)
+ Endpoint_Write_Byte(*((uint8_t*)DescriptorPointer++));
+ #elif defined (USE_EEPROM_DESCRIPTORS)
+ Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++));
+ #else
+ Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));
+ #endif
+
+ wLength--;
+ }
+
+ SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);
+ Endpoint_ClearSetupIN();
+ }
+
+ if (SendZLP)
+ {
+ while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearSetupIN();
+ }
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+}
+
+static void USB_Device_GetStatus(const uint8_t bmRequestType)
+{
+ uint8_t CurrentStatus = 0;
+
+ Endpoint_Discard_Word();
+
+ uint8_t wIndex_LSB = Endpoint_Read_Byte();
+
+ switch (bmRequestType)
+ {
+ case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE):
+ if (USB_CurrentlySelfPowered)
+ CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
+
+ if (USB_RemoteWakeupEnabled)
+ CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
+
+ break;
+ case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
+ Endpoint_SelectEndpoint(wIndex_LSB);
+
+ CurrentStatus = Endpoint_IsStalled();
+
+ break;
+ }
+
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+ Endpoint_ClearSetupReceived();
+ Endpoint_Write_Word_LE(CurrentStatus);
+
+ Endpoint_ClearSetupIN();
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
+}
+
+#if !defined(NO_CLEARSET_FEATURE_REQUEST)
+static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType)
+{
+ uint16_t wValue = Endpoint_Read_Word_LE();
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ switch (bmRequestType & CONTROL_REQTYPE_RECIPIENT)
+ {
+ case REQREC_ENDPOINT:
+ if (wValue == FEATURE_ENDPOINT_HALT)
+ {
+ uint8_t EndpointIndex = (wIndex & ENDPOINT_EPNUM_MASK);
+
+ if (EndpointIndex != ENDPOINT_CONTROLEP)
+ {
+ Endpoint_SelectEndpoint(EndpointIndex);
+
+ if (Endpoint_IsEnabled())
+ {
+ if (bRequest == REQ_ClearFeature)
+ {
+ Endpoint_ClearStall();
+ Endpoint_ResetFIFO(EndpointIndex);
+ Endpoint_ResetDataToggle();
+ }
+ else
+ {
+ Endpoint_StallTransaction();
+ }
+ }
+
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+ Endpoint_ClearSetupReceived();
+ Endpoint_ClearSetupIN();
+ }
+ }
+
+ break;
+ }
+}
+#endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.h
new file mode 100644
index 00000000..5e1772a5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/DevChapter9.h
@@ -0,0 +1,135 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Module for device mode request processing. This module allows for the processing of standard control
+ * requests to the default control endpoint while in device mode.
+ *
+ * \see Chapter 9 of the USB 2.0 specification.
+ */
+
+#ifndef __DEVCHAPTER9_H__
+#define __DEVCHAPTER9_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/pgmspace.h>
+ #include <avr/eeprom.h>
+
+ #include "../HighLevel/StdDescriptors.h"
+ #include "../HighLevel/Events.h"
+ #include "LowLevel.h"
+ #include "StdRequestType.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Global Variables: */
+ /** Indicates the currently set configuration number of the device. USB devices may have several
+ * different configurations which the host can select between; this indicates the currently selected
+ * value, or 0 if no configuration has been selected.
+ *
+ * If a device has only one single configuration, the token USE_SINGLE_DEVICE_CONFIGURATION may be
+ * defined in the project makefile and passed to the compiler using the -D switch. This optimize for
+ * a single configuration, saving a small amount of space in the resulting compiled binary.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern uint8_t USB_ConfigurationNumber;
+
+ /** Indicates if the host is currently allowing the device to issue remote wakeup events. If this
+ * flag is cleared, the device should not issue remote wakeup events to the host.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern bool USB_RemoteWakeupEnabled;
+
+ /** Indicates if the device is currently being powered by its own power supply, rather than being
+ * powered by the host's USB supply. This flag should remain cleared if the device does not
+ * support self powered mode, as indicated in the device descriptors.
+ */
+ extern bool USB_CurrentlySelfPowered;
+
+ /* Throwable Events: */
+ /** This module raises the USB_UnhandledControlPacket event when a request to the default control
+ * endpoint has been received, but the library does not implement an internal handler for it.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_UnhandledControlPacket);
+
+ /** This module raises the USB_ConfigurationChanged event when the host issues a REQ_SetConfiguration
+ * device request, to change the currently selected configuration number.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_ConfigurationChanged);
+
+ /** This module raises the USB_DeviceEnumerationComplete event when the host has completed its
+ * enumeration of the device (i.e. when a REQ_SetConfiguration request changes the current configuration
+ * number from 0 to a non-zero value).
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_DeviceEnumerationComplete);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ #if defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)
+ #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
+ #endif
+
+ /* Function Prototypes: */
+ void USB_Device_ProcessControlPacket(void);
+
+ #if defined(INCLUDE_FROM_DEVCHAPTER9_C)
+ static void USB_Device_SetAddress(void);
+ static void USB_Device_SetConfiguration(void);
+ static void USB_Device_GetConfiguration(void);
+ static void USB_Device_GetDescriptor(void);
+ static void USB_Device_GetStatus(const uint8_t bmRequestType);
+ #if !defined(NO_CLEARSET_FEATURE_REQUEST)
+ static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType);
+ #endif
+ #endif
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Device.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Device.h
new file mode 100644
index 00000000..187fccb4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Device.h
@@ -0,0 +1,126 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device mode related macros and enums. This module contains macros and enums which are used when
+ * the USB controller is initialized in device mode.
+ */
+
+#ifndef __USBDEVICE_H__
+#define __USBDEVICE_H__
+
+ /* Includes: */
+ #include <avr/pgmspace.h>
+ #include <avr/eeprom.h>
+
+ #include "../../../Common/Common.h"
+ #include "../HighLevel/StdDescriptors.h"
+ #include "Endpoint.h"
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** Mask for the Options parameter of the USB_Init() function. This indicates that the
+ * USB interface should be initialized in low speed (1.5Mb/s) mode.
+ *
+ * \note Low Speed mode is not available on all USB AVR models.
+ *
+ * \note Restrictions apply on the number, size and type of endpoints which can be used
+ * when running in low speed mode -- refer to the USB 2.0 standard.
+ */
+ #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
+ #endif
+
+ /** Mask for the Options parameter of the USB_Init() function. This indicates that the
+ * USB interface should be initialized in full speed (12Mb/s) mode.
+ */
+ #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
+
+ /** Sends a Remote Wakeup request to the host. This signals to the host that the device should
+ * be taken out of suspended mode, and communications should resume.
+ *
+ * Typically, this is implemented so that HID devices (mice, keyboards, etc.) can wake up the
+ * host computer when the host has suspended all USB devices to enter a low power state.
+ *
+ * \note This macro should only be used if the device has indicated to the host that it
+ * supports the Remote Wakeup feature in the device descriptors, and should only be
+ * issued if the host is currently allowing remote wakeup events from the device (i.e.,
+ * the USB_RemoteWakeupEnabled flag is set, see DevChapter9.h documentation).
+ *
+ * \see StdDescriptors.h for more information on the RMWAKEUP feature and device descriptors.
+ */
+ #define USB_Device_SendRemoteWakeup() MACROS{ UDCON |= (1 << RMWKUP); }MACROE
+
+ /** Indicates if a Remote Wakeup request is being sent to the host. This returns true if a
+ * remote wakeup is currently being sent, false otherwise.
+ *
+ * This can be used in conjunction with the USB_Device_IsUSBSuspended() macro to determine if
+ * a sent RMWAKEUP request was accepted or rejected by the host.
+ *
+ * \note This macro should only be used if the device has indicated to the host that it
+ * supports the Remote Wakeup feature in the device descriptors.
+ *
+ * \see StdDescriptors.h for more information on the RMWAKEUP feature and device descriptors.
+ */
+ #define USB_Device_IsRemoteWakeupSent() ((UDCON & (1 << RMWKUP)) ? false : true)
+
+ /** Indicates if the device is currently suspended by the host. While suspended, the device is
+ * to enter a low power state until resumed by the host. While suspended no USB traffic to or
+ * from the device can ocurr (except for Remote Wakeup requests).
+ *
+ * This macro returns true if the USB communications have been suspended by the host, false
+ * otherwise.
+ */
+ #define USB_Device_IsUSBSuspended() ((UDINT & (1 << SUSPI)) ? true : false)
+
+ /* Enums: */
+ /** Enum for the ErrorCode parameter of the USB_DeviceError event.
+ *
+ * \see Events.h for more information on this event.
+ */
+ enum USB_Device_ErrorCodes_t
+ {
+ DEVICE_ERROR_GetDescriptorNotHooked = 0, /**< Indicates that the GetDescriptor() method
+ * has not been hooked by the user application.
+ *
+ * \see StdDescriptors.h for more information on
+ * the GetDescriptor() method.
+ */
+ };
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE
+ #define USB_Device_SetHighSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.c
new file mode 100644
index 00000000..273e1908
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.c
@@ -0,0 +1,387 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBMode.h"
+#if defined(USB_CAN_BE_DEVICE)
+
+#define INCLUDE_FROM_ENDPOINT_C
+#include "Endpoint.h"
+
+#if !defined(FIXED_CONTROL_ENDPOINT_SIZE)
+uint8_t USB_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
+#endif
+
+#if !defined(STATIC_ENDPOINT_CONFIGURATION)
+bool Endpoint_ConfigureEndpoint(const uint8_t Number, const uint8_t Type, const uint8_t Direction,
+ const uint16_t Size, const uint8_t Banks)
+{
+ Endpoint_SelectEndpoint(Number);
+ Endpoint_EnableEndpoint();
+
+ UECFG1X = 0;
+
+ UECFG0X = ((Type << EPTYPE0) | Direction);
+ UECFG1X = ((1 << ALLOC) | Banks | Endpoint_BytesToEPSizeMask(Size));
+
+ return Endpoint_IsConfigured();
+}
+#else
+bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData)
+{
+ Endpoint_SelectEndpoint(Number);
+ Endpoint_EnableEndpoint();
+
+ UECFG1X = 0;
+
+ UECFG0X = UECFG0XData;
+ UECFG1X = UECFG1XData;
+
+ return Endpoint_IsConfigured();
+}
+#endif
+
+void Endpoint_ClearEndpoints(void)
+{
+ UEINT = 0;
+
+ for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)
+ {
+ Endpoint_SelectEndpoint(EPNum);
+ UEIENX = 0;
+ UEINTX = 0;
+ Endpoint_DeallocateMemory();
+ Endpoint_DisableEndpoint();
+ }
+}
+
+uint8_t Endpoint_WaitUntilReady(void)
+{
+ uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
+
+ USB_INT_Clear(USB_INT_SOFI);
+
+ while (!(Endpoint_ReadWriteAllowed()))
+ {
+ if (!(USB_IsConnected))
+ return ENDPOINT_READYWAIT_DeviceDisconnected;
+ else if (Endpoint_IsStalled())
+ return ENDPOINT_READYWAIT_EndpointStalled;
+
+ if (USB_INT_HasOccurred(USB_INT_SOFI))
+ {
+ USB_INT_Clear(USB_INT_SOFI);
+
+ if (!(TimeoutMSRem--))
+ return ENDPOINT_READYWAIT_Timeout;
+ }
+ }
+
+ return ENDPOINT_READYWAIT_NoError;
+}
+
+uint8_t Endpoint_Discard_Stream(uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Endpoint_Discard_Byte();
+ }
+
+ return ENDPOINT_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)Buffer;
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Endpoint_Write_Byte(*(DataStream++));
+ }
+
+ return ENDPOINT_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Endpoint_Write_Byte(*(DataStream--));
+ }
+
+ return ENDPOINT_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)Buffer;
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ *(DataStream++) = Endpoint_Read_Byte();
+ }
+
+ return ENDPOINT_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Endpoint_ReadWriteAllowed()))
+ {
+ Endpoint_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Endpoint_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ *(DataStream--) = Endpoint_Read_Byte();
+ }
+
+ return ENDPOINT_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
+{
+ uint8_t* DataStream = (uint8_t*)Buffer;
+ bool SendZLP = true;
+
+ while (Length && !(Endpoint_IsSetupOUTReceived()))
+ {
+ while (!(Endpoint_IsSetupINReady()));
+
+ while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
+ {
+ Endpoint_Write_Byte(*(DataStream++));
+
+ Length--;
+ }
+
+ SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);
+ Endpoint_ClearSetupIN();
+ }
+
+ if (Endpoint_IsSetupOUTReceived())
+ return ENDPOINT_RWCSTREAM_ERROR_HostAborted;
+
+ if (SendZLP)
+ {
+ while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearSetupIN();
+ }
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ return ENDPOINT_RWCSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length)
+{
+ uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
+ bool SendZLP = true;
+
+ while (Length && !(Endpoint_IsSetupOUTReceived()))
+ {
+ while (!(Endpoint_IsSetupINReady()));
+
+ while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
+ {
+ Endpoint_Write_Byte(*(DataStream--));
+
+ Length--;
+ }
+
+ SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);
+ Endpoint_ClearSetupIN();
+ }
+
+ if (Endpoint_IsSetupOUTReceived())
+ return ENDPOINT_RWCSTREAM_ERROR_HostAborted;
+
+ if (SendZLP)
+ {
+ while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearSetupIN();
+ }
+
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ return ENDPOINT_RWCSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
+{
+ uint8_t* DataStream = (uint8_t*)Buffer;
+
+ while (Length)
+ {
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ while (Length && Endpoint_BytesInEndpoint())
+ {
+ *(DataStream++) = Endpoint_Read_Byte();
+
+ Length--;
+ }
+
+ Endpoint_ClearSetupOUT();
+ }
+
+ while (!(Endpoint_IsSetupINReady()));
+
+ return ENDPOINT_RWCSTREAM_ERROR_NoError;
+}
+
+uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length)
+{
+ uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
+
+ while (Length)
+ {
+ while (!(Endpoint_IsSetupOUTReceived()));
+
+ while (Length && Endpoint_BytesInEndpoint())
+ {
+ *(DataStream--) = Endpoint_Read_Byte();
+
+ Length--;
+ }
+
+ Endpoint_ClearSetupOUT();
+ }
+
+ while (!(Endpoint_IsSetupINReady()));
+
+ return ENDPOINT_RWCSTREAM_ERROR_NoError;
+}
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.h
new file mode 100644
index 00000000..5f317041
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Endpoint.h
@@ -0,0 +1,842 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Functions, macros and enums related to endpoint management when in USB Device mode. This
+ * module contains the endpoint management macros, as well as endpoint interrupt and data
+ * send/recieve functions for various datatypes.
+ */
+
+#ifndef __ENDPOINT_H__
+#define __ENDPOINT_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+ #include "../HighLevel/USBTask.h"
+
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ #include "StreamCallbacks.h"
+ #endif
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Endpoint data direction mask for Endpoint_ConfigureEndpoint(). This indicates that the endpoint
+ * should be initialized in the OUT direction - i.e. data flows from host to device.
+ */
+ #define ENDPOINT_DIR_OUT 0
+
+ /** Endpoint data direction mask for Endpoint_ConfigureEndpoint(). This indicates that the endpoint
+ * should be initialized in the IN direction - i.e. data flows from device to host.
+ */
+ #define ENDPOINT_DIR_IN (1 << EPDIR)
+
+ /** Mask for the bank mode selection for the Endpoint_ConfigureEndpoint() macro. This indicates
+ * that the endpoint should have one single bank, which requires less USB FIFO memory but results
+ * in slower transfers as only one USB device (the AVR or the host) can access the endpoint's
+ * bank at the one time.
+ */
+ #define ENDPOINT_BANK_SINGLE 0
+
+ /** Mask for the bank mode selection for the Endpoint_ConfigureEndpoint() macro. This indicates
+ * that the endpoint should have two banks, which requires more USB FIFO memory but results
+ * in faster transfers as one USB device (the AVR or the host) can access one bank while the other
+ * accesses the second bank.
+ */
+ #define ENDPOINT_BANK_DOUBLE (1 << EPBK0)
+
+ /** Endpoint address for the default control endpoint, which always resides in address 0. This is
+ * defined for convenience to give more readable code when used with the endpoint macros.
+ */
+ #define ENDPOINT_CONTROLEP 0
+
+ /** Default size of the default control endpoint's bank, until altered by the Endpoint0Size value
+ * in the device descriptor. Not available if the FIXED_CONTROL_ENDPOINT_SIZE token is defined.
+ */
+ #if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
+ #define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
+ #endif
+
+ /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
+ * numerical address in the device.
+ */
+ #define ENDPOINT_EPNUM_MASK 0b111
+
+ /** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's
+ * bank size in the device.
+ */
+ #define ENDPOINT_EPSIZE_MASK 0x7FF
+
+ /** Maximum size in bytes of a given endpoint.
+ *
+ * \param n Endpoint number, a value between 0 and (ENDPOINT_TOTAL_ENDPOINTS - 1)
+ */
+ #define ENDPOINT_MAX_SIZE(n) _ENDPOINT_GET_MAXSIZE(n)
+
+ /** Indicates if the given endpoint supports double banking.
+ *
+ * \param n Endpoint number, a value between 0 and (ENDPOINT_TOTAL_ENDPOINTS - 1)
+ */
+ #define ENDPOINT_DOUBLEBANK_SUPPORTED(n) _ENDPOINT_GET_DOUBLEBANK(n)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** Total number of endpoints (including the default control endpoint at address 0) which may
+ * be used in the device. Different USB AVR models support different amounts of endpoints,
+ * this value reflects the maximum number of endpoints for the currently selected AVR model.
+ */
+ #define ENDPOINT_TOTAL_ENDPOINTS 7
+ #else
+ #define ENDPOINT_TOTAL_ENDPOINTS 5
+ #endif
+
+ /** Interrupt definition for the endpoint SETUP interrupt (for CONTROL type endpoints). Should be
+ * used with the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on a CONTROL type endpoint if a new control packet is
+ * received from the host.
+ */
+ #define ENDPOINT_INT_SETUP UEIENX, (1 << RXSTPE), UEINTX, (1 << RXSTPI)
+
+ /** Interrupt definition for the endpoint IN interrupt (for INTERRUPT type endpoints). Should be
+ * used with the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the endpoint interrupt
+ * period has elapsed and the endpoint is ready for a new packet to be written to its FIFO buffer
+ * (if required).
+ */
+ #define ENDPOINT_INT_IN UEIENX, (1 << TXINE) , UEINTX, (1 << TXINI)
+
+ /** Interrupt definition for the endpoint OUT interrupt (for INTERRUPT type endpoints). Should be
+ * used with the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the endpoint interrupt
+ * period has elapsed and the endpoint is ready for a packet from the host to be read from its
+ * FIFO buffer (if received).
+ */
+ #define ENDPOINT_INT_OUT UEIENX, (1 << RXOUTE), UEINTX, (1 << RXOUTI)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)
+ /** Indicates the number of bytes currently stored in the current endpoint's selected bank. */
+ #define Endpoint_BytesInEndpoint() UEBCX
+ #else
+ #define Endpoint_BytesInEndpoint() UEBCLX
+ #endif
+
+ /** Returns the endpoint address of the currently selected endpoint. This is typically used to save
+ * the currently selected endpoint number so that it can be restored after another endpoint has
+ * been manipulated.
+ */
+ #define Endpoint_GetCurrentEndpoint() (UENUM & ENDPOINT_EPNUM_MASK)
+
+ /** Selects the given endpoint number. If the address from the device descriptors is used, the
+ * value should be masked with the ENDPOINT_EPNUM_MASK constant to extract only the endpoint
+ * number (and discarding the endpoint direction bit).
+ *
+ * Any endpoint operations which do not require the endpoint number to be indicated will operate on
+ * the currently selected endpoint.
+ */
+ #define Endpoint_SelectEndpoint(epnum) MACROS{ UENUM = epnum; }MACROE
+
+ /** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
+ * In and Out pointers to the bank's contents.
+ */
+ #define Endpoint_ResetFIFO(epnum) MACROS{ UERST = (1 << epnum); UERST = 0; }MACROE
+
+ /** Enables the currently selected endpoint so that data can be sent and received through it to
+ * and from a host.
+ *
+ * \note Endpoints must first be configured properly rather than just being enabled via the
+ * Endpoint_ConfigureEndpoint() macro, which calls Endpoint_EnableEndpoint() automatically.
+ */
+ #define Endpoint_EnableEndpoint() MACROS{ UECONX |= (1 << EPEN); }MACROE
+
+ /** Disables the currently selected endpoint so that data cannot be sent and received through it
+ * to and from a host.
+ */
+ #define Endpoint_DisableEndpoint() MACROS{ UECONX &= ~(1 << EPEN); }MACROE
+
+ /** Returns true if the currently selected endpoint is enabled, false otherwise. */
+ #define Endpoint_IsEnabled() ((UECONX & (1 << EPEN)) ? true : false)
+
+ /** Returns true if the currently selected endpoint may be read from (if data is waiting in the endpoint
+ * bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an
+ * IN direction). This function will return false if an error has occured in the endpoint, or if
+ * the endpoint is an OUT direction and no packet has been received, or if the endpoint is an IN
+ * direction and the endpoint bank is full.
+ */
+ #define Endpoint_ReadWriteAllowed() ((UEINTX & (1 << RWAL)) ? true : false)
+
+ /** Returns true if the currently selected endpoint is configured, false otherwise. */
+ #define Endpoint_IsConfigured() ((UESTA0X & (1 << CFGOK)) ? true : false)
+
+ /** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their
+ * interrupt duration has elapsed. Which endpoints have interrupted can be determined by
+ * masking the return value against (1 << {Endpoint Number}).
+ */
+ #define Endpoint_GetEndpointInterrupts() UEINT
+
+ /** Clears the endpoint interrupt flag. This clears the specified endpoint number's interrupt
+ * mask in the endpoint interrupt flag register.
+ */
+ #define Endpoint_ClearEndpointInterrupt(n) MACROS{ UEINT &= ~(1 << n); }MACROE
+
+ /** Returns true if the specified endpoint number has interrupted (valid only for INTERRUPT type
+ * endpoints), false otherwise.
+ */
+ #define Endpoint_HasEndpointInterrupted(n) ((UEINT & (1 << n)) ? true : false)
+
+ /** Clears the currently selected endpoint bank, and switches to the alternate bank if the currently
+ * selected endpoint is dual-banked. When cleared, this either frees the bank up for the next packet
+ * from the host (if the endpoint is of the OUT direction) or sends the packet contents to the host
+ * (if the endpoint is of the IN direction).
+ */
+ #define Endpoint_ClearCurrentBank() MACROS{ UEINTX &= ~(1 << FIFOCON); }MACROE
+
+ /** Returns true if the current CONTROL type endpoint is ready for an IN packet, false otherwise. */
+ #define Endpoint_IsSetupINReady() ((UEINTX & (1 << TXINI)) ? true : false)
+
+ /** Returns true if the current CONTROL type endpoint is ready for an OUT packet, false otherwise. */
+ #define Endpoint_IsSetupOUTReceived() ((UEINTX & (1 << RXOUTI)) ? true : false)
+
+ /** Returns true if the current CONTROL type endpoint is ready for a SETUP packet, false otherwise. */
+ #define Endpoint_IsSetupReceived() ((UEINTX & (1 << RXSTPI)) ? true : false)
+
+ /** Clears a received SETUP packet on the currently selected CONTROL type endpoint. */
+ #define Endpoint_ClearSetupReceived() MACROS{ UEINTX &= ~(1 << RXSTPI); }MACROE
+
+ /** Sends an IN packet to the host on the currently selected CONTROL type endpoint. */
+ #define Endpoint_ClearSetupIN() MACROS{ UEINTX &= ~(1 << TXINI); }MACROE
+
+ /** Acknowedges an OUT packet to the host on the currently selected CONTROL type endpoint, freeing
+ * up the endpoint for the next packet.
+ */
+ #define Endpoint_ClearSetupOUT() MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE
+
+ /** Stalls the current endpoint, indicating to the host that a logical problem occured with the
+ * indicated endpoint and that the current transfer sequence should be aborted. This provides a
+ * way for devices to indicate invalid commands to the host so that the current transfer can be
+ * aborted and the host can begin its own recovery seqeuence.
+ *
+ * The currently selected endpoint remains stalled until either the Endpoint_ClearStall() macro
+ * is called, or the host issues a CLEAR FEATURE request to the device for the currently selected
+ * endpoint.
+ */
+ #define Endpoint_StallTransaction() MACROS{ UECONX |= (1 << STALLRQ); }MACROE
+
+ /** Clears the stall on the currently selected endpoint. */
+ #define Endpoint_ClearStall() MACROS{ UECONX |= (1 << STALLRQC); }MACROE
+
+ /** Returns true if the currently selected endpoint is stalled, false othewise. */
+ #define Endpoint_IsStalled() ((UECONX & (1 << STALLRQ)) ? true : false)
+
+ /** Resets the data toggle of the currently selected endpoint. */
+ #define Endpoint_ResetDataToggle() MACROS{ UECONX |= (1 << RSTDT); }MACROE
+
+ /* Enums: */
+ /** Enum for the possible error return codes of the Endpoint_WaitUntilReady function */
+ enum Endpoint_WaitUntilReady_ErrorCodes_t
+ {
+ ENDPOINT_READYWAIT_NoError = 0, /**< Endpoint is ready for next packet, no error. */
+ ENDPOINT_READYWAIT_EndpointStalled = 1, /**< The endpoint was stalled during the stream
+ * transfer by the host or device.
+ */
+ ENDPOINT_READYWAIT_DeviceDisconnected = 2, /**< Device was disconnected from the host while
+ * waiting for the endpoint to become ready.
+ */
+ ENDPOINT_READYWAIT_Timeout = 3, /**< The host failed to accept or send the next packet
+ * within the software timeout period set by the
+ * USB_STREAM_TIMEOUT_MS macro.
+ */
+ };
+
+ /** Enum for the possible error return codes of the Endpoint_*_Stream_* functions. */
+ enum Endpoint_Stream_RW_ErrorCodes_t
+ {
+ ENDPOINT_RWSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */
+ ENDPOINT_RWSTREAM_ERROR_EndpointStalled = 1, /**< The endpoint was stalled during the stream
+ * transfer by the host or device.
+ */
+ ENDPOINT_RWSTREAM_ERROR_DeviceDisconnected = 1, /**< Device was disconnected from the host during
+ * the transfer.
+ */
+ ENDPOINT_RWSTREAM_ERROR_Timeout = 2, /**< The host failed to accept or send the next packet
+ * within the software timeout period set by the
+ * USB_STREAM_TIMEOUT_MS macro.
+ */
+ ENDPOINT_RWSTREAM_ERROR_CallbackAborted = 3, /**< Indicates that the stream's callback function
+ * aborted the transfer early.
+ */
+ };
+
+ /** Enum for the possible error return codes of the Endpoint_*_Control_Stream_* functions. */
+ enum Endpoint_ControlStream_RW_ErrorCodes_t
+ {
+ ENDPOINT_RWCSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */
+ ENDPOINT_RWCSTREAM_ERROR_HostAborted = 1, /**< The aborted the transfer prematurely. */
+ };
+
+ /* Inline Functions: */
+ /** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
+ static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Endpoint_Read_Byte(void)
+ {
+ return UEDATX;
+ }
+
+ /** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. */
+ static inline void Endpoint_Write_Byte(const uint8_t Byte)
+ {
+ UEDATX = Byte;
+ }
+
+ /** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
+ static inline void Endpoint_Discard_Byte(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UEDATX;
+ }
+
+ /** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT
+ * direction endpoints.
+ */
+ static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint16_t Endpoint_Read_Word_LE(void)
+ {
+ uint16_t Data;
+
+ Data = UEDATX;
+ Data |= (((uint16_t)UEDATX) << 8);
+
+ return Data;
+ }
+
+ /** Reads two bytes from the currently selected endpoint's bank in big endian format, for OUT
+ * direction endpoints.
+ */
+ static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint16_t Endpoint_Read_Word_BE(void)
+ {
+ uint16_t Data;
+
+ Data = (((uint16_t)UEDATX) << 8);
+ Data |= UEDATX;
+
+ return Data;
+ }
+
+ /** Writes two bytes to the currently selected endpoint's bank in little endian format, for IN
+ * direction endpoints.
+ */
+ static inline void Endpoint_Write_Word_LE(const uint16_t Word)
+ {
+ UEDATX = (Word & 0xFF);
+ UEDATX = (Word >> 8);
+ }
+
+ /** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
+ * direction endpoints.
+ */
+ static inline void Endpoint_Write_Word_BE(const uint16_t Word)
+ {
+ UEDATX = (Word >> 8);
+ UEDATX = (Word & 0xFF);
+ }
+
+ /** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints. */
+ static inline void Endpoint_Discard_Word(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UEDATX;
+ Dummy = UEDATX;
+ }
+
+ /** Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT
+ * direction endpoints.
+ */
+ static inline uint32_t Endpoint_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint32_t Endpoint_Read_DWord_LE(void)
+ {
+ union
+ {
+ uint32_t DWord;
+ uint8_t Bytes[4];
+ } Data;
+
+ Data.Bytes[0] = UEDATX;
+ Data.Bytes[1] = UEDATX;
+ Data.Bytes[2] = UEDATX;
+ Data.Bytes[3] = UEDATX;
+
+ return Data.DWord;
+ }
+
+ /** Reads four bytes from the currently selected endpoint's bank in big endian format, for OUT
+ * direction endpoints.
+ */
+ static inline uint32_t Endpoint_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint32_t Endpoint_Read_DWord_BE(void)
+ {
+ union
+ {
+ uint32_t DWord;
+ uint8_t Bytes[4];
+ } Data;
+
+ Data.Bytes[3] = UEDATX;
+ Data.Bytes[2] = UEDATX;
+ Data.Bytes[1] = UEDATX;
+ Data.Bytes[0] = UEDATX;
+
+ return Data.DWord;
+ }
+
+ /** Writes four bytes to the currently selected endpoint's bank in little endian format, for IN
+ * direction endpoints.
+ */
+ static inline void Endpoint_Write_DWord_LE(const uint32_t DWord)
+ {
+ Endpoint_Write_Word_LE(DWord);
+ Endpoint_Write_Word_LE(DWord >> 16);
+ }
+
+ /** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
+ * direction endpoints.
+ */
+ static inline void Endpoint_Write_DWord_BE(const uint32_t DWord)
+ {
+ Endpoint_Write_Word_BE(DWord >> 16);
+ Endpoint_Write_Word_BE(DWord);
+ }
+
+ /** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints. */
+ static inline void Endpoint_Discard_DWord(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UEDATX;
+ Dummy = UEDATX;
+ Dummy = UEDATX;
+ Dummy = UEDATX;
+ }
+
+ /* External Variables: */
+ /** Global indicating the maximum packet size of the default control endpoint located at address
+ * 0 in the device. This value is set to the value indicated in the device descriptor in the user
+ * project once the USB interface is initialized into device mode.
+ *
+ * If space is an issue, it is possible to fix this to a static value by defining the control
+ * endpoint size in the FIXED_CONTROL_ENDPOINT_SIZE token passed to the compiler in the makefile
+ * via the -D switch. When a fixed control endpoint size is used, the size is no longer dynamically
+ * read from the descriptors at runtime and instead fixed to the given value. When used, it is
+ * important that the descriptor control endpoint size value matches the size given as the
+ * FIXED_CONTROL_ENDPOINT_SIZE token - it is recommended that the FIXED_CONTROL_ENDPOINT_SIZE token
+ * be used in the descriptors to ensure this.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ #if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
+ extern uint8_t USB_ControlEndpointSize;
+ #else
+ #define USB_ControlEndpointSize FIXED_CONTROL_ENDPOINT_SIZE
+ #endif
+
+ /* Function Prototypes: */
+ /** Configures the specified endpoint number with the given endpoint type, direction, bank size
+ * and banking mode. Endpoints should be allocated in ascending order by their address in the
+ * device (i.e. endpoint 1 should be configured before endpoint 2 and so on).
+ *
+ * The endpoint type may be one of the EP_TYPE_* macros listed in LowLevel.h and the direction
+ * may be either ENDPOINT_DIR_OUT or ENDPOINT_DIR_IN.
+ *
+ * The bank size must indicate the maximum packet size that the endpoint can handle. Different
+ * endpoint numbers can handle different maximum packet sizes - refer to the chosen USB AVR's
+ * datasheet to determine the maximum bank size for each endpoint.
+ *
+ * The banking mode may be either ENDPOINT_BANK_SINGLE or ENDPOINT_BANK_DOUBLE.
+ *
+ * The success of this routine can be determined via the Endpoint_IsConfigured() macro.
+ *
+ * By default, the routine is entirely dynamic, and will accept both constant and variable inputs.
+ * If dynamic configuration is unused, a small space savings can be made by defining the
+ * STATIC_ENDPOINT_CONFIGURATION macro via the -D switch to the compiler, to optimize for constant
+ * input values.
+ *
+ * \note This routine will select the specified endpoint, and the endpoint will remain selected
+ * once the routine completes regardless of if the endpoint configuration succeeds.
+ *
+ * \return Boolean true if the configuration succeeded, false otherwise
+ */
+ bool Endpoint_ConfigureEndpoint(const uint8_t Number, const uint8_t Type, const uint8_t Direction,
+ const uint16_t Size, const uint8_t Banks);
+
+ /** Spinloops until the currently selected non-control endpoint is ready for the next packet of data
+ * to be read or written to it.
+ *
+ * \note This routine should not be called on CONTROL type endpoints.
+ *
+ * \return A value from the Endpoint_WaitUntilReady_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_WaitUntilReady(void);
+
+ /** Reads and discards the given number of bytes from the endpoint from the given buffer,
+ * discarding fully read packets from the host as needed. The last packet is not automatically
+ * discarded once the remaining bytes has been read; the user is responsible for manually
+ * discarding the last packet from the host via the Endpoint_ClearCurrentBank() macro. Between
+ * each USB packet, the given stream callback function is executed repeatedly until the next
+ * packet is ready, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \note This routine should not be used on CONTROL type endpoints.
+ *
+ * \param Length Number of bytes to send via the currently selected endpoint.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Discard_Stream(uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ );
+
+ /** Writes the given number of bytes to the endpoint from the given buffer in little endian,
+ * sending full packets to the host as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Endpoint_ClearCurrentBank() macro. Between each USB packet, the given stream callback function
+ * is executed repeatedly until the endpoint is ready to accept the next packet, allowing for early
+ * aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \note This routine should not be used on CONTROL type endpoints.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected endpoint into the buffer.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Writes the given number of bytes to the endpoint from the given buffer in big endian,
+ * sending full packets to the host as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Endpoint_ClearCurrentBank() macro. Between each USB packet, the given stream callback function
+ * is executed repeatedly until the endpoint is ready to accept the next packet, allowing for early
+ * aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \note This routine should not be used on CONTROL type endpoints.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected endpoint into the buffer.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads the given number of bytes from the endpoint from the given buffer in little endian,
+ * discarding fully read packets from the host as needed. The last packet is not automatically
+ * discarded once the remaining bytes has been read; the user is responsible for manually
+ * discarding the last packet from the host via the Endpoint_ClearCurrentBank() macro. Between
+ * each USB packet, the given stream callback function is executed repeatedly until the endpoint
+ * is ready to accept the next packet, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \note This routine should not be used on CONTROL type endpoints.
+ *
+ * \param Buffer Pointer to the destination data buffer to write to.
+ * \param Length Number of bytes to send via the currently selected endpoint.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads the given number of bytes from the endpoint from the given buffer in big endian,
+ * discarding fully read packets from the host as needed. The last packet is not automatically
+ * discarded once the remaining bytes has been read; the user is responsible for manually
+ * discarding the last packet from the host via the Endpoint_ClearCurrentBank() macro. Between
+ * each USB packet, the given stream callback function is executed repeatedly until the endpoint
+ * is ready to accept the next packet, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \note This routine should not be used on CONTROL type endpoints.
+ *
+ * \param Buffer Pointer to the destination data buffer to write to.
+ * \param Length Number of bytes to send via the currently selected endpoint.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian,
+ * sending full packets to the host as needed. The host OUT acknowedgement is not automatically cleared
+ * in both failure and success states; the user is responsible for manually clearing the setup OUT to
+ * finalize the transfer via the Endpoint_ClearSetupOUT() macro.
+ *
+ * \note This routine should only be used on CONTROL type endpoints.
+ *
+ * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
+ * together; i.e. the entire stream data must be read or written at the one time.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected endpoint into the buffer.
+ *
+ * \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,
+ * sending full packets to the host as needed. The host OUT acknowedgement is not automatically cleared
+ * in both failure and success states; the user is responsible for manually clearing the setup OUT to
+ * finalize the transfer via the Endpoint_ClearSetupOUT() macro.
+ *
+ * \note This routine should only be used on CONTROL type endpoints.
+ *
+ * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
+ * together; i.e. the entire stream data must be read or written at the one time.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected endpoint into the buffer.
+ *
+ * \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,
+ * discarding fully read packets from the host as needed. The device IN acknowedgement is not
+ * automatically sent after success or failure states; the user is responsible for manually sending the
+ * setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
+ *
+ * \note This routine should only be used on CONTROL type endpoints.
+ *
+ * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
+ * together; i.e. the entire stream data must be read or written at the one time.
+ *
+ * \param Buffer Pointer to the destination data buffer to write to.
+ * \param Length Number of bytes to send via the currently selected endpoint.
+ *
+ * \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,
+ * discarding fully read packets from the host as needed. The device IN acknowedgement is not
+ * automatically sent after success or failure states; the user is responsible for manually sending the
+ * setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
+ *
+ * \note This routine should only be used on CONTROL type endpoints.
+ *
+ * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
+ * together; i.e. the entire stream data must be read or written at the one time.
+ *
+ * \param Buffer Pointer to the destination data buffer to write to.
+ * \param Length Number of bytes to send via the currently selected endpoint.
+ *
+ * \return A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+
+ /* Function Aliases: */
+ /** Alias for Endpoint_Discard_Byte().
+ */
+ #define Endpoint_Ignore_Byte() Endpoint_Discard_Byte()
+
+ /** Alias for Endpoint_Discard_Word().
+ */
+ #define Endpoint_Ignore_Word() Endpoint_Discard_Word()
+
+ /** Alias for Endpoint_Discard_DWord().
+ */
+ #define Endpoint_Ignore_DWord() Endpoint_Discard_DWord()
+
+ /** Alias for Endpoint_Read_Word_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Read_Word() Endpoint_Read_Word_LE()
+
+ /** Alias for Endpoint_Write_Word_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Write_Word(Word) Endpoint_Write_Word_LE(Word)
+
+ /** Alias for Endpoint_Read_DWord_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Read_DWord() Endpoint_Read_DWord_LE()
+
+ /** Alias for Endpoint_Write_DWord_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Write_DWord(DWord) Endpoint_Write_DWord_LE(DWord)
+
+ /** Alias for Endpoint_Read_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #if !defined(NO_STREAM_CALLBACKS)
+ #define Endpoint_Read_Stream(Buffer, Length, Callback) Endpoint_Read_Stream_LE(Buffer, Length, Callback)
+ #else
+ #define Endpoint_Read_Stream(Buffer, Length) Endpoint_Read_Stream_LE(Buffer, Length)
+ #endif
+
+ /** Alias for Endpoint_Write_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #if !defined(NO_STREAM_CALLBACKS)
+ #define Endpoint_Write_Stream(Buffer, Length, Callback) Endpoint_Write_Stream_LE(Buffer, Length, Callback)
+ #else
+ #define Endpoint_Write_Stream(Buffer, Length) Endpoint_Write_Stream_LE(Buffer, Length)
+ #endif
+
+ /** Alias for Endpoint_Read_Control_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Read_Control_Stream(Data, Length) Endpoint_Read_Control_Stream_LE(Data, Length)
+
+ /** Alias for Endpoint_Write_Control_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Endpoint_Write_Control_Stream(Data, Length) Endpoint_Write_Control_Stream_LE(Data, Length)
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define Endpoint_AllocateMemory() MACROS{ UECFG1X |= (1 << ALLOC); }MACROE
+ #define Endpoint_DeallocateMemory() MACROS{ UECFG1X &= ~(1 << ALLOC); }MACROE
+
+ #define _ENDPOINT_GET_MAXSIZE(n) _ENDPOINT_GET_MAXSIZE2(ENDPOINT_DETAILS_EP ## n)
+ #define _ENDPOINT_GET_MAXSIZE2(details) _ENDPOINT_GET_MAXSIZE3(details)
+ #define _ENDPOINT_GET_MAXSIZE3(maxsize, db) maxsize
+
+ #define _ENDPOINT_GET_DOUBLEBANK(n) _ENDPOINT_GET_DOUBLEBANK2(ENDPOINT_DETAILS_EP ## n)
+ #define _ENDPOINT_GET_DOUBLEBANK2(details) _ENDPOINT_GET_DOUBLEBANK3(details)
+ #define _ENDPOINT_GET_DOUBLEBANK3(maxsize, db) db
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ #define ENDPOINT_DETAILS_EP0 64, true
+ #define ENDPOINT_DETAILS_EP1 256, true
+ #define ENDPOINT_DETAILS_EP2 64, true
+ #define ENDPOINT_DETAILS_EP3 64, true
+ #define ENDPOINT_DETAILS_EP4 64, true
+ #define ENDPOINT_DETAILS_EP5 64, true
+ #define ENDPOINT_DETAILS_EP6 64, true
+ #else
+ #define ENDPOINT_DETAILS_EP0 64, true
+ #define ENDPOINT_DETAILS_EP1 64, false
+ #define ENDPOINT_DETAILS_EP2 64, false
+ #define ENDPOINT_DETAILS_EP3 64, true
+ #define ENDPOINT_DETAILS_EP4 64, true
+ #endif
+
+ #if defined(STATIC_ENDPOINT_CONFIGURATION)
+ #define Endpoint_ConfigureEndpoint(Number, Type, Direction, Size, Banks) \
+ Endpoint_ConfigureEndpointStatic(Number, \
+ ((Type << EPTYPE0) | Direction), \
+ ((1 << ALLOC) | Banks | Endpoint_BytesToEPSizeMask(Size)));
+ #endif
+
+ /* Function Prototypes: */
+ void Endpoint_ClearEndpoints(void);
+ bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData);
+
+ /* Inline Functions: */
+ static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYSINLINE;
+ static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes)
+ {
+ if (Bytes <= 8)
+ return (0 << EPSIZE0);
+ else if (Bytes <= 16)
+ return (1 << EPSIZE0);
+ else if (Bytes <= 32)
+ return (2 << EPSIZE0);
+ #if defined(USB_LIMITED_CONTROLLER)
+ else
+ return (3 << EPSIZE0);
+ #else
+ else if (Bytes <= 64)
+ return (3 << EPSIZE0);
+ else if (Bytes <= 128)
+ return (4 << EPSIZE0);
+ else
+ return (5 << EPSIZE0);
+ #endif
+ };
+
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.c
new file mode 100644
index 00000000..7acbffe7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.c
@@ -0,0 +1,115 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBMode.h"
+#if defined(USB_CAN_BE_HOST)
+
+#include "Host.h"
+
+uint8_t USB_Host_WaitMS(uint8_t MS)
+{
+ bool BusSuspended = USB_Host_IsBusSuspended();
+ uint8_t ErrorCode = HOST_WAITERROR_Successful;
+
+ USB_INT_Clear(USB_INT_HSOFI);
+ USB_Host_ResumeBus();
+
+ while (MS)
+ {
+ if (USB_INT_HasOccurred(USB_INT_HSOFI))
+ {
+ USB_INT_Clear(USB_INT_HSOFI);
+ MS--;
+ }
+
+ if ((USB_IsConnected == false) || (USB_CurrentMode == USB_MODE_DEVICE))
+ {
+ ErrorCode = HOST_WAITERROR_DeviceDisconnect;
+
+ break;
+ }
+
+ if (Pipe_IsError() == true)
+ {
+ Pipe_ClearError();
+ ErrorCode = HOST_WAITERROR_PipeError;
+
+ break;
+ }
+
+ if (Pipe_IsStalled() == true)
+ {
+ Pipe_ClearStall();
+ ErrorCode = HOST_WAITERROR_SetupStalled;
+
+ break;
+ }
+ }
+
+ if (BusSuspended)
+ USB_Host_SuspendBus();
+
+ return ErrorCode;
+}
+
+void USB_Host_ResetDevice(void)
+{
+ bool BusSuspended = USB_Host_IsBusSuspended();
+
+ USB_INT_Disable(USB_INT_DDISCI);
+
+ USB_Host_ResetBus();
+ while (!(USB_Host_IsResetBusDone()));
+
+ USB_INT_Clear(USB_INT_HSOFI);
+ USB_Host_ResumeBus();
+
+ for (uint8_t MSRem = 10; MSRem != 0; MSRem--)
+ {
+ /* Workaround for powerless-pullup devices. After a USB bus reset,
+ all disconnection interrupts are supressed while a USB frame is
+ looked for - if it is found within 10ms, the device is still
+ present. */
+
+ if (USB_INT_HasOccurred(USB_INT_HSOFI))
+ {
+ USB_INT_Clear(USB_INT_DDISCI);
+ break;
+ }
+
+ _delay_ms(1);
+ }
+
+ if (BusSuspended)
+ USB_Host_SuspendBus();
+
+ USB_INT_Enable(USB_INT_DDISCI);
+}
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.h
new file mode 100644
index 00000000..5cc21545
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Host.h
@@ -0,0 +1,245 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Host mode related macros and enums. This module contains macros and enums which are used when
+ * the USB controller is initialized in host mode.
+ */
+
+#ifndef __USBHOST_H__
+#define __USBHOST_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+ #include <util/delay.h>
+
+ #include "../../../Common/Common.h"
+ #include "../HighLevel/USBInterrupt.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Indicates the fixed USB device address which any attached device is enumerated to when in
+ * host mode. As only one USB device may be attached to the AVR in host mode at any one time
+ * and that the address used is not important (other than the fact that it is non-zero), a
+ * fixed value is specified by the library.
+ */
+ #define USB_HOST_DEVICEADDRESS 1
+
+ #if !defined(USB_HOST_TIMEOUT_MS) || defined(__DOXYGEN__)
+ /** Constant for the maximum software timeout period of sent USB control transactions to an attached
+ * device. If a device fails to respond to a sent control request within this period, the
+ * library will return a timeout error code.
+ *
+ * This value may be overridden in the user project makefile as the value of the
+ * USB_HOST_TIMEOUT_MS token, and passed to the compiler using the -D switch.
+ */
+ #define USB_HOST_TIMEOUT_MS 1000
+ #endif
+
+ #if !defined(HOST_DEVICE_SETTLE_DELAY_MS) || defined(__DOXYGEN__)
+ /** Constant for the delay in milliseconds after a device is connected before the library
+ * will start the enumeration process. Some devices require a delay of up to 5 seconds
+ * after connection before the enumeration process can start or incorrect operation will
+ * occur.
+ *
+ * This value may be overridden in the user project makefile as the value of the
+ * HOST_DEVICE_SETTLE_DELAY_MS token, and passed to the compiler using the -D switch.
+ */
+ #define HOST_DEVICE_SETTLE_DELAY_MS 1500
+ #endif
+
+ /** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host.
+ * USB bus resets leave the default control pipe configured (if already configured).
+ *
+ * If the USB bus has been suspended prior to issuing a bus reset, the attached device will be
+ * woken up automatically and the bus resumed after the reset has been correctly issued.
+ */
+ #define USB_Host_ResetBus() MACROS{ UHCON |= (1 << RESET); }MACROE
+
+ /** Determines if a previously issued bus reset (via the USB_Host_ResetBus() macro) has
+ * completed. This macro returns true if no bus reset is currently being sent, false
+ * otherwise.
+ */
+ #define USB_Host_IsResetBusDone() ((UHCON & (1 << RESET)) ? false : true)
+
+ /** Resumes USB communications with an attached and enumerated device, by resuming the transmission
+ * of the 1MS Start Of Frame messages to the device. When resumed, USB communications between the
+ * host and attached device may occur.
+ */
+ #define USB_Host_ResumeBus() MACROS{ UHCON |= (1 << SOFEN); }MACROE
+
+ /** Suspends the USB bus, preventing any communications from occuring between the host and attached
+ * device until the bus has been resumed. This stops the transmission of the 1MS Start Of Frame
+ * messages to the device.
+ */
+ #define USB_Host_SuspendBus() MACROS{ UHCON &= ~(1 << SOFEN); }MACROE
+
+ /** Returns true if the USB bus has been suspended via the use of the USB_Host_SuspendBus() macro,
+ * false otherwise. While suspended, no USB communications can occur until the bus is resumed,
+ * except for the Remote Wakeup event from the device if supported.
+ */
+ #define USB_Host_IsBusSuspended() ((UHCON & (1 << SOFEN)) ? false : true)
+
+ /** Returns true if the attached device is currently enumerated in Full Speed mode (12Mb/s), or
+ * false if the attached device is enumerated in Low Speed mode (1.5Mb/s).
+ */
+ #define USB_Host_IsDeviceFullSpeed() ((USBSTA & (1 << SPEED)) ? true : false)
+
+ /** Returns true if the attached device is currently issuing a Remote Wakeup request, requesting
+ * that the host resume the USB bus and wake up the device, false otherwise.
+ */
+ #define USB_Host_IsRemoteWakeupSent() ((UHINT & (1 << RXRSMI)) ? true : false)
+
+ /** Clears the flag indicating that a Remote Wakeup request has been issued by an attached
+ * device.
+ */
+ #define USB_Host_ClearRemoteWakeupSent() MACROS{ UHINT &= ~(1 << RXRSMI); }MACROE
+
+ /** Accepts a Remote Wakeup request from an attached device. This must be issued in response to
+ * a device's Remote Wakeup request within 2ms for the request to be accepted and the bus to
+ * be resumed.
+ */
+ #define USB_Host_ResumeFromWakeupRequest() MACROS{ UHCON |= (1 << RESUME); }MACROE
+
+ /** Returns true if no resume from Remote Wakeup request is currently being sent to an attached
+ * device, false otherwise.
+ */
+ #define USB_Host_IsResumeFromWakeupRequestSent() ((UHCON & (1 << RESUME)) ? false : true)
+
+ /* Enums: */
+ /** Enum for the various states of the USB Host state machine. Only some states are
+ * implemented in the LUFA library - other states are left to the user to implement.
+ *
+ * For information on each state, refer to the USB 2.0 specification. Some states have
+ *
+ * \see USBTask.h for information on the global variable USB_HostState, which stores the
+ * current host state machine state.
+ */
+ enum USB_Host_States_t
+ {
+ HOST_STATE_WaitForDevice = 0, /**< Internally implemented by the library. */
+ HOST_STATE_Unattached = 1, /**< Internally implemented by the library. */
+ HOST_STATE_Attached = 2, /**< Internally implemented by the library. */
+ HOST_STATE_Attached_WaitForDeviceSettle = 3, /**< Internally implemented by the library. */
+ HOST_STATE_Attached_WaitForConnect = 4, /**< Internally implemented by the library. */
+ HOST_STATE_Attached_DoReset = 5, /**< Internally implemented by the library. */
+ HOST_STATE_Powered = 6, /**< Internally implemented by the library. */
+ HOST_STATE_Default = 7, /**< Internally implemented by the library. */
+ HOST_STATE_Default_PostReset = 8, /**< Internally implemented by the library. */
+ HOST_STATE_Default_PostAddressSet = 9, /**< Internally implemented by the library. */
+ HOST_STATE_Addressed = 10, /**< May be implemented by the user project. */
+ HOST_STATE_Configured = 11, /**< May be implemented by the user project. */
+ HOST_STATE_Ready = 12, /**< May be implemented by the user project. */
+ HOST_STATE_Suspended = 13, /**< May be implemented by the user project. */
+ };
+
+ /** Enum for the error codes for the USB_HostError event.
+ *
+ * \see Events.h for more information on this event.
+ */
+ enum USB_Host_ErrorCodes_t
+ {
+ HOST_ERROR_VBusVoltageDip = 0, /**< VBUS voltage dipped to an unacceptable level. This
+ * error may be the result of an attached device drawing
+ * too much current from the VBUS line, or due to the
+ * AVR's power source being unable to supply sufficient
+ * current.
+ */
+ };
+
+ /** Enum for the error codes for the USB_DeviceEnumerationFailed event.
+ *
+ * \see Events.h for more information on this event.
+ */
+ enum USB_Host_EnumerationErrorCodes_t
+ {
+ HOST_ENUMERROR_NoError = 0, /**< No error occurred. Used internally, this is not a valid
+ * ErrorCode parameter value for the USB_DeviceEnumerationFailed
+ * event.
+ */
+ HOST_ENUMERROR_WaitStage = 1, /**< One of the delays between enumeration steps failed
+ * to complete successfuly, due to a timeout or other
+ * error.
+ */
+ HOST_ENUMERROR_NoDeviceDetected = 2, /**< No device was detected, despite the USB data lines
+ * indicating the attachment of a device.
+ */
+ HOST_ENUMERROR_ControlError = 3, /**< One of the enumeration control requests failed to
+ * complete successfuly.
+ */
+ HOST_ENUMERROR_PipeConfigError = 4, /**< The default control pipe (address 0) failed to
+ * configure correctly.
+ */
+ };
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define USB_Host_HostMode_On() MACROS{ USBCON |= (1 << HOST); }MACROE
+ #define USB_Host_HostMode_Off() MACROS{ USBCON &= ~(1 << HOST); }MACROE
+
+ #define USB_Host_VBUS_Auto_Enable() MACROS{ OTGCON &= ~(1 << VBUSHWC); UHWCON |= (1 << UVCONE); }MACROE
+ #define USB_Host_VBUS_Manual_Enable() MACROS{ OTGCON |= (1 << VBUSHWC); UHWCON &= ~(1 << UVCONE); DDRE |= (1 << 7); }MACROE
+
+ #define USB_Host_VBUS_Auto_On() MACROS{ OTGCON |= (1 << VBUSREQ); }MACROE
+ #define USB_Host_VBUS_Manual_On() MACROS{ PORTE |= (1 << 7); }MACROE
+
+ #define USB_Host_VBUS_Auto_Off() MACROS{ OTGCON |= (1 << VBUSRQC); }MACROE
+ #define USB_Host_VBUS_Manual_Off() MACROS{ PORTE &= ~(1 << 7); }MACROE
+
+ #define USB_Host_SetDeviceAddress(addr) MACROS{ UHADDR = (addr & 0b01111111); }MACROE
+
+ /* Enums: */
+ enum USB_Host_WaitMSErrorCodes_t
+ {
+ HOST_WAITERROR_Successful = 0,
+ HOST_WAITERROR_DeviceDisconnect = 1,
+ HOST_WAITERROR_PipeError = 2,
+ HOST_WAITERROR_SetupStalled = 3,
+ };
+
+ /* Function Prototypes: */
+ uint8_t USB_Host_WaitMS(uint8_t MS);
+ void USB_Host_ResetDevice(void);
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.c
new file mode 100644
index 00000000..8a584964
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.c
@@ -0,0 +1,175 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBMode.h"
+#if defined(USB_CAN_BE_HOST)
+
+#define INCLUDE_FROM_HOSTCHAPTER9_C
+#include "HostChapter9.h"
+
+USB_Host_Request_Header_t USB_HostRequest;
+
+uint8_t USB_Host_SendControlRequest(void* BufferPtr)
+{
+ uint8_t* HeaderStream = (uint8_t*)&USB_HostRequest;
+ uint8_t* DataStream = (uint8_t*)BufferPtr;
+ bool BusSuspended = USB_Host_IsBusSuspended();
+ uint8_t ReturnStatus = HOST_SENDCONTROL_Successful;
+ uint16_t DataLen = USB_HostRequest.wLength;
+
+ USB_Host_ResumeBus();
+
+ if ((ReturnStatus = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
+ return ReturnStatus;
+
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+ Pipe_SetToken(PIPE_TOKEN_SETUP);
+ Pipe_ClearErrorFlags();
+ Pipe_ClearSetupSent();
+
+ Pipe_Unfreeze();
+
+ for (uint8_t HeaderByte = 0; HeaderByte < sizeof(USB_Host_Request_Header_t); HeaderByte++)
+ Pipe_Write_Byte(*(HeaderStream++));
+
+ Pipe_ClearSetupOUT();
+
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_SetupSent)))
+ goto End_Of_Control_Send;
+
+ Pipe_ClearSetupSent();
+ Pipe_Freeze();
+
+ if ((ReturnStatus = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
+ goto End_Of_Control_Send;
+
+ if ((USB_HostRequest.bmRequestType & CONTROL_REQTYPE_DIRECTION) == REQDIR_DEVICETOHOST)
+ {
+ Pipe_SetToken(PIPE_TOKEN_IN);
+
+ if (DataStream != NULL)
+ {
+ while (DataLen)
+ {
+ Pipe_Unfreeze();
+
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_InReceived)))
+ goto End_Of_Control_Send;
+
+ if (!(Pipe_BytesInPipe()))
+ DataLen = 0;
+
+ while (Pipe_BytesInPipe() && DataLen)
+ {
+ *(DataStream++) = Pipe_Read_Byte();
+ DataLen--;
+ }
+
+ Pipe_Freeze();
+ Pipe_ClearSetupIN();
+ }
+ }
+
+ Pipe_SetToken(PIPE_TOKEN_OUT);
+ Pipe_Unfreeze();
+
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))
+ goto End_Of_Control_Send;
+
+ Pipe_ClearSetupOUT();
+ }
+ else
+ {
+ if (DataStream != NULL)
+ {
+ Pipe_SetToken(PIPE_TOKEN_OUT);
+ Pipe_Unfreeze();
+
+ while (DataLen)
+ {
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))
+ goto End_Of_Control_Send;
+
+ while (DataLen && (Pipe_BytesInPipe() < USB_ControlPipeSize))
+ {
+ Pipe_Write_Byte(*(DataStream++));
+ DataLen--;
+ }
+
+ Pipe_ClearSetupOUT();
+ }
+
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_OutReady)))
+ goto End_Of_Control_Send;
+
+ Pipe_Freeze();
+ }
+
+ Pipe_SetToken(PIPE_TOKEN_IN);
+ Pipe_Unfreeze();
+
+ if ((ReturnStatus = USB_Host_Wait_For_Setup_IOS(USB_HOST_WAITFOR_InReceived)))
+ goto End_Of_Control_Send;
+
+ Pipe_ClearSetupIN();
+ }
+
+End_Of_Control_Send:
+ Pipe_Freeze();
+
+ if (BusSuspended)
+ USB_Host_SuspendBus();
+
+ Pipe_ResetPipe(PIPE_CONTROLPIPE);
+
+ return ReturnStatus;
+}
+
+static uint8_t USB_Host_Wait_For_Setup_IOS(const uint8_t WaitType)
+{
+ uint16_t TimeoutCounter = USB_HOST_TIMEOUT_MS;
+
+ while (!(((WaitType == USB_HOST_WAITFOR_SetupSent) && Pipe_IsSetupSent()) ||
+ ((WaitType == USB_HOST_WAITFOR_InReceived) && Pipe_IsSetupINReceived()) ||
+ ((WaitType == USB_HOST_WAITFOR_OutReady) && Pipe_IsSetupOUTReady())))
+ {
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
+ return ErrorCode;
+
+ if (!(TimeoutCounter--))
+ return HOST_SENDCONTROL_SoftwareTimeOut;
+ }
+
+ return HOST_SENDCONTROL_Successful;
+}
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.h
new file mode 100644
index 00000000..1ca4343a
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/HostChapter9.h
@@ -0,0 +1,127 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Module for host mode request processing. This module allows for the transmission of standard, class and
+ * vendor control requests to the default control endpoint of an attached device while in host mode.
+ *
+ * \see Chapter 9 of the USB 2.0 specification.
+ */
+
+#ifndef __HOSTCHAPTER9_H__
+#define __HOSTCHAPTER9_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "LowLevel.h"
+ #include "StdRequestType.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Type Defines: */
+ /** Type define for a standard USB control request.
+ *
+ * \see StdRequestType.h for information on the request type and data.
+ * \see The USB 2.0 specification for more information on standard control requests.
+ */
+ typedef struct
+ {
+ uint8_t bmRequestType; /**< Type of the request. */
+ uint8_t bRequest; /**< Request command code. */
+ uint16_t wValue; /**< wValue parameter of the request. */
+ uint16_t wIndex; /**< wIndex parameter of the request. */
+ uint16_t wLength; /**< Length of the data to transfer in bytes. */
+ } USB_Host_Request_Header_t;
+
+ /* Enums: */
+ /** Enum for the USB_Host_SendControlRequest() return code, indicating the reason for the error
+ * if the transfer of the request is unsuccessful.
+ */
+ enum USB_Host_SendControlErrorCodes_t
+ {
+ HOST_SENDCONTROL_Successful = 0, /**< No error occurred in the request transfer. */
+ HOST_SENDCONTROL_DeviceDisconnect = 1, /**< The attached device was disconnected during the
+ * request transfer.
+ */
+ HOST_SENDCONTROL_PipeError = 2, /**< An error occured in the pipe while sending the request. */
+ HOST_SENDCONTROL_SetupStalled = 3, /**< The attached device stalled the request, usually
+ * indicating that the request is unsupported on the device.
+ */
+ HOST_SENDCONTROL_SoftwareTimeOut = 4, /**< The request or data transfer timed out. */
+ };
+
+ /* Global Variables: */
+ /** Global for the request to send via the USB_Host_SendControlRequest() function. This
+ * global should be filled with the correct control request data before sending the request to
+ * the attached device while in host mode.
+ */
+ extern USB_Host_Request_Header_t USB_HostRequest;
+
+ /* Function Prototypes: */
+ /** Sends the request stored in the USB_HostRequest global structure to the attached device,
+ * and transfers the data stored in the buffer to the device, or from the device to the buffer
+ * as requested.
+ *
+ * \param BufferPtr Pointer to the start of the data buffer if the request has a data stage, or
+ * NULL if the request transfers no data to or from the device.
+ *
+ * \return A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
+ */
+ uint8_t USB_Host_SendControlRequest(void* BufferPtr);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Enums: */
+ enum USB_WaitForTypes_t
+ {
+ USB_HOST_WAITFOR_SetupSent,
+ USB_HOST_WAITFOR_InReceived,
+ USB_HOST_WAITFOR_OutReady,
+ };
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_HOSTCHAPTER9_C)
+ static uint8_t USB_Host_Wait_For_Setup_IOS(const uint8_t WaitType);
+ #endif
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.c
new file mode 100644
index 00000000..61acf6de
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.c
@@ -0,0 +1,260 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "USBMode.h"
+
+#include "LowLevel.h"
+
+#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))
+volatile uint8_t USB_CurrentMode = USB_MODE_NONE;
+#endif
+
+#if !defined(USE_STATIC_OPTIONS)
+volatile uint8_t USB_Options;
+#endif
+
+void USB_Init(
+ #if defined(USB_CAN_BE_BOTH)
+ const uint8_t Mode
+ #endif
+
+ #if (defined(USB_CAN_BE_BOTH) && !defined(USE_STATIC_OPTIONS))
+ ,
+ #elif (!defined(USB_CAN_BE_BOTH) && defined(USE_STATIC_OPTIONS))
+ void
+ #endif
+
+ #if !defined(USE_STATIC_OPTIONS)
+ const uint8_t Options
+ #endif
+ )
+{
+ USB_ShutDown();
+
+ #if defined(USB_CAN_BE_BOTH)
+ USB_CurrentMode = Mode;
+ #endif
+
+ #if !defined(USE_STATIC_OPTIONS)
+ USB_Options = Options;
+ #endif
+
+ #if defined(USB_CAN_BE_HOST)
+ USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
+ #endif
+
+ #if defined(USB_DEVICE_ONLY) && defined(USB_FULL_CONTROLLER)
+ UHWCON |= (1 << UIMOD);
+ #elif defined(USB_HOST_ONLY)
+ UHWCON &= ~(1 << UIMOD);
+ #elif defined(USB_CAN_BE_BOTH)
+ if (Mode == USB_MODE_UID)
+ {
+ UHWCON |= (1 << UIDE);
+
+ USB_INT_Clear(USB_INT_IDTI);
+ USB_INT_Enable(USB_INT_IDTI);
+
+ USB_CurrentMode = USB_GetUSBModeFromUID();
+ }
+ else if (Mode == USB_MODE_DEVICE)
+ {
+ UHWCON |= (1 << UIMOD);
+ }
+ else if (Mode == USB_MODE_HOST)
+ {
+ UHWCON &= ~(1 << UIMOD);
+ }
+ else
+ {
+ RAISE_EVENT(USB_PowerOnFail, POWERON_ERROR_NoUSBModeSpecified);
+ return;
+ }
+ #endif
+
+ USB_ResetInterface();
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ USB_OTGPAD_On();
+ #endif
+
+ USB_IsInitialized = true;
+
+ sei();
+}
+
+void USB_ShutDown(void)
+{
+ if (USB_IsConnected)
+ RAISE_EVENT(USB_Disconnect);
+
+ USB_Detach();
+
+ USB_INT_DisableAllInterrupts();
+ USB_INT_ClearAllInterrupts();
+
+ USB_IsConnected = false;
+ USB_IsInitialized = false;
+
+ #if defined(USB_CAN_BE_HOST)
+ USB_HostState = HOST_STATE_Unattached;
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ USB_ConfigurationNumber = 0;
+ #endif
+
+ #if defined(CAN_BE_BOTH)
+ USB_CurrentMode = USB_MODE_NONE;
+ #endif
+
+ USB_Interface_Disable();
+ USB_PLL_Off();
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ USB_OTGPAD_Off();
+ #endif
+
+ #if defined(USB_CAN_BE_BOTH)
+ UHWCON &= ~(1 << UIDE);
+ #endif
+}
+
+void USB_ResetInterface(void)
+{
+ USB_INT_DisableAllInterrupts();
+ USB_INT_ClearAllInterrupts();
+
+ USB_IsConnected = false;
+
+ #if defined(USB_CAN_BE_HOST)
+ USB_HostState = HOST_STATE_Unattached;
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ USB_ConfigurationNumber = 0;
+ USB_IsSuspended = false;
+ USB_RemoteWakeupEnabled = false;
+ USB_CurrentlySelfPowered = false;
+ #endif
+
+ if (!(USB_Options & USB_OPT_MANUAL_PLL))
+ {
+ #if defined(USB_MODIFIED_FULL_CONTROLLER)
+ PLLFRQ = ((1 << PLLUSB) | (1 << PDIV3) | (1 << PDIV1));
+ #endif
+
+ USB_PLL_On();
+ while (!(USB_PLL_IsReady()));
+ }
+
+ USB_Interface_Reset();
+
+ #if defined(USB_CAN_BE_BOTH)
+ if (UHWCON & (1 << UIDE))
+ {
+ USB_INT_Clear(USB_INT_IDTI);
+ USB_INT_Enable(USB_INT_IDTI);
+ USB_CurrentMode = USB_GetUSBModeFromUID();
+ }
+ #endif
+
+ if (!(USB_Options & USB_OPT_REG_DISABLED))
+ USB_REG_On();
+
+ USB_CLK_Unfreeze();
+
+ #if (defined(USB_CAN_BE_DEVICE) && (defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)))
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ {
+ if (USB_Options & USB_DEVICE_OPT_LOWSPEED)
+ USB_Device_SetLowSpeed();
+ else
+ USB_Device_SetHighSpeed();
+
+ USB_INT_Enable(USB_INT_VBUS);
+ }
+ #endif
+
+ #if (defined(USB_CAN_BE_DEVICE) && !defined(FIXED_CONTROL_ENDPOINT_SIZE))
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ {
+ USB_Descriptor_Device_t* DeviceDescriptorPtr;
+
+ if (USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)
+ {
+ #if defined(USE_RAM_DESCRIPTORS)
+ USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
+ #elif defined(USE_EEPROM_DESCRIPTORS)
+ USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+ #else
+ USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+ #endif
+ }
+ }
+ #endif
+
+ USB_Attach();
+
+ #if defined(USB_DEVICE_ONLY)
+ USB_INT_Enable(USB_INT_SUSPEND);
+ USB_INT_Enable(USB_INT_EORSTI);
+ #elif defined(USB_HOST_ONLY)
+ USB_Host_HostMode_On();
+
+ USB_Host_VBUS_Auto_Off();
+ USB_OTGPAD_Off();
+
+ USB_Host_VBUS_Manual_Enable();
+ USB_Host_VBUS_Manual_On();
+
+ USB_INT_Enable(USB_INT_SRPI);
+ USB_INT_Enable(USB_INT_BCERRI);
+ #else
+ if (USB_CurrentMode == USB_MODE_DEVICE)
+ {
+ USB_INT_Enable(USB_INT_SUSPEND);
+ USB_INT_Enable(USB_INT_EORSTI);
+ }
+ else if (USB_CurrentMode == USB_MODE_HOST)
+ {
+ USB_Host_HostMode_On();
+
+ USB_Host_VBUS_Auto_Off();
+ USB_OTGPAD_Off();
+
+ USB_Host_VBUS_Manual_Enable();
+ USB_Host_VBUS_Manual_On();
+
+ USB_INT_Enable(USB_INT_SRPI);
+ USB_INT_Enable(USB_INT_BCERRI);
+ }
+ #endif
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.h
new file mode 100644
index 00000000..faafbd7b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/LowLevel.h
@@ -0,0 +1,371 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main low level USB driver. This module manages the low level initialization and shut down of the USB AVR's
+ * USB interface in either device or (if supported) host mode.
+ */
+
+#ifndef __USBLOWLEVEL_H__
+#define __USBLOWLEVEL_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+
+ #include "USBMode.h"
+ #include "../../../Common/Common.h"
+ #include "../HighLevel/Events.h"
+ #include "../HighLevel/USBTask.h"
+ #include "../HighLevel/USBInterrupt.h"
+
+ #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
+ #include "Host.h"
+ #include "Pipe.h"
+ #include "OTG.h"
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
+ #include "Device.h"
+ #include "Endpoint.h"
+ #include "DevChapter9.h"
+ #endif
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Preprocessor Checks and Defines: */
+ #if (F_CPU == 8000000)
+ #if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))
+ #define USB_PLL_PSC 0
+ #elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || \
+ defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || \
+ defined(__AVR_ATmega32U6__))
+ #define USB_PLL_PSC ((1 << PLLP1) | (1 << PLLP0))
+ #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
+ #define USB_PLL_PSC 0
+ #endif
+ #elif (F_CPU == 16000000)
+ #if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_ATmega32U6__))
+ #define USB_PLL_PSC ((1 << PLLP2) | (1 << PLLP1))
+ #elif (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__))
+ #define USB_PLL_PSC ((1 << PLLP2) | (1 << PLLP0))
+ #elif (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))
+ #define USB_PLL_PSC (1 << PLLP0)
+ #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
+ #define USB_PLL_PSC (1 << PINDIV)
+ #endif
+ #endif
+
+ #if !defined(USB_PLL_PSC)
+ #error No PLL prescale value available for chosen F_CPU value and AVR model.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mode mask for the USB_CurrentMode global. This indicates that the USB interface is currently not
+ * initialized into any mode.
+ */
+ #define USB_MODE_NONE 0
+
+ /** Mode mask for the USB_CurrentMode global and the USB_Init() function. This indicates that the
+ * USB interface is or should be initialized in the USB device mode.
+ */
+ #define USB_MODE_DEVICE 1
+
+ /** Mode mask for the USB_CurrentMode global and the USB_Init() function. This indicates that the
+ * USB interface is or should be initialized in the USB host mode.
+ *
+ * \note Not all USB AVRs support host mode.
+ */
+ #define USB_MODE_HOST 2
+
+ /** Mode mask for the the USB_Init() function. This indicates that the USB interface should be
+ * initialized into whatever mode the UID pin of the USB AVR indicates, and that the device
+ * should swap over its mode when the level of the UID pin changes during operation.
+ *
+ * \note Not all USB AVRs support host mode, and thus UID mode.
+ */
+ #define USB_MODE_UID 3
+
+ /** Regulator disable option mask for USB_Init(). This indicates that the internal 3.3V USB data pad
+ * regulator should be enabled to regulate the data pin voltages to within the USB standard.
+ *
+ * \note See USB AVR data sheet for more information on the internal pad regulator.
+ */
+ #define USB_OPT_REG_DISABLED (1 << 1)
+
+ /** Regulator enable option mask for USB_Init(). This indicates that the internal 3.3V USB data pad
+ * regulator should be disabled and the AVR's VCC level used for the data pads.
+ *
+ * \note See USB AVR data sheet for more information on the internal pad regulator.
+ */
+ #define USB_OPT_REG_ENABLED (0 << 1)
+
+ /** Manual PLL control option mask for USB_Init(). This indicates to the library that the user application
+ * will take full responsibility for controlling the AVR's PLL (used to generate the high frequency clock
+ * that the USB controller requires) and ensuring that it is locked at the correct frequency for USB operations.
+ */
+ #define USB_OPT_MANUAL_PLL (1 << 2)
+
+ /** Automatic PLL control option mask for USB_Init(). This indicates to the library that the library should
+ * take full responsibility for controlling the AVR's PLL (used to generate the high frequency clock
+ * that the USB controller requires) and ensuring that it is locked at the correct frequency for USB operations.
+ */
+ #define USB_OPT_AUTO_PLL (0 << 2)
+
+ /** Mask for a CONTROL type endpoint or pipe.
+ *
+ * \note See Endpoint.h and Pipe.h headers for endpoint/pipe functions.
+ */
+ #define EP_TYPE_CONTROL 0b00
+
+ /** Mask for an ISOCHRONOUS type endpoint or pipe.
+ *
+ * \note See Endpoint.h and Pipe.h headers for endpoint/pipe functions.
+ */
+ #define EP_TYPE_ISOCHRONOUS 0b01
+
+ /** Mask for a BULK type endpoint or pipe.
+ *
+ * \note See Endpoint.h and Pipe.h headers for endpoint/pipe functions.
+ */
+ #define EP_TYPE_BULK 0b10
+
+ /** Mask for an INTERRUPT type endpoint or pipe.
+ *
+ * \note See Endpoint.h and Pipe.h headers for endpoint/pipe functions.
+ */
+ #define EP_TYPE_INTERRUPT 0b11
+
+ /** Mask for determining the type of an endpoint or pipe. This should then be compared with the
+ * EP_TYPE_* macros elsewhere in this module to determine the exact type of the endpoint or pipe.
+ *
+ * \note See Endpoint.h and Pipe.h headers for endpoint/pipe functions.
+ */
+ #define EP_TYPE_MASK 0b11
+
+ /** Returns boolean true if the VBUS line is currently high (i.e. the USB host is supplying power),
+ * otherwise returns false.
+ */
+ #define USB_VBUS_GetStatus() ((USBSTA & (1 << VBUS)) ? true : false)
+
+ /** Detaches the device from the USB bus. This has the effect of removing the device from any
+ * host if, ceasing USB communications. If no host is present, this prevents any host from
+ * enumerating the device once attached until USB_Attach() is called.
+ */
+ #define USB_Detach() MACROS{ UDCON |= (1 << DETACH); }MACROE
+
+ /** Attaches the device to the USB bus. This announces the device's presence to any attached
+ * USB host, starting the enumeration process. If no host is present, attaching the device
+ * will allow for enumeration once a host is connected to the device.
+ *
+ * This is inexplicably also required for proper operation while in host mode, to enable the
+ * attachment of a device to the host. This is despite the bit being located in the device-mode
+ * register and despite the datasheet making no mention of its requirement in host mode.
+ */
+ #define USB_Attach() MACROS{ UDCON &= ~(1 << DETACH); }MACROE
+
+ #if !defined(USB_STREAM_TIMEOUT_MS) || defined(__DOXYGEN__)
+ /** Constant for the maximum software timeout period of the USB data stream transfer functions
+ * (both control and standard) when in either device or host mode. If the next packet of a stream
+ * is not received or acknowedged within this time period, the stream function will fail.
+ *
+ * This value may be overridden in the user project makefile as the value of the
+ * USB_STREAM_TIMEOUT_MS token, and passed to the compiler using the -D switch.
+ */
+ #define USB_STREAM_TIMEOUT_MS 100
+ #endif
+
+ /* Function Prototypes: */
+ /** Main function to initialize and start the USB interface. Once active, the USB interface will
+ * allow for device connection to a host when in device mode, or for device enumeration while in
+ * host mode.
+ *
+ * As the USB library relies on USB interrupts for some of its functionality, this routine will
+ * enable global interrupts.
+ *
+ * Calling this function when the USB interface is already initialized will cause a complete USB
+ * interface reset and re-enumeration.
+ *
+ * \param Mode This is a mask indicating what mode the USB interface is to be initialized to.
+ * Valid mode masks are USB_MODE_DEVICE, USB_MODE_HOST or USB_MODE_UID.
+ *
+ * \param Options Mask indicating the options which should be used when initializing the USB
+ * interface to control the USB interface's behaviour. This should be comprised of
+ * a USB_OPT_REG_* mask to control the regulator, a USB_OPT_*_PLL mask to control the
+ * PLL, and a USB_DEVICE_OPT_* mask (when the device mode is enabled) to set the device
+ * mode speed.
+ *
+ * \note To reduce the FLASH requirements of the library if only device or host mode is required,
+ * this can be statically set via defining the token USB_DEVICE_ONLY for device mode or
+ * USB_HOST_ONLY for host mode in the use project makefile, passing the token to the compiler
+ * via the -D switch. If the mode is statically set, this parameter does not exist in the
+ * function prototype.
+ *
+ * \note To reduce the FLASH requirements of the library if only fixed settings are are required,
+ * the options may be set statically in the same manner as the mode (see the Mode parameter of
+ * this function). To statically set the USB options, pass in the USE_STATIC_OPTIONS token,
+ * defined to the appropriate options masks. When the options are statically set, this
+ * parameter does not exist in the function prototype.
+ *
+ * \note The mode parameter does not exist on devices where only one mode is possible, such as USB
+ * AVR models which only implement the USB device mode in hardware.
+ *
+ * \see Device.h for the USB_DEVICE_OPT_* masks.
+ */
+ void USB_Init(
+ #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
+ const uint8_t Mode
+ #endif
+
+ #if (defined(USB_CAN_BE_BOTH) && !defined(USE_STATIC_OPTIONS)) || defined(__DOXYGEN__)
+ ,
+ #elif (!defined(USB_CAN_BE_BOTH) && defined(USE_STATIC_OPTIONS))
+ void
+ #endif
+
+ #if !defined(USE_STATIC_OPTIONS) || defined(__DOXYGEN__)
+ const uint8_t Options
+ #endif
+ );
+
+ /** Shuts down the USB interface. This turns off the USB interface after deallocating all USB FIFO
+ * memory, endpoints and pipes. When turned off, no USB functionality can be used until the interface
+ * is restarted with the USB_Init() function.
+ */
+ void USB_ShutDown(void);
+
+ /** Resets the interface, when already initialized. This will re-enumerate the device if already connected
+ * to a host, or re-enumerate an already attached device when in host mode.
+ */
+ void USB_ResetInterface(void);
+
+ /* Enums: */
+ /** Enum for error codes relating to the powering on of the USB interface. These error codes are
+ * used in the ErrorCode parameter value of the USB_PowerOnFail event.
+ */
+ enum USB_PowerOnErrorCodes_t
+ {
+ POWERON_ERROR_NoUSBModeSpecified = 0, /**< Indicates that USB_Init() was called with an
+ * invalid or missing Mode parameter.
+ */
+ };
+
+ /* Global Variables: */
+ #if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY)) || defined(__DOXYGEN__)
+ /** Indicates the mode that the USB interface is currently initialized to. This value will be
+ * one of the USB_MODE_* masks defined elsewhere in this module.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern volatile uint8_t USB_CurrentMode;
+ #endif
+
+ #if !defined(USE_STATIC_OPTIONS) || defined(__DOXYGEN__)
+ extern volatile uint8_t USB_Options;
+ /** Indicates the current USB options that the USB interface was initialized with when USB_Init()
+ * was called. This value will be one of the USB_MODE_* masks defined elsewhere in this module.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ #endif
+
+ /* Throwable Events: */
+ /** This module raises the USB_Disconnect event if the USB interface is reset (such as during a mode
+ * change while in UID mode) while the USB interface is connected to a device when in host mode, or
+ * a host while in device mode.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_Disconnect);
+
+ #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
+ /** This module raises the Power On Failure event when an error occurs while initializing the USB
+ * interface.
+ *
+ * \see Events.h for more information on this event.
+ */
+ RAISES_EVENT(USB_PowerOnFail);
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define USB_PLL_On() MACROS{ PLLCSR = USB_PLL_PSC; PLLCSR |= (1 << PLLE); }MACROE
+ #define USB_PLL_Off() MACROS{ PLLCSR = 0; }MACROE
+ #define USB_PLL_IsReady() ((PLLCSR & (1 << PLOCK)) ? true : false)
+
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
+ #define USB_REG_On() MACROS{ UHWCON |= (1 << UVREGE); }MACROE
+ #define USB_REG_Off() MACROS{ UHWCON &= ~(1 << UVREGE); }MACROE
+ #else
+ #define USB_REG_On() MACROS{ REGCR &= ~(1 << REGDIS); }MACROE
+ #define USB_REG_Off() MACROS{ REGCR |= (1 << REGDIS); }MACROE
+ #endif
+
+ #define USB_OTGPAD_On() MACROS{ USBCON |= (1 << OTGPADE); }MACROE
+ #define USB_OTGPAD_Off() MACROS{ USBCON &= ~(1 << OTGPADE); }MACROE
+
+ #define USB_CLK_Freeze() MACROS{ USBCON |= (1 << FRZCLK); }MACROE
+ #define USB_CLK_Unfreeze() MACROS{ USBCON &= ~(1 << FRZCLK); }MACROE
+
+ #define USB_Interface_Enable() MACROS{ USBCON |= (1 << USBE); }MACROE
+ #define USB_Interface_Disable() MACROS{ USBCON &= ~(1 << USBE); }MACROE
+ #define USB_Interface_Reset() MACROS{ uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \
+ USBCON = (Temp | (1 << USBE)); }MACROE
+
+ /* Inline Functions: */
+ static inline uint8_t USB_GetUSBModeFromUID(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t USB_GetUSBModeFromUID(void)
+ {
+ #if (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__))
+ if (USBSTA & (1 << ID))
+ return USB_MODE_DEVICE;
+ else
+ return USB_MODE_HOST;
+ #else
+ return USB_MODE_DEVICE;
+ #endif
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/OTG.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/OTG.h
new file mode 100644
index 00000000..e1a92f1e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/OTG.h
@@ -0,0 +1,102 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Macros for embedded USB hosts with dual role On The Go capabilities, for managing role exchange. OTG
+ * is a way for two USB dual role devices to talk to one another directly without fixed device/host roles.
+ *
+ * \note These macros are only for AVRs which support the OTG protocol, and do not exist for device-only AVRs.
+ */
+
+#ifndef __USBOTG_H__
+#define __USBOTG_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Initiate a Host Negotiation Protocol request. This indicates to the other connected device
+ * that the device wishes to change device/host roles.
+ */
+ #define USB_OTG_DEV_Request_HNP() MACROS{ OTGCON |= (1 << HNPREQ); }MACROE
+
+ /** Cancel a Host Negotiation Protocol request. This stops a pending HNP request to the other
+ * connected device.
+ */
+ #define USB_OTG_DEV_Cancel_HNP_Request() MACROS{ OTGCON &= ~(1 << HNPREQ); }MACROE
+
+ /** Returns boolean false if not currently sending a HNP to the other connected device, or true
+ * if a HNP is currently being issued.
+ */
+ #define USB_OTG_DEV_IsSendingHNP() ((OTGCON & (1 << HNPREQ)) ? true : false)
+
+ /** Accepts a HNP from a connected device, indicating that both devices should exchange
+ * device/host roles.
+ */
+ #define USB_OTG_HOST_Accept_HNP() USB_OTG_DEV_Request_HNP()
+
+ /** Rejects a HNP from a connected device, indicating that both devices should remain in their
+ * current device/host roles.
+ */
+ #define USB_OTG_HOST_Reject_HNP() USB_OTG_DEV_Cancel_HNP_Request()
+
+ /** Returns boolean false if the connected device is not currently sending a HNP request, or true
+ * if a HNP is currently being issued by the connected device.
+ */
+ #define USB_OTG_HOST_IsHNPReceived() ((OTGCON & (1 << HNPREQ)) ? true : false)
+
+ /** Initiates a Session Request Protocol request. Most OTG devices turn off VBUS when the USB
+ * interface is not in use, to conserve power. Sending a SRP to a USB OTG device running in
+ * host mode indicates that VBUS should be applied and a session started.
+ *
+ * There are two different methods of sending a SRP - either pulses on the VBUS line, or by
+ * pulsing the Data + line via the internal pullup resistor. The SRP mode is given as the
+ * "type" parameter, and can be either USB_OTG_SRP_VBUS or USB_OTG_STP_DATA.
+ */
+ #define USB_OTG_DEV_Initiate_SRP(type) MACROS{ OTGCON = ((OTGCON & ~(1 << SRPSEL)) | (type | (1 << SRPREQ))); }MACROE
+
+ /** Mask for the VBUS pulsing method of SRP, supported by some OTG devices.
+ *
+ * \see USB_OTG_DEV_Initiate_SRP()
+ */
+ #define USB_OTG_SRP_VBUS (1 << SRPSEL)
+
+ /** Mask for the Data + pulsing method of SRP, supported by some OTG devices.
+ *
+ * \see USB_OTG_DEV_Initiate_SRP()
+ */
+ #define USB_OTG_STP_DATA 0
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.c b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.c
new file mode 100644
index 00000000..743bb91f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -0,0 +1,258 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+#include "USBMode.h"
+#if defined(USB_CAN_BE_HOST)
+
+#define INCLUDE_FROM_PIPE_C
+#include "Pipe.h"
+
+uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
+
+bool Pipe_ConfigurePipe(const uint8_t Number, const uint8_t Type, const uint8_t Token, const uint8_t EndpointNumber,
+ const uint16_t Size, const uint8_t Banks)
+{
+ Pipe_SelectPipe(Number);
+ Pipe_EnablePipe();
+
+ UPCFG1X = 0;
+
+ UPCFG0X = ((Type << EPTYPE0) | Token | (EndpointNumber << PEPNUM0));
+ UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
+
+ return Pipe_IsConfigured();
+}
+
+void Pipe_ClearPipes(void)
+{
+ UPINT = 0;
+
+ for (uint8_t PNum = 0; PNum < PIPE_TOTAL_PIPES; PNum++)
+ {
+ Pipe_ResetPipe(PNum);
+ Pipe_SelectPipe(PNum);
+ UPIENX = 0;
+ UPINTX = 0;
+ Pipe_ClearError();
+ Pipe_ClearErrorFlags();
+ Pipe_DeallocateMemory();
+ Pipe_DisablePipe();
+ }
+}
+
+uint8_t Pipe_WaitUntilReady(void)
+{
+ uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
+
+ USB_INT_Clear(USB_INT_HSOFI);
+
+ while (!(Pipe_ReadWriteAllowed()))
+ {
+ if (Pipe_IsStalled())
+ return PIPE_READYWAIT_PipeStalled;
+ else if (!(USB_IsConnected))
+ return PIPE_READYWAIT_DeviceDisconnected;
+
+ if (USB_INT_HasOccurred(USB_INT_HSOFI))
+ {
+ USB_INT_Clear(USB_INT_HSOFI);
+
+ if (!(TimeoutMSRem--))
+ return PIPE_READYWAIT_Timeout;
+ }
+ }
+
+ return PIPE_READYWAIT_NoError;
+}
+
+uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)Data;
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Pipe_ReadWriteAllowed()))
+ {
+ Pipe_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return PIPE_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Pipe_Write_Byte(*(DataStream++));
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)(Data + Length - 1);
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Pipe_ReadWriteAllowed()))
+ {
+ Pipe_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return PIPE_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Pipe_Write_Byte(*(DataStream--));
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Pipe_Discard_Stream(uint16_t Length
+#if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Pipe_ReadWriteAllowed()))
+ {
+ Pipe_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return PIPE_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ Pipe_Discard_Byte();
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)Buffer;
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Pipe_ReadWriteAllowed()))
+ {
+ Pipe_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return PIPE_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ *(DataStream++) = Pipe_Read_Byte();
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS)
+ , uint8_t (* const Callback)(void)
+#endif
+ )
+{
+ uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
+ uint8_t ErrorCode;
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+
+ while (Length--)
+ {
+ if (!(Pipe_ReadWriteAllowed()))
+ {
+ Pipe_ClearCurrentBank();
+
+ #if !defined(NO_STREAM_CALLBACKS)
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
+ return PIPE_RWSTREAM_ERROR_CallbackAborted;
+ #endif
+
+ if ((ErrorCode = Pipe_WaitUntilReady()))
+ return ErrorCode;
+ }
+
+ *(DataStream--) = Pipe_Read_Byte();
+ }
+
+ return PIPE_RWSTREAM_ERROR_NoError;
+}
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.h
new file mode 100644
index 00000000..a1f28ccc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/Pipe.h
@@ -0,0 +1,788 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Functions, macros and enums related to pipe management when in USB Host mode. This
+ * module contains the pipe management macros, as well as pipe interrupt and data
+ * send/recieve functions for various datatypes.
+ */
+
+#ifndef __PIPE_H__
+#define __PIPE_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include "../../../Common/Common.h"
+ #include "../HighLevel/USBTask.h"
+
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ #include "StreamCallbacks.h"
+ #endif
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for Pipe_GetErrorFlags(), indicating that a CRC error occurred in the pipe on the received data. */
+ #define PIPE_ERRORFLAG_CRC16 (1 << 4)
+
+ /** Mask for Pipe_GetErrorFlags(), indicating that a hardware timeout error occurred in the pipe. */
+ #define PIPE_ERRORFLAG_TIMEOUT (1 << 3)
+
+ /** Mask for Pipe_GetErrorFlags(), indicating that a hardware PID error occurred in the pipe. */
+ #define PIPE_ERRORFLAG_PID (1 << 2)
+
+ /** Mask for Pipe_GetErrorFlags(), indicating that a hardware data PID error occurred in the pipe. */
+ #define PIPE_ERRORFLAG_DATAPID (1 << 1)
+
+ /** Mask for Pipe_GetErrorFlags(), indicating that a hardware data toggle error occurred in the pipe. */
+ #define PIPE_ERRORFLAG_DATATGL (1 << 0)
+
+ /** Token mask for Pipe_ConfigurePipe(). This sets the pipe as a SETUP token (for CONTROL type pipes),
+ * which will trigger a control request on the attached device when data is written to the pipe.
+ */
+ #define PIPE_TOKEN_SETUP (0b00 << PTOKEN0)
+
+ /** Token mask for Pipe_ConfigurePipe(). This sets the pipe as a IN token (for non-CONTROL type pipes),
+ * indicating that the pipe data will flow from device to host.
+ */
+ #define PIPE_TOKEN_IN (0b01 << PTOKEN0)
+
+ /** Token mask for Pipe_ConfigurePipe(). This sets the pipe as a IN token (for non-CONTROL type pipes),
+ * indicating that the pipe data will flow from host to device.
+ */
+ #define PIPE_TOKEN_OUT (0b10 << PTOKEN0)
+
+ /** Mask for the bank mode selection for the Pipe_ConfigurePipe() macro. This indicates that the pipe
+ * should have one single bank, which requires less USB FIFO memory but results in slower transfers as
+ * only one USB device (the AVR or the attached device) can access the pipe's bank at the one time.
+ */
+ #define PIPE_BANK_SINGLE 0
+
+ /** Mask for the bank mode selection for the Pipe_ConfigurePipe() macro. This indicates that the pipe
+ * should have two banks, which requires more USB FIFO memory but results in faster transfers as one
+ * USB device (the AVR or the attached device) can access one bank while the other accesses the second
+ * bank.
+ */
+ #define PIPE_BANK_DOUBLE (1 << EPBK0)
+
+ /** Pipe address for the default control pipe, which always resides in address 0. This is
+ * defined for convenience to give more readable code when used with the pipe macros.
+ */
+ #define PIPE_CONTROLPIPE 0
+
+ /** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
+ * in the device descriptor of the attached device.
+ */
+ #define PIPE_CONTROLPIPE_DEFAULT_SIZE 8
+
+ /** Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address
+ * in the device.
+ */
+ #define PIPE_PIPENUM_MASK 0x07
+
+ /** Total number of pipes (including the default control pipe at address 0) which may be used in
+ * the device. Different USB AVR models support different amounts of pipes, this value reflects
+ * the maximum number of pipes for the currently selected AVR model.
+ */
+ #define PIPE_TOTAL_PIPES 7
+
+ /** Size in bytes of the largest pipe bank size possible in the device. Not all banks on each AVR
+ * model supports the largest bank size possible on the device; different pipe numbers support
+ * different maximum bank sizes. This value reflects the largest possible bank of any pipe on the
+ * currently selected USB AVR model.
+ */
+ #define PIPE_MAX_SIZE 256
+
+ /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
+ * numerical address in the attached device.
+ */
+ #define PIPE_EPNUM_MASK 0x07
+
+ /** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's
+ * bank size in the attached device.
+ */
+ #define PIPE_EPSIZE_MASK 0x7FF
+
+ /** Interrupt definition for the pipe IN interrupt (for INTERRUPT type pipes). Should be used with
+ * the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on an INTERRUPT type pipe if the pipe interrupt period has
+ * elapsed and the pipe is ready for the next packet from the attached device to be read out from its
+ * FIFO buffer (if received).
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.
+ */
+ #define PIPE_INT_IN UPIENX, (1 << RXINE) , UPINTX, (1 << RXINI)
+
+ /** Interrupt definition for the pipe OUT interrupt (for INTERRUPT type pipes). Should be used with
+ * the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the pipe interrupt period
+ * has elapsed and the pipe is ready for a packet to be written to the pipe's FIFO buffer and sent
+ * to the attached device (if required).
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. */
+ #define PIPE_INT_OUT UPIENX, (1 << TXOUTE), UPINTX, (1 << TXOUTI)
+
+ /** Interrupt definition for the pipe SETUP bank ready interrupt (for CONTROL type pipes). Should be
+ * used with the USB_INT_* macros located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on an CONTROL type pipe when the pipe is ready for a new
+ * control request.
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.
+ */
+ #define PIPE_INT_SETUP UPIENX, (1 << TXSTPE) , UPINTX, (1 << TXSTPI)
+
+ /** Interrupt definition for the pipe error interrupt. Should be used with the USB_INT_* macros
+ * located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on a particular pipe if an error occurs on that pipe, such
+ * as a CRC mismatch error.
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.
+ *
+ * \see Pipe_GetErrorFlags() for more information on the pipe errors.
+ */
+ #define PIPE_INT_ERROR UPIENX, (1 << PERRE), UPINTX, (1 << PERRI)
+
+ /** Interrupt definition for the pipe NAK received interrupt. Should be used with the USB_INT_* macros
+ * located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on a particular pipe if an attached device returns a NAK in
+ * response to a sent packet.
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.
+ *
+ * \see Pipe_IsNAKReceived() for more information on pipe NAKs.
+ */
+ #define PIPE_INT_NAK UPIENX, (1 << NAKEDE), UPINTX, (1 << NAKEDI)
+
+ /** Interrupt definition for the pipe STALL received interrupt. Should be used with the USB_INT_* macros
+ * located in USBInterrupt.h.
+ *
+ * This interrupt will fire if enabled on a particular pipe if an attached device returns a STALL on the
+ * currently selected pipe. This will also fire if the pipe is an isochronous pipe and a CRC error occurs.
+ *
+ * This interrupt must be enabled on *each* pipe which requires it (after the pipe is selected), and
+ * will fire the common pipe interrupt vector.
+ *
+ * \see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.
+ */
+ #define PIPE_INT_STALL UPIENX, (1 << RXSTALLE), UPINTX, (1 << RXSTALLI)
+
+ /** Indicates the number of bytes currently stored in the current pipe's selected bank. */
+ #define Pipe_BytesInPipe() UPBCX
+
+ /** Resets the desired pipe, including the pipe banks and flags. */
+ #define Pipe_ResetPipe(pipenum) MACROS{ UPRST = (1 << pipenum); UPRST = 0; }MACROE
+
+ /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be
+ * indicated will operate on the currently selected pipe.
+ */
+ #define Pipe_SelectPipe(pipenum) MACROS{ UPNUM = pipenum; }MACROE
+
+ /** Returns the pipe address of the currently selected pipe. This is typically used to save the
+ * currently selected pipe number so that it can be restored after another pipe has been manipulated.
+ */
+ #define Pipe_GetCurrentPipe() (UPNUM & PIPE_PIPENUM_MASK)
+
+ /** Enables the currently selected pipe so that data can be sent and received through it to and from
+ * an attached device.
+ *
+ * \note Pipes must first be configured properly rather than just being enabled via the
+ * Pipe_ConfigurePipe() macro, which calls Pipe_EnablePipe() automatically.
+ */
+ #define Pipe_EnablePipe() MACROS{ UPCONX |= (1 << PEN); }MACROE
+
+ /** Disables the currently selected pipe so that data cannot be sent and received through it to and
+ * from an attached device.
+ */
+ #define Pipe_DisablePipe() MACROS{ UPCONX &= ~(1 << PEN); }MACROE
+
+ /** Returns true if the currently selected pipe is enabled, false otherwise. */
+ #define Pipe_IsEnabled() ((UPCONX & (1 << PEN)) ? true : false)
+
+ /** Sets the token for the currently selected endpoint to one of the tokens specified by the PIPE_TOKEN_*
+ * masks. This should only be used on CONTROL type endpoints, to allow for bidirectional transfer of
+ * data during control requests.
+ */
+ #define Pipe_SetToken(token) MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | token); }MACROE
+
+ /** Configures the currently selected pipe to allow for an unlimited number of IN requests. */
+ #define Pipe_SetInfiniteINRequests() MACROS{ UPCONX |= (1 << INMODE); }MACROE
+
+ /** Configures the currently selected pipe to only allow the specified number of IN requests to be
+ * accepted by the pipe before it is automatically frozen.
+ */
+ #define Pipe_SetFiniteINRequests(n) MACROS{ UPCONX &= ~(1 << INMODE); UPINRQX = n; }MACROE
+
+ /** Returns true if the currently selected pipe is configured, false otherwise. */
+ #define Pipe_IsConfigured() ((UPSTAX & (1 << CFGOK)) ? true : false)
+
+ /** Sets the period between interrupts for an INTERRUPT type pipe to a specified number of milliseconds. */
+ #define Pipe_SetInterruptPeriod(ms) MACROS{ UPCFG2X = ms; }MACROE
+
+ /** Returns a mask indicating which pipe's interrupt periods have elapsed, indicating that the pipe should
+ * be serviced.
+ */
+ #define Pipe_GetPipeInterrupts() UPINT
+
+ /** Clears the interrupt flag for the specified pipe number. */
+ #define Pipe_ClearPipeInterrupt(n) MACROS{ UPINT &= ~(1 << n); }MACROE
+
+ /** Returns true if the specified pipe's interrupt period has elapsed, false otherwise. */
+ #define Pipe_HasPipeInterrupted(n) ((UPINT & (1 << n)) ? true : false)
+
+ /** Clears the pipe bank, and switches to the alternate bank if the currently selected pipe is
+ * dual-banked. When cleared, this either frees the bank up for the next packet from the host
+ * (if the endpoint is of the OUT direction) or sends the packet contents to the host (if the
+ * pipe is of the IN direction).
+ */
+ #define Pipe_ClearCurrentBank() MACROS{ UPINTX &= ~(1 << FIFOCON); }MACROE
+
+ /** Unfreezes the pipe, allowing it to communicate with an attached device. */
+ #define Pipe_Unfreeze() MACROS{ UPCONX &= ~(1 << PFREEZE); }MACROE
+
+ /** Freezes the pipe, preventing it from communicating with an attached device. */
+ #define Pipe_Freeze() MACROS{ UPCONX |= (1 << PFREEZE); }MACROE
+
+ /** Clears the master pipe error flag. */
+ #define Pipe_ClearError() MACROS{ UPINTX &= ~(1 << PERRI); }MACROE
+
+ /** Returns true if the master pipe error flag is set for the currently selected pipe, indicating that
+ * some sort of hardware error has occurred on the pipe.
+ *
+ * \see Pipe_GetErrorFlags() macro for information on retreiving the exact error flag.
+ */
+ #define Pipe_IsError() ((UPINTX & (1 << PERRI)) ? true : false)
+
+ /** Clears all the currently selected pipe's hardware error flags, but does not clear the master error
+ * flag for the pipe. */
+ #define Pipe_ClearErrorFlags() MACROS{ UPERRX = 0; }MACROE
+
+ /** Returns a mask of the hardware error flags which have occured on the currently selected pipe. This
+ * value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred.
+ */
+ #define Pipe_GetErrorFlags() UPERRX
+
+ /** Returns true if the currently selected pipe may be read from (if data is waiting in the pipe
+ * bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT
+ * direction). This function will return false if an error has occured in the pipe, or if the pipe
+ * is an IN direction and no packet has been received, or if the pipe is an OUT direction and the
+ * pipe bank is full.
+ */
+ #define Pipe_ReadWriteAllowed() ((UPINTX & (1 << RWAL)) ? true : false)
+
+ /** Clears the flag indicating that a SETUP request has been sent to the attached device from the
+ * currently selected CONTROL type pipe.
+ */
+ #define Pipe_ClearSetupSent() MACROS{ UPINTX &= ~(1 << TXSTPI); }MACROE
+
+ /** Returns true if no SETUP request is currently being sent to the attached device, false otherwise. */
+ #define Pipe_IsSetupSent() ((UPINTX & (1 << TXSTPI)) ? true : false)
+
+ /** Returns true if the currently selected pipe has been stalled by the attached device, false otherwise. */
+ #define Pipe_IsStalled() ((UPINTX & (1 << RXSTALLI)) ? true : false)
+
+ /** Clears the stall condition on the currently selected pipe. */
+ #define Pipe_ClearStall() MACROS{ UPINTX &= ~(1 << RXSTALLI); }MACROE
+
+ /** Returns true if an IN request has been received on the currently selected CONTROL type pipe, false
+ * otherwise.
+ */
+ #define Pipe_IsSetupINReceived() ((UPINTX & (1 << RXINI)) ? true : false)
+
+ /** Returns true if the currently selected CONTROL type pipe is ready to send an OUT request, false
+ * otherwise.
+ */
+ #define Pipe_IsSetupOUTReady() ((UPINTX & (1 << TXOUTI)) ? true : false)
+
+ /** Acknowedges the reception of a setup IN request from the attached device on the currently selected
+ * CONTROL type endpoint, allowing for the transmission of a setup OUT packet, or the reception of
+ * another setup IN packet.
+ */
+ #define Pipe_ClearSetupIN() MACROS{ UPINTX &= ~(1 << RXINI); UPINTX &= ~(1 << FIFOCON); }MACROE
+
+ /** Sends the currently selected CONTROL type pipe's contents to the device as a setup OUT packet. */
+ #define Pipe_ClearSetupOUT() MACROS{ UPINTX &= ~(1 << TXOUTI); UPINTX &= ~(1 << FIFOCON); }MACROE
+
+ /** Returns true if the device sent a NAK (Negative Acknowedge) in response to the last sent packet on
+ * the currently selected pipe. This ocurrs when the host sends a packet to the device, but the device
+ * is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been
+ * received, it must be cleard using Pipe_ClearNAKReceived() before the previous (or any other) packet
+ * can be re-sent.
+ */
+ #define Pipe_IsNAKReceived() ((UPINTX & (1 << NAKEDI)) ? true : false)
+
+ /** Clears the NAK condition on the currently selected pipe.
+ *
+ * \see Pipe_IsNAKReceived() for more details.
+ */
+ #define Pipe_ClearNAKReceived() MACROS{ UPINTX &= ~(1 << NAKEDI); }MACROE
+
+ /* Enums: */
+ /** Enum for the possible error return codes of the Pipe_WaitUntilReady function */
+ enum Pipe_WaitUntilReady_ErrorCodes_t
+ {
+ PIPE_READYWAIT_NoError = 0, /**< Pipe ready for next packet, no error */
+ PIPE_READYWAIT_PipeStalled = 1, /**< The device stalled the pipe while waiting. */
+ PIPE_READYWAIT_DeviceDisconnected = 2, /**< Device was disconnected from the host while waiting. */
+ PIPE_READYWAIT_Timeout = 3, /**< The device failed to accept or send the next packet
+ * within the software timeout period set by the
+ * USB_STREAM_TIMEOUT_MS macro.
+ */
+ };
+
+ /** Enum for the possible error return codes of the Pipe_*_Stream_* functions. */
+ enum Pipe_Stream_RW_ErrorCodes_t
+ {
+ PIPE_RWSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */
+ PIPE_RWSTREAM_ERROR_PipeStalled = 1, /**< The device stalled the pipe during the transfer. */
+ PIPE_RWSTREAM_ERROR_DeviceDisconnected = 2, /**< Device was disconnected from the host during
+ * the transfer.
+ */
+ PIPE_RWSTREAM_ERROR_Timeout = 3, /**< The device failed to accept or send the next packet
+ * within the software timeout period set by the
+ * USB_STREAM_TIMEOUT_MS macro.
+ */
+ PIPE_RWSTREAM_ERROR_CallbackAborted = 4, /**< Indicates that the stream's callback function aborted
+ * the transfer early.
+ */
+ };
+
+ /* Inline Functions: */
+ /** Reads one byte from the currently selected pipe's bank, for OUT direction pipes. */
+ static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Pipe_Read_Byte(void)
+ {
+ return UPDATX;
+ }
+
+ /** Writes one byte from the currently selected pipe's bank, for IN direction pipes. */
+ static inline void Pipe_Write_Byte(const uint8_t Byte)
+ {
+ UPDATX = Byte;
+ }
+
+ /** Discards one byte from the currently selected pipe's bank, for OUT direction pipes. */
+ static inline void Pipe_Discard_Byte(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UPDATX;
+ }
+
+ /** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
+ * direction pipes.
+ */
+ static inline uint16_t Pipe_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint16_t Pipe_Read_Word_LE(void)
+ {
+ uint16_t Data;
+
+ Data = UPDATX;
+ Data |= (((uint16_t)UPDATX) << 8);
+
+ return Data;
+ }
+
+ /** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT
+ * direction pipes.
+ */
+ static inline uint16_t Pipe_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint16_t Pipe_Read_Word_BE(void)
+ {
+ uint16_t Data;
+
+ Data = (((uint16_t)UPDATX) << 8);
+ Data |= UPDATX;
+
+ return Data;
+ }
+
+ /** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
+ * direction pipes.
+ */
+ static inline void Pipe_Write_Word_LE(const uint16_t Word)
+ {
+ UPDATX = (Word & 0xFF);
+ UPDATX = (Word >> 8);
+ }
+
+ /** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
+ * direction pipes.
+ */
+ static inline void Pipe_Write_Word_BE(const uint16_t Word)
+ {
+ UPDATX = (Word >> 8);
+ UPDATX = (Word & 0xFF);
+ }
+
+ /** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes. */
+ static inline void Pipe_Ignore_Word(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UPDATX;
+ Dummy = UPDATX;
+ }
+
+ /** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
+ * direction pipes.
+ */
+ static inline uint32_t Pipe_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint32_t Pipe_Read_DWord_LE(void)
+ {
+ union
+ {
+ uint32_t DWord;
+ uint8_t Bytes[4];
+ } Data;
+
+ Data.Bytes[0] = UPDATX;
+ Data.Bytes[1] = UPDATX;
+ Data.Bytes[2] = UPDATX;
+ Data.Bytes[3] = UPDATX;
+
+ return Data.DWord;
+ }
+
+ /** Reads four bytes from the currently selected pipe's bank in big endian format, for OUT
+ * direction pipes.
+ */
+ static inline uint32_t Pipe_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint32_t Pipe_Read_DWord_BE(void)
+ {
+ union
+ {
+ uint32_t DWord;
+ uint8_t Bytes[4];
+ } Data;
+
+ Data.Bytes[3] = UPDATX;
+ Data.Bytes[2] = UPDATX;
+ Data.Bytes[1] = UPDATX;
+ Data.Bytes[0] = UPDATX;
+
+ return Data.DWord;
+ }
+
+ /** Writes four bytes to the currently selected pipe's bank in little endian format, for IN
+ * direction pipes.
+ */
+ static inline void Pipe_Write_DWord_LE(const uint32_t DWord)
+ {
+ Pipe_Write_Word_LE(DWord);
+ Pipe_Write_Word_LE(DWord >> 16);
+ }
+
+ /** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
+ * direction pipes.
+ */
+ static inline void Pipe_Write_DWord_BE(const uint32_t DWord)
+ {
+ Pipe_Write_Word_BE(DWord >> 16);
+ Pipe_Write_Word_BE(DWord);
+ }
+
+ /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes. */
+ static inline void Pipe_Ignore_DWord(void)
+ {
+ uint8_t Dummy;
+
+ Dummy = UPDATX;
+ Dummy = UPDATX;
+ Dummy = UPDATX;
+ Dummy = UPDATX;
+ }
+
+ /* External Variables: */
+ /** Global indicating the maximum packet size of the default control pipe located at address
+ * 0 in the device. This value is set to the value indicated in the attached device's device
+ * descriptor once the USB interface is initialized into host mode and a device is attached
+ * to the USB bus.
+ *
+ * \note This variable should be treated as read-only in the user application, and never manually
+ * changed in value.
+ */
+ extern uint8_t USB_ControlPipeSize;
+
+ /* Function Prototypes: */
+ /** Configures the specified pipe number with the given pipe type, token, target endpoint number in the
+ * attached device, bank size and banking mode. Pipes should be allocated in ascending order by their
+ * address in the device (i.e. pipe 1 should be configured before pipe 2 and so on).
+ *
+ * The pipe type may be one of the EP_TYPE_* macros listed in LowLevel.h, the token may be one of the
+ * PIPE_TOKEN_* masks.
+ *
+ * The bank size must indicate the maximum packet size that the pipe can handle. Different pipe
+ * numbers can handle different maximum packet sizes - refer to the chosen USB AVR's datasheet to
+ * determine the maximum bank size for each pipe.
+ *
+ * The banking mode may be either PIPE_BANK_SINGLE or PIPE_BANK_DOUBLE.
+ *
+ * A newly configured pipe is frozen by default, and must be unfrozen before use via the Pipe_Unfreeze() macro.
+ *
+ * \note This routine will select the specified pipe, and the pipe will remain selected once the
+ * routine completes regardless of if the pipe configuration succeeds.
+ *
+ * \return Boolean true if the configuration is successful, false otherwise
+ */
+ bool Pipe_ConfigurePipe(const uint8_t Number, const uint8_t Type, const uint8_t Token, const uint8_t EndpointNumber,
+ const uint16_t Size, const uint8_t Banks);
+
+ /** Spinloops until the currently selected non-control pipe is ready for the next packed of data
+ * to be read or written to it.
+ *
+ * \note This routine should not be called on CONTROL type pipes.
+ *
+ * \return A value from the Pipe_WaitUntilReady_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_WaitUntilReady(void);
+
+ /** Writes the given number of bytes to the pipe from the given buffer in little endian,
+ * sending full packets to the device as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Pipe_ClearCurrentBank() macro. Between each USB packet, the given stream callback function is
+ * executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected pipe into the buffer.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_Write_Stream_LE(const void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Writes the given number of bytes to the pipe from the given buffer in big endian,
+ * sending full packets to the device as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Pipe_ClearCurrentBank() macro. Between each USB packet, the given stream callback function is
+ * executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \param Buffer Pointer to the source data buffer to read from.
+ * \param Length Number of bytes to read for the currently selected pipe into the buffer.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_Write_Stream_BE(const void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads and discards the given number of bytes from the pipe, discarding fully read packets from the host
+ * as needed. The last packet is not automatically discarded once the remaining bytes has been read; the
+ * user is responsible for manually discarding the last packet from the host via the Pipe_ClearCurrentBank() macro.
+ * Between each USB packet, the given stream callback function is executed repeatedly until the next packet is ready,
+ * allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \param Length Number of bytes to send via the currently selected pipe.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_Discard_Stream(uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ );
+
+ /** Reads the given number of bytes from the pipe into the given buffer in little endian,
+ * sending full packets to the device as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Pipe_ClearCurrentBank() macro. Between each USB packet, the given stream callback function is
+ * executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \param Buffer Pointer to the source data buffer to write to.
+ * \param Length Number of bytes to read for the currently selected pipe to read from.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Reads the given number of bytes from the pipe into the given buffer in big endian,
+ * sending full packets to the device as needed. The last packet filled is not automatically sent;
+ * the user is responsible for manually sending the last written packet to the host via the
+ * Pipe_ClearCurrentBank() macro. Between each USB packet, the given stream callback function is
+ * executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.
+ *
+ * The callback routine should be created using the STREAM_CALLBACK() macro. If the token
+ * NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
+ * and this function has the Callback parameter ommitted.
+ *
+ * \param Buffer Pointer to the source data buffer to write to.
+ * \param Length Number of bytes to read for the currently selected pipe to read from.
+ * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
+ *
+ * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
+ #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
+ , uint8_t (* const Callback)(void)
+ #endif
+ ) ATTR_NON_NULL_PTR_ARG(1);
+
+ /* Function Aliases: */
+ /** Alias for Pipe_Discard_Byte().
+ */
+ #define Pipe_Ignore_Byte() Pipe_Discard_Byte()
+
+ /** Alias for Pipe_Discard_Word().
+ */
+ #define Pipe_Ignore_Word() Pipe_Discard_Word()
+
+ /** Alias for Pipe_Discard_DWord().
+ */
+ #define Pipe_Ignore_DWord() Pipe_Discard_DWord()
+
+ /** Alias for Pipe_Read_Word_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Pipe_Read_Word() Pipe_Read_Word_LE()
+
+ /** Alias for Pipe_Write_Word_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Pipe_Write_Word(Word) Pipe_Write_Word_LE(Word)
+
+ /** Alias for Pipe_Read_DWord_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Pipe_Read_DWord() Pipe_Read_DWord_LE()
+
+ /** Alias for Pipe_Write_DWord_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #define Pipe_Write_DWord(DWord) Pipe_Write_DWord_LE(DWord)
+
+ /** Alias for Pipe_Read_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #if !defined(NO_STREAM_CALLBACKS)
+ #define Pipe_Read_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)
+ #else
+ #define Pipe_Read_Stream(Buffer, Length) Pipe_Read_Stream_LE(Buffer, Length)
+ #endif
+
+ /** Alias for Pipe_Write_Stream_LE(). By default USB transfers use little endian format, thus
+ * the command with no endianness specifier indicates little endian mode.
+ */
+ #if !defined(NO_STREAM_CALLBACKS)
+ #define Pipe_Write_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)
+ #else
+ #define Pipe_Write_Stream(Buffer, Length) Pipe_Read_Stream_LE(Buffer, Length)
+ #endif
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define PIPE_TOKEN_MASK (0x03 << PTOKEN0)
+
+ #define Pipe_AllocateMemory() MACROS{ UPCFG1X |= (1 << ALLOC); }MACROE
+ #define Pipe_DeallocateMemory() MACROS{ UPCFG1X &= ~(1 << ALLOC); }MACROE
+
+ /* Function Prototypes: */
+ void Pipe_ClearPipes(void);
+
+ /* Inline Functions: */
+ static inline uint8_t Pipe_BytesToEPSizeMask(uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYSINLINE;
+ static inline uint8_t Pipe_BytesToEPSizeMask(uint16_t Bytes)
+ {
+ if (Bytes <= 8)
+ return (0 << EPSIZE0);
+ else if (Bytes <= 16)
+ return (1 << EPSIZE0);
+ else if (Bytes <= 32)
+ return (2 << EPSIZE0);
+ else if (Bytes <= 64)
+ return (3 << EPSIZE0);
+ else if (Bytes <= (8 << 4))
+ return (4 << EPSIZE0);
+ else
+ return (5 << EPSIZE0);
+ };
+
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StdRequestType.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StdRequestType.h
new file mode 100644
index 00000000..02d4fdc5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StdRequestType.h
@@ -0,0 +1,191 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Contains definitions for the various control request parameters, so that the request details (such as data
+ * direction, request recipient, etc.) can be extracted via masking.
+ */
+
+#ifndef __STDREQTYPE_H__
+#define __STDREQTYPE_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Mask for the request type parameter, to indicate the direction of the request data (Host to Device
+ * or Device to Host). The result of this mask should then be compared to the request direction masks.
+ *
+ * \see REQDIR_* macros for masks indicating the request data direction.
+ */
+ #define CONTROL_REQTYPE_DIRECTION 0b10000000
+
+ /** Mask for the request type parameter, to indicate the type of request (Device, Class or Vendor
+ * Specific). The result of this mask should then be compared to the request type masks.
+ *
+ * \see REQTYPE_* macros for masks indicating the request type.
+ */
+ #define CONTROL_REQTYPE_TYPE 0b01100000
+
+ /** Mask for the request type parameter, to indicate the recipient of the request (Standard, Class
+ * or Vendor Specific). The result of this mask should then be compared to the request recipient
+ * masks.
+ *
+ * \see REQREC_* macros for masks indicating the request recipient.
+ */
+ #define CONTROL_REQTYPE_RECIPIENT 0b00011111
+
+ /** Request data direction mask, indicating that the request data will flow from host to device.
+ *
+ * \see CONTROL_REQTYPE_DIRECTION macro.
+ */
+ #define REQDIR_HOSTTODEVICE (0 << 7)
+
+ /** Request data direction mask, indicating that the request data will flow from device to host.
+ *
+ * \see CONTROL_REQTYPE_DIRECTION macro.
+ */
+ #define REQDIR_DEVICETOHOST (1 << 7)
+
+ /** Request type mask, indicating that the request is a standard request.
+ *
+ * \see CONTROL_REQTYPE_TYPE macro.
+ */
+ #define REQTYPE_STANDARD (0 << 5)
+
+ /** Request type mask, indicating that the request is a class-specific request.
+ *
+ * \see CONTROL_REQTYPE_TYPE macro.
+ */
+ #define REQTYPE_CLASS (1 << 5)
+
+ /** Request type mask, indicating that the request is a vendor specific request.
+ *
+ * \see CONTROL_REQTYPE_TYPE macro.
+ */
+ #define REQTYPE_VENDOR (2 << 5)
+
+ /** Request recipient mask, indicating that the request is to be issued to the device as a whole.
+ *
+ * \see CONTROL_REQTYPE_RECIPIENT macro.
+ */
+ #define REQREC_DEVICE (0 << 0)
+
+ /** Request recipient mask, indicating that the request is to be issued to an interface in the
+ * currently selected configuration.
+ *
+ * \see CONTROL_REQTYPE_RECIPIENT macro.
+ */
+ #define REQREC_INTERFACE (1 << 0)
+
+ /** Request recipient mask, indicating that the request is to be issued to an endpoint in the
+ * currently selected configuration.
+ *
+ * \see CONTROL_REQTYPE_RECIPIENT macro.
+ */
+ #define REQREC_ENDPOINT (2 << 0)
+
+ /** Request recipient mask, indicating that the request is to be issued to an unspecified element
+ * in the currently selected configuration.
+ *
+ * \see CONTROL_REQTYPE_RECIPIENT macro.
+ */
+ #define REQREC_OTHER (3 << 0)
+
+ /** Feature indicator for Clear Feature or Set Feature commands. When used in a Clear Feature
+ * request this indicates that an endpoint (whose address is given elsewhere in the request
+ * should have its stall condition cleared. If used in a similar manner inside a Set Feature
+ * request, this stalls an endpoint.
+ */
+ #define FEATURE_ENDPOINT_HALT 0x00
+
+ /** Feature indicator for Clear Feature or Set Feature commands. When used in a Clear Feature
+ * request this indicates that the remote wakeup enabled device should not issue remote
+ * wakeup requests until further notice. If used in a similar manner inside a Set Feature
+ * request, this re-enabled the remote wakeup feature on the device.
+ */
+ #define FEATURE_REMOTE_WAKEUP 0x01
+
+ /* Enums: */
+ /** Enumeration for the various standard request commands. These commands are applicable when the
+ * request type is REQTYPE_STANDARD (with the exception of REQ_GetDescriptor, which is always
+ * handled regardless of the request type value).
+ *
+ * \see Chapter 9 of the USB 2.0 Specification.
+ */
+ enum USB_Control_Request_t
+ {
+ REQ_GetStatus = 0, /**< Implemented in the library for device, endpoint and interface
+ * recipients. Passed to the user application for other recipients
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_ClearFeature = 1, /**< Implemented in the library for device, endpoint and interface
+ * recipients. Passed to the user application for other recipients
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_SetFeature = 3, /**< Implemented in the library for device, endpoint and interface
+ * recipients. Passed to the user application for other recipients
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_SetAddress = 5, /**< Implemented in the library for the device recipient. Passed
+ * to the user application for other recipients via the
+ * USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_GetDescriptor = 6, /**< Implemented in the library for all recipients and all request
+ * types. */
+ REQ_SetDescriptor = 7, /**< Not implemented in the library, passed to the user application
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_GetConfiguration = 8, /**< Implemented in the library for the device recipient. Passed
+ * to the user application for other recipients via the
+ * USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_SetConfiguration = 9, /**< Implemented in the library for the device recipient. Passed
+ * to the user application for other recipients via the
+ * USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_GetInterface = 10, /**< Not implemented in the library, passed to the user application
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_SetInterface = 11, /**< Not implemented in the library, passed to the user application
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ REQ_SynchFrame = 12, /**< Not implemented in the library, passed to the user application
+ * via the USB_UnhandledControlPacket() event when received in
+ * device mode. */
+ };
+
+/* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define FEATURE_SELFPOWERED_ENABLED (1 << 0)
+ #define FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h
new file mode 100644
index 00000000..60e408e9
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h
@@ -0,0 +1,87 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Macros and enums for the stream callback routines in Endpoint.h and Pipe.c. This module contains the
+ * code required to easily set up stream callback functions which can be used to force early abort of a
+ * stream read/write process.
+ */
+
+#ifndef __STREAMCALLBACK_H__
+#define __STREAMCALLBACK_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Creates a prototype for or begins a stream callback routine. Stream callback routines are small
+ * routines which are executed during stream read or writes (if the callback-enabled versions of
+ * these functions are used) which allow the user application to abort the transfer when certain
+ * arbitrary conditions are met.
+ *
+ * Stream callback functions should return a value from the StreamCallback_Return_ErrorCodes_t
+ * enum.
+ *
+ * Usage Example (Device Endpoint, but applicable for Host pipes also):
+ * \code
+ * STREAM_CALLBACK(GlobalNotSet); // Callback Prototype
+ *
+ * STREAM_CALLBACK(GlobalNotSet)
+ * {
+ * if (MyGlobal == false)
+ * return ENDPOINT_STREAMCALLBACK_Continue;
+ * else
+ * return ENDPOINT_STREAMCALLBACK_Abort;
+ * }
+ *
+ * //...
+ * // Inside some routine:
+ * if (Endpoint_Write_CStream_LE(DataBuffer, sizeof(DataBuffer), GlobalNotSet) ==
+ * ENDPOINT_RWSTREAM_ERROR_CallbackAborted)
+ * {
+ * // Do something when the callback aborted the transfer early
+ * }
+ * \endcode
+ */
+ #define STREAM_CALLBACK(name) uint8_t name (void)
+
+ /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream
+ * call has no callback function to be called between USB packets.
+ */
+ #define NO_STREAM_CALLBACK NULL
+
+ /* Enums: */
+ /** Enum for the possible error return codes of a stream callback function */
+ enum StreamCallback_Return_ErrorCodes_t
+ {
+ STREAMCALLBACK_Continue = 0, /**< Continue sending or receiving the stream. */
+ STREAMCALLBACK_Abort = 1, /**< Abort the stream send or reciving process. */
+ };
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/USBMode.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/USBMode.h
new file mode 100644
index 00000000..f0fbf68d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/LowLevel/USBMode.h
@@ -0,0 +1,77 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#ifndef __USBMODE_H__
+#define __USBMODE_H__
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #if ((defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
+ defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
+ defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \
+ defined(__AVR_ATmega32U6__)) && !defined(USB_DEVICE_ONLY))
+ #define USB_DEVICE_ONLY
+ #endif
+
+ #if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__))
+ #define USB_LIMITED_CONTROLLER
+ #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
+ #define USB_MODIFIED_FULL_CONTROLLER
+ #else
+ #define USB_FULL_CONTROLLER
+ #endif
+
+ #if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))
+ #define USB_CAN_BE_BOTH
+ #define USB_CAN_BE_HOST
+ #define USB_CAN_BE_DEVICE
+ #elif defined(USB_HOST_ONLY)
+ #define USB_CAN_BE_HOST
+ #define USB_CurrentMode USB_MODE_HOST
+ #elif defined(USB_DEVICE_ONLY)
+ #define USB_CAN_BE_DEVICE
+ #define USB_CurrentMode USB_MODE_DEVICE
+ #endif
+
+ #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
+ #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
+ #endif
+
+ #if (defined(USB_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
+ #error USB_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
+ #endif
+
+ #if defined(USE_STATIC_OPTIONS)
+ #define USB_Options USE_STATIC_OPTIONS
+ #endif
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/USB.h b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/USB.h
new file mode 100644
index 00000000..e90d397c
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Drivers/USB/USB.h
@@ -0,0 +1,83 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Master include file for the library USB functionality. This file should be included in all user projects making
+ * use of the USB portions of the library, instead of including any headers in the USB/LowLevel or USB/HighLevel
+ * directories.
+ *
+ * Class specific utility files in USB/Class/ must still be included manually, as they are not normally part of
+ * the USB library unless desired by the library user.
+ */
+
+#ifndef __USB_H__
+#define __USB_H__
+
+ /* Preprocessor Checks: */
+ #if (!(defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__)) && defined(USB_HOST_ONLY))
+ #error USB_HOST_ONLY is not available for the currently selected USB AVR model.
+ #endif
+
+ #if (!(defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
+ defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
+ defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
+ defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \
+ defined(__AVR_ATmega32U6__)))
+ #error The currently selected AVR model is not supported under the USB component of the LUFA library.
+ #endif
+
+ /* Includes: */
+ #include "LowLevel/USBMode.h"
+
+ #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
+ #include "LowLevel/Host.h"
+ #include "LowLevel/HostChapter9.h"
+ #include "LowLevel/Pipe.h"
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
+ #include "LowLevel/Device.h"
+ #include "LowLevel/DevChapter9.h"
+ #include "LowLevel/Endpoint.h"
+ #endif
+
+ #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
+ #include "LowLevel/OTG.h"
+ #endif
+
+ #include "LowLevel/LowLevel.h"
+ #include "HighLevel/USBTask.h"
+ #include "HighLevel/USBInterrupt.h"
+ #include "HighLevel/Events.h"
+ #include "HighLevel/StdDescriptors.h"
+
+#endif
+
diff --git a/digital/avr/modules/usb/lufa/LUFA/GettingStarted.txt b/digital/avr/modules/usb/lufa/LUFA/GettingStarted.txt
new file mode 100644
index 00000000..0fe3f50b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/GettingStarted.txt
@@ -0,0 +1,117 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_GettingStarted Getting Started
+ *
+ * Out of the box, LUFA contains a large number of pre-made class demos for you to test, experiment with and
+ * ultimately build upon for your own projects. All the demos come pre-configured to build and run correctly
+ * on the AT90USB1287 AVR microcontroller, mounted on the Atmel USBKEY board and running at an 8MHz master clock.
+ * This is due to two reasons; one, it is the hardware the author posesses, and two, it is the most popular Atmel
+ * USB demonstration board to date.
+ *
+ * \section Sec_Prerequisites Prerequisites
+ * Before you can compile any of the LUFA library code or demos, you will need a recent distribution of avr-libc (1.6.2+)
+ * and the AVR-GCC (4.2+) compiler. For Windows users, the best way to obtain these is the WinAVR project
+ * (http://winavr.sourceforge.net) as this provides a single-file setup for everything required to compile your
+ * own AVR projects.
+ *
+ * \section Sec_Configuring Configuring the Demos, Bootloaders and Projects
+ * If the target AVR model, clock speed, board or other settings are different to the current settings, they must be changed
+ * and the project recompiled from the source code before being programmed into the AVR microcontroller. Most project
+ * configuration options are located in the "makefile" build script inside each LUFA application's folder, however some
+ * demo or application-specific configuration settings (such as the output format in the AudioOut demo) are located in the
+ * main .c source file of the project.
+ *
+ * Each project "makefile" contains all the script and configuration data required to compile each project. When opened with
+ * any regular basic text editor such as Notepad or Wordpad (ensure that the save format is a pure ASCII text format) the
+ * build configuration settings may be altered.
+ *
+ * Inside each makefile, a number of configuration variables are located, with the format "<VARIABLE NAME> = <VALUE>". For
+ * each application, the important variables which should be altered are:
+ *
+ * - <b>MCU</b>, the target AVR processor.
+ * - <b>BOARD</b>, the target board hardware
+ * - <b>F_CPU</b>, the target AVR master clock frequency
+ * - <b>CDEFS</b>, the C preprocessor defines which configure the source code
+ *
+ * These values should be changed to reflect the build hardware.
+ *
+ * \subsection SSec_MCU The MCU Parameter
+ * This parameter indicates the target AVR model for the compiled application. This should be set to the model of the target AVR
+ * (such as the AT90USB1287, or the ATMEGA32U4), in all lower-case (e.g. "at90usb1287"). Note that not all demos support all the
+ * USB AVR models, as they may make use of peripherals or modes only present in some devices.
+ *
+ * For supported library AVR models, see main documentation page.
+ *
+ * \subsection SSec_BOARD The BOARD Parameter
+ * This parameter indicates the target AVR board hardware for the compiled application. Some LUFA library drivers are board-specific,
+ * such as the LED driver, and the library needs to know the layout of the target board. If you are using one of the board models listed
+ * on the main library page, change this parameter to the board name in all UPPER-case.
+ *
+ * If you are not using any board-specific drivers in the LUFA library, or you are using a custom board layout, change this to read
+ * "USER" (no quotes) instead of a standard board name. If the USER board type is selected and the application makes use of one or more
+ * board-specific hardware drivers inside the LUFA library, then the appropriate stub drives files should be copied from the /BoardStubs/
+ * directory into a /Board/ folder inside the application directory, and the stub driver completed with the appropriate code to drive the
+ * custom board's hardware.
+ *
+ * \subsection SSec_F_CPU The F_CPU Parameter
+ * This parameter indicates the target AVR's master clock frequency, in Hz. Consult your AVR model's datasheet for allowable clock frequencies
+ * if the USB interface is to be operational.
+ *
+ * <b>Note that this value does not actually *alter* the AVR's clock frequency</b>, it is just a way to indicate to the library the clock frequency
+ * of the AVR as set by the AVR's fuses. If this value does not reflect the actual running frequency of the AVR, incorrect operation of one of more
+ * library components will ocurr.
+ *
+ * \subsection SSec_CDEFS The CDEFS Parameter
+ * Most applications will actually have multiple CDEF lines, which are concatenated together with the "+=" operator. This ensures that large
+ * numbers of configuration options remain readable by splitting up groups of options into seperate lines.
+ *
+ * Normally, these options do not need to be altered to allow an application to compile and run correctly on a different board or AVR to the
+ * current configuration - if the options are incorrect, then the demo is most likely incompatible with the chosen USB AVR model and cannot be
+ * made to function through the altering of the makefile settings alone (or at all). Settings such as the USB mode (device, host or both), the USB
+ * interface speed (Low or Full speed) and other LUFA configuration options can be set here - refer to the library documentation for details on the
+ * configuration parameters.
+ *
+ * \section Sec_Compiling Compiling a LUFA Application
+ * Compiling the LUFA demos, applications and/or bootloaders is very simple. LUFA comes with makefile scripts for
+ * each individual demo, bootloader and project folder, as well as scripts in the /Demos/, /Bootloaders/, /Projects/
+ * and the LUFA root directory. This means that compilation can be started from any of the above directories, with
+ * a build started from an upper directory in the directory structure executing build of all child directories under it.
+ * This means that while a build inside a particular demo directory will build only that particular demo, a build stated
+ * from the /Demos/ directory will build all LUFA demo projects sequentially.
+ *
+ * \subsection SSec_CommandLine Via the Command Line
+ * To build a project from the source via the command line, the command <b>"make all"</b> should be executed from the command line in the directory
+ * of interest. To remove compiled files (including the binary output, all intermediatary files and all diagnostic output
+ * files), execute <b>"make clean"</b>. Once a "make all" has been run and no errors were encountered, the resulting binary will
+ * be located in the generated ".HEX" file. If your project makes use of pre-initialized EEPROM variables, the generated ".EEP"
+ * file will contain the project's EEPROM data.
+ *
+ * \subsection SSec_AVRStudio Via AVRStudio
+ * Each demo, project and bootloader contains an AVRStudio project (.aps) which can be used to build each project. Once opened
+ * in AVRStudio, the project can be built and cleaned using the GUI buttons or menus. Note that the AVRStudio project files make
+ * use of the external project makefile, thus the procedure for configuring a demo remains the same regardless of the build environment.
+ *
+ * \section Sec_Programming Programming a USB AVR
+ * Once you have built an application, you will need a way to program in the resulting ".HEX" file (and, if your
+ * application uses EEPROM variables with initial values, also a ".EEP" file) into your USB AVR. Normally, the
+ * reprogramming an AVR device must be performed using a special piece of programming hardware, through one of the
+ * supported AVR programming protocols - ISP, HVSP, HVPP, JTAG or dW. This can be done through a custom programmer,
+ * a third party programmer, or an official Atmel AVR tool - for more information, see the Atmel.com website.
+ *
+ * Alternatively, you can use the bootloader. From the Atmel factory, each USB AVR comes preloaded with the Atmel
+ * DFU (Device Firmware Update) class bootloader, a small piece of AVR firmware which allows the remainder of the
+ * AVR to be programmed through a non-standard interface such as the serial USART port, SPI, or (in this case) USB.
+ * Bootloaders have the advantage of not requiring any special hardware for programming, and cannot usually be erased
+ * or broken without an external programming device. They have disadvantages however; they cannot change the fuses of
+ * the AVR (special configuration settings that control the operation of the chip itself) and a small portion of the
+ * AVR's FLASH program memory must be reserved to contain the bootloader firmware, and thus cannot be used by the
+ * loaded application. Atmel's DFU bootloader is either 4KB (for the smaller USB AVRs) or 8KB (for the larger USB AVRs).
+ *
+ * If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation.
+ * Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible)
+ * alternative exists called "dfu-programmer".
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/MainPage.txt b/digital/avr/modules/usb/lufa/LUFA/MainPage.txt
new file mode 100644
index 00000000..5a12b821
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/MainPage.txt
@@ -0,0 +1,75 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/**
+ * \mainpage About the LUFA (Formerly MyUSB) Library
+ *
+ * Lightweight USB Framework for AVRs Library, written by Dean Camera.
+ *
+ * \section Sec_About About this library
+ *
+ * Originally based on the AT90USBKEY from Atmel, it is an open-source, driver for the USB-enabled AVR
+ * microcontrollers, released under the MIT license. Currently, the AT90USB1286, AT90USB1287, AT90USB646,
+ * AT90USB647, AT90USB162, AT90USB82, ATMEGA16U4, ATMEGA32U6 and ATMEGA32U4 AVR microcontrollers are supported by the
+ * library. Supported premade boards are the USBKEY, STK525, STK526, RZUSBSTICK and ATAVRUSBRF01.
+ *
+ * The library is currently in a stable release, suitable for download and incorporation into user projects for
+ * both host and device modes. For information about the project progression, check out my blog.
+ *
+ * LUFA is written specifically for the free AVR-GCC compiler, and uses several GCC-only extensions to make the
+ * library API more streamlined and robust. You can download AVR-GCC for free in a convenient windows package,
+ * from the the WinAVR website.
+ *
+ * \section Sec_Links Library Links
+ * Project Homepage: http://www.fourwalledcubicle.com/LUFA.php \n
+ * Development Blog: http://www.fourwalledcubicle.com/blog \n
+ * Discussion Group: http://groups.google.com/group/LUFA-support-list \n
+ * Bugs and Feature Requests: http://code.google.com/p/LUFA-issues/issues/ \n
+ * Author's Website: http://www.fourwalledcubicle.com \n
+ *
+ * WinAVR Website: http://winavr.sourceforge.net \n
+ * avr-libc Website: http://www.nongnu.org/avr-libc/ \n
+ *
+ * USB-IF Website: http://www.usb.org \n
+ *
+ * \section Sec_License License
+ * The LUFA library is currently released under the MIT licence, included below.
+ *
+ * \verbatim
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is hereby
+ * granted, provided that the above copyright notice appear in all
+ * copies and that both that the copyright notice and this
+ * permission notice and warranty disclaimer appear in supporting
+ * documentation, and that the name of the author not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * The author disclaim all warranties with regard to this
+ * software, including all implied warranties of merchantability
+ * and fitness. In no event shall the author be liable for any
+ * special, indirect or consequential damages or any damages
+ * whatsoever resulting from loss of use, data or profits, whether
+ * in an action of contract, negligence or other tortious action,
+ * arising out of or in connection with the use or performance of
+ * this software.
+ * \endverbatim
+ *
+ * \section Sec_Demos Demos and Bootloaders
+ * The LUFA library ships with several different host and device demos, located in the /Demos/ subdirectory.
+ * If this directory is missing, please re-download the project from the project homepage.
+ *
+ * Also included with the library are two fully functional bootloaders, loacated in the /Bootloaders/ subdirectory.
+ * The DFU class bootloader is compatible with Atmel's FLIP software or the open source dfu-programmer project, and
+ * the CDC class (AVR109 protocol) is compatible with such open source software as AVRDUDE and AVR-OSP.
+ *
+ * \section Sec_Donations Donate
+ * I am a 19 year old University student studying for a double degree in Computer Science and Electronics
+ * Engineering. This leaves little time for any sort of work or leisure. Please consider donating a small amount
+ * to myself to support this and my future Open Source projects. You can donate any amount via PayPal on my
+ * website, http://www.fourwalledcubicle.com . All donations are greatly appreciated.
+ */
+ \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.c b/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.c
new file mode 100644
index 00000000..a91e0f35
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.c
@@ -0,0 +1,226 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#define INCLUDE_FROM_DYNALLOC_C
+#include "DynAlloc.h"
+
+struct
+{
+ char Mem_Heap[NUM_BLOCKS * BLOCK_SIZE];
+ void* Mem_Handles[NUM_HANDLES];
+ uint8_t Mem_Block_Flags[(NUM_BLOCKS / 4) + ((NUM_BLOCKS % 4) ? 1 : 0)];
+ uint8_t FlagMaskLookupMask[4];
+ uint8_t FlagMaskLookupNum[4];
+} Mem_MemData = {FlagMaskLookupMask: {(3 << 0), (3 << 2), (3 << 4), (3 << 6)},
+ FlagMaskLookupNum: { 0, 2, 4, 6}};
+
+static uint8_t Mem_GetBlockFlags(const Block_Number_t BlockNum)
+{
+ const Block_Number_t BlockIndex = (BlockNum >> 2);
+ const uint8_t FlagMask = Mem_MemData.FlagMaskLookupMask[BlockNum & 0x03];
+ const uint8_t FlagMaskShift = Mem_MemData.FlagMaskLookupNum[BlockNum & 0x03];
+
+ return ((Mem_MemData.Mem_Block_Flags[BlockIndex] & FlagMask) >> FlagMaskShift);
+}
+
+static void Mem_SetBlockFlags(const Block_Number_t BlockNum, const uint8_t Flags)
+{
+ const Block_Number_t BlockIndex = (BlockNum >> 2);
+ const uint8_t FlagMask = Mem_MemData.FlagMaskLookupMask[BlockNum & 0x03];
+ const uint8_t FlagMaskShift = Mem_MemData.FlagMaskLookupNum[BlockNum & 0x03];
+
+ Mem_MemData.Mem_Block_Flags[BlockIndex] &= ~FlagMask;
+ Mem_MemData.Mem_Block_Flags[BlockIndex] |= (Flags << FlagMaskShift);
+}
+
+static inline void Mem_Defrag(void)
+{
+ Block_Number_t FreeStartBlock = 0;
+ char* FreeStartPtr = NULL;
+ char* UsedStartPtr = NULL;
+ Block_Number_t CurrBlock;
+
+ for (CurrBlock = 0; CurrBlock < NUM_BLOCKS; CurrBlock++)
+ {
+ if (!(Mem_GetBlockFlags(CurrBlock) & BLOCK_USED_MASK))
+ {
+ FreeStartPtr = &Mem_MemData.Mem_Heap[CurrBlock * BLOCK_SIZE];
+ FreeStartBlock = CurrBlock;
+ break;
+ }
+ }
+
+ if (FreeStartPtr == NULL)
+ return;
+
+ while (++CurrBlock < NUM_BLOCKS)
+ {
+ uint8_t CurrBlockFlags = Mem_GetBlockFlags(CurrBlock);
+
+ if (CurrBlockFlags & BLOCK_USED_MASK)
+ {
+ UsedStartPtr = &Mem_MemData.Mem_Heap[CurrBlock * BLOCK_SIZE];
+
+ for (Handle_Number_t HandleNum = 0; HandleNum < NUM_HANDLES; HandleNum++)
+ {
+ if (Mem_MemData.Mem_Handles[HandleNum] == UsedStartPtr)
+ {
+ Mem_MemData.Mem_Handles[HandleNum] = FreeStartPtr;
+ break;
+ }
+ }
+
+ memcpy(FreeStartPtr, UsedStartPtr, BLOCK_SIZE);
+ FreeStartPtr += BLOCK_SIZE;
+
+ Mem_SetBlockFlags(FreeStartBlock++, CurrBlockFlags);
+ Mem_SetBlockFlags(CurrBlock, 0);
+ }
+ }
+}
+
+static inline bool Mem_FindFreeBlocks(Block_Number_t* const RetStartPtr, const Block_Number_t Blocks)
+{
+ Block_Number_t FreeInCurrSec = 0;
+
+ for (Block_Number_t CurrBlock = 0; CurrBlock < NUM_BLOCKS; CurrBlock++)
+ {
+ if (Mem_GetBlockFlags(CurrBlock) & BLOCK_USED_MASK)
+ FreeInCurrSec = 0;
+ else
+ FreeInCurrSec++;
+
+ if (FreeInCurrSec >= Blocks)
+ {
+ *RetStartPtr = CurrBlock;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+Mem_Handle_t Mem_Alloc(const Alloc_Size_t Bytes)
+{
+ Block_Number_t ReqBlocks = (Bytes / BLOCK_SIZE);
+ Block_Number_t StartBlock;
+
+ if (Bytes % BLOCK_SIZE)
+ ReqBlocks++;
+
+ if (!(Mem_FindFreeBlocks(&StartBlock, ReqBlocks)))
+ {
+ Mem_Defrag();
+
+ if (!(Mem_FindFreeBlocks(&StartBlock, ReqBlocks)))
+ return NULL;
+ }
+
+ for (Block_Number_t UsedBlock = 0; UsedBlock < (ReqBlocks - 1); UsedBlock++)
+ Mem_SetBlockFlags((StartBlock + UsedBlock), (BLOCK_USED_MASK | BLOCK_LINKED_MASK));
+
+ Mem_SetBlockFlags((StartBlock + (ReqBlocks - 1)), BLOCK_USED_MASK);
+
+ for (Handle_Number_t AllocEntry = 0; AllocEntry < NUM_HANDLES; AllocEntry++)
+ {
+ Mem_Handle_t CurrHdl = (Mem_Handle_t)&Mem_MemData.Mem_Handles[AllocEntry];
+
+ if (DEREF(CurrHdl, void*) == NULL)
+ {
+ DEREF(CurrHdl, void*) = &Mem_MemData.Mem_Heap[StartBlock * BLOCK_SIZE];
+ return CurrHdl;
+ }
+ }
+
+ return NULL;
+}
+
+Mem_Handle_t Mem_Realloc(Mem_Handle_t CurrAllocHdl, const Alloc_Size_t Bytes)
+{
+ Mem_Free(CurrAllocHdl);
+ return Mem_Alloc(Bytes);
+}
+
+Mem_Handle_t Mem_Calloc(const Alloc_Size_t Bytes)
+{
+ Mem_Handle_t AllocHdl = Mem_Alloc(Bytes);
+
+ if (AllocHdl != NULL)
+ memset(DEREF(AllocHdl, void*), 0x00, Bytes);
+
+ return AllocHdl;
+}
+
+void Mem_Free(Mem_Handle_t CurrAllocHdl)
+{
+ char* MemBlockPtr = DEREF(CurrAllocHdl, char*);
+ Block_Number_t CurrBlock = ((uint16_t)(MemBlockPtr - Mem_MemData.Mem_Heap) / BLOCK_SIZE);
+ uint8_t CurrBlockFlags;
+
+ if ((CurrAllocHdl == NULL) || (MemBlockPtr == NULL))
+ return;
+
+ do
+ {
+ CurrBlockFlags = Mem_GetBlockFlags(CurrBlock);
+ Mem_SetBlockFlags(CurrBlock, 0);
+
+ CurrBlock++;
+ }
+ while (CurrBlockFlags & BLOCK_LINKED_MASK);
+
+ DEREF(CurrAllocHdl, void*) = NULL;
+}
+
+Block_Number_t Mem_TotalFreeBlocks(void)
+{
+ Block_Number_t FreeBlocks = 0;
+
+ for (Block_Number_t CurrBlock = 0; CurrBlock < NUM_BLOCKS; CurrBlock++)
+ {
+ if (!(Mem_GetBlockFlags(CurrBlock) & BLOCK_USED_MASK))
+ FreeBlocks++;
+ }
+
+ return FreeBlocks;
+}
+
+Handle_Number_t Mem_TotalFreeHandles(void)
+{
+ Handle_Number_t FreeHandles = 0;
+
+ for (Handle_Number_t CurrHandle = 0; CurrHandle < NUM_HANDLES; CurrHandle++)
+ {
+ if (Mem_MemData.Mem_Handles[CurrHandle] == NULL)
+ FreeHandles++;
+ }
+
+ return FreeHandles;
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.h b/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.h
new file mode 100644
index 00000000..6fd743ea
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/MemoryAllocator/DynAlloc.h
@@ -0,0 +1,182 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Dynamic, auto-defragmenting block memory allocator library. This library provides a convenient replacement for
+ * the standard avr-libc dynamic memory allocation routines. Memory is handed out in block chunks, to reduce the
+ * management memory overhead.
+ *
+ * Unlike the normal memory allocation routines, this library gives out handles to memory which must be dereferenced
+ * at the exact time of use, rather than handing back direct memory pointers. By using library managed handles
+ * instead of pointers, allocated memory blocks can be shifted around as needed transparently to defragment the
+ * memory as more blocks are requested.
+ *
+ * The memory heap is static, thus the total memory usage of the compiled application (as reported by the avr-size
+ * tool of the AVR-GCC toolchain) includes the dynamic memory heap.
+ *
+ * The constants NUM_BLOCKS, BLOCK_SIZE and NUM_HANDLES must be defined in the project makefile (and passed to the
+ * preprocessor via the -D GCC switch) for this library to compile.
+ *
+ * NUM_BLOCKS indicates the number of memory blocks in the memory psudoheap which can be chaned together and handed
+ * to the application via a memory handle. NUM_HANDLES is the maximum number of memory handles (pointing to one or
+ * more chained memory blocks) which can be handed out simultaneously before requring a handle (and its associated
+ * memory) to be freed. BLOCK_SIZE gives the number of bytes in each memory block.
+ */
+
+#ifndef __DYN_ALLOC__
+#define __DYN_ALLOC__
+
+ /* Includes : */
+ #include <avr/io.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ /* Preprocessor Checks: */
+ #if (!defined(NUM_BLOCKS) || !defined(BLOCK_SIZE) || !defined(NUM_HANDLES))
+ #error NUM_BLOCKS, BLOCK_SIZE and NUM_HANDLES must be defined before use via makefile.
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Macro to dereference a given memory handle into the given type. The given type should be a pointer
+ * if the memory is to contain an array of items, or should be a standard type (such as a primative or
+ * structure) if the memory is to hold a single item of a single type. */
+ #define DEREF(handle, type) (*(type*)handle)
+
+ /** Constant, giving the total heap size in bytes. */
+ #define ALLOCABLE_BYTES (1UL * NUM_BLOCKS * BLOCK_SIZE)
+
+ /* Type Defines: */
+ /** Memory handle type, used to store handles given by the library functions. */
+ typedef const void** Mem_Handle_t;
+
+ #if (ALLOCABLE_BYTES > 0xFFFF) || defined(__DOXYGEN__)
+ /** Type define for the size (in bytes) for an allocation for passing to the library functions.
+ * The exact type width varies depending on the value of ALLOCABLE_BYTES to ensure that a single
+ * allocation can request the entire heap if needed.
+ */
+ typedef uint32_t Alloc_Size_t;
+ #elif (ALLOCABLE_BYTES > 0xFF)
+ typedef uint16_t Alloc_Size_t;
+ #else
+ typedef uint8_t Alloc_Size_t;
+ #endif
+
+ #if (NUM_BLOCKS > 0xFFFF) || defined(__DOXYGEN__)
+ /** Type define for a block number in the heap. The exact type width varies depending on the
+ * value of NUM_BLOCKS to ensure that the type can store an index to any block in the block pool.
+ */
+ typedef uint32_t Block_Number_t;
+ #elif (NUM_BLOCKS > 0xFF)
+ typedef uint16_t Block_Number_t;
+ #else
+ typedef uint8_t Block_Number_t;
+ #endif
+
+ #if (NUM_HANDLES > 0xFFFF) || defined(__DOXYGEN__)
+ /** Type define for a handle number. The exact type width varies depending on the value of NUM_HANDLES
+ * to ensure that the type can store the index of any handle in the handle pool.
+ */
+ typedef uint32_t Handle_Number_t;
+ #elif (NUM_HANDLES > 0xFF)
+ typedef uint16_t Handle_Number_t;
+ #else
+ typedef uint8_t Handle_Number_t;
+ #endif
+
+ /* Function Prototypes: */
+ /** Allocates a given number of blocks from the heap (calculated from the requested number of bytes) and
+ * returns a handle to the newly allocated memory.
+ *
+ * \param Bytes The number of bytes requested to be allocated from the heap
+ *
+ * \return NULL handle if the allocation fails, or handle to the allocated memory if the allocation succeeds
+ */
+ Mem_Handle_t Mem_Alloc(const Alloc_Size_t Bytes);
+
+ /** Allocates a given number of blocks from the heap (calculated from the requested number of bytes) and
+ * returns a handle to the newly allocated memory. Calloced memory is automatically cleared to all 0x00
+ * values at the time of allocation.
+ *
+ * \param Bytes The number of pre-cleared bytes requested to be allocated from the heap
+ *
+ * \return NULL handle if the allocation fails, or handle to the allocated memory if the allocation succeeds
+ */
+ Mem_Handle_t Mem_Calloc(const Alloc_Size_t Bytes);
+
+ /** Deallocates a given memory handle, and attempts to allocates the given number of blocks from the heap
+ * (calculated from the requested number of bytes) immediately following the deallocation. The new memory
+ * may be located in the same area as the previous memory, but this is not guaranteed.
+ *
+ * \param CurrAllocHdl Handle to an already allocated section of memory in the heap to deallocate
+ * \param Bytes The number of bytes requested to be allocated from the heap following the
+ * deallocation
+ *
+ * \return NULL handle if the allocation fails, or handle to the allocated memory if the allocation succeeds
+ *
+ * \warning Even if the allocation fails, the deallocation will still occur. Care should be taken to ensure
+ * that the previously allocated memory is not used following an unsuccessful realloc().
+ */
+ Mem_Handle_t Mem_Realloc(Mem_Handle_t CurrAllocHdl, const Alloc_Size_t Bytes);
+
+ /** Deallocates a given previously allocated section of memory from the heap.
+ *
+ * \param CurrAllocHdl Handle to a previously allocated section of memory in the heap
+ */
+ void Mem_Free(Mem_Handle_t CurrAllocHdl);
+
+ /** Returns the total number of unallocated blocks in the heap.
+ *
+ * \return Number of free blocks in the heap, as a Block_Number_t integer
+ */
+ Block_Number_t Mem_TotalFreeBlocks(void);
+
+ /** Returns the total number of unallocated handles in the handle pool.
+ *
+ * \return Number of free handles in the handle pool, as a Handle_Number_t integer
+ */
+ Handle_Number_t Mem_TotalFreeHandles(void);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define BLOCK_USED_MASK (1 << 0)
+ #define BLOCK_LINKED_MASK (1 << 1)
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_DYNALLOC_C)
+ static uint8_t Mem_GetBlockFlags(const Block_Number_t BlockNum);
+ static void Mem_SetBlockFlags(const Block_Number_t BlockNum, const uint8_t Flags);
+ static void Mem_Defrag(void);
+ #endif
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/MigrationInformation.txt b/digital/avr/modules/usb/lufa/LUFA/MigrationInformation.txt
new file mode 100644
index 00000000..eced0a96
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/MigrationInformation.txt
@@ -0,0 +1,227 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_Migration Migrating from Older Versions
+ *
+ * Below is migration information for updating existing projects based on previous versions of the LUFA library
+ * to the next version released. It does not indicate all new additions to the library in each version change, only
+ * areas relevant to making older projects compatible with the API changes of each new release.
+ *
+ * \section Sec_Migration090209 Migrating from 081217 to 090209
+ *
+ * <b>Device Mode</b>
+ * - The ENDPOINT_MAX_ENDPOINTS constant has been renamed to the more appropriate name of ENDPOINT_TOTAL_ENDPOINTS.
+ * - The USB_STREAM_TIMEOUT_MS stream timeout default period has been extended to 100ms. This can be overridden in the user
+ * makefile if desired to restore the previous 50ms timeout.
+ *
+ * <b>Host Mode</b>
+ * - The PIPE_MAX_ENDPOINTS constant has been renamed to the more appropriate name of PIPE_TOTAL_ENDPOINTS.
+ * - The USB_STREAM_TIMEOUT_MS stream timeout default period has been extended to 100ms. This can be overridden in the user
+ * makefile if desired to restore the previous 50ms timeout.
+ * - The USB_DeviceEnumerationFailed event now contains a second "SubErrorCode" parameter, giving the error code of the function
+ * which failed.
+ * - The HID_PARSE_Sucessful enum member constant has been corrected to HID_PARSE_Successful.
+ *
+ * <b>Non-USB Library Components</b>
+ * - The previous SPI_SendByte() functionality is now located in SPI_TransferByte(). SPI_SendByte() now discards the return byte
+ * for speed, to compliment the new SPI_ReceiveByte() function. If two-way SPI transfers are required, calls to SPI_SendByte()
+ * should be changed to SPI_TransferByte().
+ * - The serial driver now sets the Tx line as an output explicitly, and enables the pullup of the Rx line.
+ * - The Serial_Init() and SerialStream_Init() functions now take a second DoubleSpeed parameter, which indicates if the USART
+ * should be initialized in double speed mode - useful in some circumstances for attaining baud rates not usually possible at
+ * the given AVR clock speed.
+ *
+ * <b>Library Demos</b>
+ * - Most library demos have been enhanced and/or had errors corrected. All users of all demos should upgrade their codebase to
+ * the latest demo versions.
+ *
+ * \section Sec_Migration171208 Migrating from V1.5.3 to 081217
+ *
+ * <b>All</b>
+ * - The MyUSB project name has been changed to LUFA (Lightweight Framework for USB AVRs). All references to MyUSB, including macro names,
+ * have been changed to LUFA.
+ *
+ * <b>Library Demos</b>
+ * - The ReconfigureUSART() routine in the USBtoSerial demo was not being called after new line encoding
+ * parameters were set by the host. Projects built on the USBtoSerial code should update to the latest version.
+ * - The HID Parser now supports multiple report (on a single endpoint) HID devices. The MouseHostWithParser and
+ * KeyboardHostWithPaser demos use the updated API functions to function correctly on such devices. Projects
+ * built on either "WithParser" demo should update to the latest code.
+ * - The RNDIS demo TCP stack has been modified so that connections can be properly closed. It is still not
+ * recommended that the MyUSB RNDIS demo TCP/IP stack be used for anything other than demonstration purposes,
+ * as it is neither a full nor a standards compliant implementation.
+ *
+ * <b>Non-USB Library Components</b>
+ * - The Serial_IsCharRecieved() macro has been changed to the correct spelling of Serial_IsCharReceived() in Serial.h.
+ *
+ * <b>Device Mode</b>
+ * - The MANUAL_PLL_CONTROL compile time token has been removed, and replaced with a USB_OPT_MANUAL_PLL mask
+ * to be used in the Options parameter of the USB_Init() function.
+ * - Calling USB_Init() now forces a complete USB interface reset and enumeration, even if the USB interface is
+ * currently initialized.
+ * - Interrupts are now disabled when processing control requests, to avoid problems with interrupts causing the library
+ * or user request processing code to exceed the strict USB timing requirements on control transfers.
+ * - The USB Reset event now resets and disables all device endpoints. If user code depends on endpoints remaining configured
+ * after a Reset event, it should be altered to explicitly re-initialize all user endpoints.
+ * - The prototype for the GetDescriptor function has been changed, as the return value was redundant. The function now
+ * returns the size of the descriptor, rather than passing it back via a parameter, or returns NO_DESCRIPTOR if the specified
+ * descriptor does not exist.
+ * - The NO_DESCRIPTOR_STRING macro has been renamed NO_DESCRIPTOR, and is now also used as a possible return value for the
+ * GetDescriptor function.
+ *
+ * <b>Host Mode</b>
+ * - The MANUAL_PLL_CONTROL compile time token has been removed, and replaced with a USB_OPT_MANUAL_PLL mask
+ * to be used in the Options parameter of the USB_Init() function.
+ * - The HID report parser now supports multiple Report IDs. The HID report parser GetReportItemInfo() and
+ * SetReportItemInfo() routines now return a boolean, set if the requested report item was located in the
+ * current report. If sending a report to a multi-report device, the first byte of the report is automatically
+ * set to the report ID of the given report item.
+ * - Calling USB_Init() now forces a complete USB interface reset and enumeration, even if the USB interface is
+ * currently initialized.
+ *
+ *
+ * \section Sec_Migration152 Migrating from V1.5.2 to V1.5.3
+ *
+ * <b>Library Demos</b>
+ * - Previously, all demos contained a serial number string descriptor, filled with all zeros. A serial number
+ * string is required in Mass Storage devices, or devices which are to retain settings when moved between
+ * ports on a machine. As people were not changing the serial number value, this was causing conflicts and so
+ * the serial number descriptor has been removed from all but the Mass Storage demo, which requires it.
+ * - The AudioOut and AudioIn demos did not previously silence their endpoints when the host has deactivated
+ * them. Projects built upon either demo should upgrade to the latest code.
+ * - The FEATURE_ENDPOINT macro has been renamed FEATURE_ENDPOINT_HALT, and is now correctly documented.
+ * - The MassStoreHost demo contained errors which caused it to lock up randomly on certain devices. Projects built
+ * on the MassStoreDemo code should update to the latest version.
+ * - The Interrupt type endpoint in the CDC based demos previously had a polling interval of 0x02, which caused
+ * problems on some Linux systems. This has been changed to 0xFF, projects built on the CDC demos should upgrade
+ * to the latest code.
+ * - The HID keyboard and mouse demos were not previously boot mode compatible. To enable boot mode support, projects
+ * built on the keyboard or mouse demos (or derivatives) should upgrade to the latest code.
+ * - The Mass Storage demo was not previously standards compliant. Projects built on the Mass Storage demo should
+ * upgrade to the latest code.
+ * - The USART was not being reconfigured after the host sent new encoding settings in the USBtoSerial demo. This was
+ * previously discovered and fixed, but the change was lost. Projects built on the USBtoSerial demo should update
+ * to the latest code.
+ *
+ * <b>Device Mode</b>
+ * - The endpoint non-control stream functions now have a default timeout of 50ms between packets in the stream.
+ * If this timeout is exceeded, the function returns the new ENDPOINT_RWSTREAM_ERROR_Timeout error value. The
+ * timeout value can be overridden by defining the USB_STREAM_TIMEOUT_MS in the project makefile to the desired
+ * timeout duration in ms.
+ * - Rather than returning fixed values, the flags indicating if the device has Remote Wakeup currently enabled
+ * and/or is self-powered are now accessed and set through the new USB_RemoteWakeupEnabled and
+ * USB_CurrentlySelfPowered macros. See the DevChapter9.h documentation for more details.
+ * - All endpoint stream functions now require an extra Callback function parameter. Existing code may be updated
+ * to either supply NO_STREAM_CALLBACK as the extra parameter, or disable stream callbacks altogether by pasing
+ * the token NO_STREAM_CALLBACKS to the compiler using the -D switch.
+ *
+ * <b>Host Mode</b>
+ * - The pipe non-control stream functions now have a default timeout of 50ms between packets in the stream.
+ * If this timeout is exceeded, the function returns the new PIPE_RWSTREAM_ERROR_Timeout error value. The
+ * timeout value can be overridden by defining the USB_STREAM_TIMEOUT_MS in the project makefile to the desired
+ * timeout duration in ms.
+ * - CollectionPath_t has been renamed to HID_CollectionPath_t to be more in line with the other HID parser structures.
+ * - All pipe stream functions now require an extra Callback function parameter. Existing code may be updated
+ * to either supply NO_STREAM_CALLBACK as the extra parameter, or disable stream callbacks altogether by pasing
+ * the token NO_STREAM_CALLBACKS to the compiler using the -D switch.
+ *
+ *
+ * \section Sec_Migration151 Migrating from V1.5.1 to V1.5.2
+ *
+ * <b>Library Demos</b>
+ * - The RNDIS demo application has been updated so that it is functional on Linux under earlier implementations
+ * of the RNDIS specification, which had non-standard behaviour. Projects built upon the demo should upgrade
+ * to the latest code.
+ * - The DFU class bootloader has had several bugs corrected in this release. It is recommended that where
+ * possible any existing devices upgrade to the latest bootloader code.
+ *
+ *
+ * \section Sec_Migration150 Migrating from V1.5.0 to V1.5.1
+ *
+ * <b>Library Demos</b>
+ * - The USBtoSerial demo was broken in the 1.5.0 release, due to incorrect register polling in place of the
+ * global "Transmitting" flag. The change has been reverted in this release. Projects built upon the demo
+ * should upgrade to the latest code.
+ * - The HID class demos did not implement the mandatory GetReport HID class request. Projects built upon the HID
+ * demos should upgrade to the latest code.
+ * - The HID class demos incorrectly reported themselves as boot-protocol enabled HID devices in their descriptors.
+ * Projects built upon the HID demos should upgrade to the latest code.
+ * - The MIDI device demo had incorrect AudioStreaming interface descriptors. Projects built upon the MIDI demo
+ * should upgrade to the latest code.
+ * - The AudioOut demo did not correctly tristate the speaker pins when USB was disconnected, wasting power.
+ * Projects built upon the AudioOut demo should upgrade to the latest code.
+ *
+ *
+ * \section Sec_Migration141 Migrating from V1.4.1 to V1.5.0
+ *
+ * <b>Library Demos</b>
+ * - Previous versions of the library demos had incorrectly encoded BCD version numbers in the descriptors. To
+ * avoid such mistakes in the future, the VERSION_BCD macro has been added to StdDescriptors.h. Existing
+ * projects should at least manually correct the BCD version numbers, or preferably update the descriptors to
+ * encode the version number in BCD format using the new macro.
+ * - The mandatory GetReport class-specific request was accidentally ommitted from previous versions of the demos
+ * based on the Human Interface Device (HID) class. This has been corrected, and any user projects based on the
+ * HID demos should also be updated accordingly.
+ * - The CDC demos now correctly send an empty packet directly after a full packet, to end the transmission.
+ * Failure to do this on projects which always or frequently send full packets will cause buffering issues on
+ * the host OS. All CDC user projects are advised to update their transmission routines in the same manner as
+ * the library CDC demos.
+ * - The previous interrupt-driven Endpoint/Pipe demos did not properly save and restore the currently selected
+ * Endpoint/Pipe when the ISR fired. This has been corrected - user projects based on the interrupt driven
+ * demos should also update to properly save and restore the selected Endpoint/Pipe.
+ *
+ * <b>Non-USB Library Components</b>
+ * - The Atomic.h and ISRMacro.h header files in MyUSB/Common have been removed, as the library is now only
+ * compatible with avr-libc library versions newer than the time before the functionality of the deleted
+ * headers was available.
+ *
+ * <b>Device Mode</b>
+ * - The GetDescriptor function (see StdDescriptors.h) now has a new prototype, with altered parameter names and
+ * functions. Existing projects will need to update the GetDescriptor implementation to reflect the new API.
+ * The previously split Type and Index parameters are now passed as the original wValue parameter to the
+ * function, to make way for the USB specification wIndex parameter which is <i>not</i> the same as the
+ * previous Index parameter.
+ * - The USB_UnhandledControlPacket event (see Events.h) now has new parameter names, to be in line with the
+ * official USB specification. Existing code will need to be altered to use the new parameter names.
+ * - The USB_CreateEndpoints event (see Events.h) has been renamed to USB_ConfigurationChanged, which is more
+ * appropriate. It fires in an identical manner to the previously named event, thus the only change to be made
+ * is the event name itself in the user project.
+ * - The USB_Descriptor_Language_t structure no longer exists in StdDescriptors.h, as this was a
+ * psudo-descriptor modelled on the string descriptor. It is replaced by the true USB_Descriptor_String_t type
+ * descriptor as indicated in the USB specification, thus all device code must be updated accordingly.
+ * - The names of several Endpoint macros have been changed to be more consistant with the rest of the library,
+ * with no implementation changes. This means that existing code can be altered to use the new macro names
+ * with no other considerations required. See Endpoint.h for the new macro names.
+ * - The previous version of the MassStorage demo had an incorrect value in the SCSI_Request_Sense_Response_t
+ * strucuture named SenseData in SCSI.c which caused some problems with some hosts. User projects based on this
+ * demo should correct the structure value to maintain compatibility across multiple OS platforms.
+ * - By default, the descriptor structures use the official USB specification names for the elements. Previous
+ * versions of the library used non-standard (but more verbose) names, which are still usable in the current
+ * and future releases when the correct compile time option is enabled. See the StdDescriptors.h file
+ * documentation for more details.
+ *
+ * <b>Host Mode</b>
+ * - The USB_Host_Request_Header_t structure in HostChapter9.h (used for issuing control requests) has had its
+ * members renamed to the official USB specification names for requests. Existing code will need to be updated
+ * to use the new names.
+ * - The names of several Pipe macros have been changed to be more consistant with the rest of the library,
+ * with no implementation changes. This means that existing code can be altered to use the new macro names
+ * with no other considerations required. See Pipe.h for the new macro names.
+ * - By default, the descriptor structures use the official USB specification names for the elements. Previous
+ * versions of the library used non-standard (but more verbose) names, which are still usable in the current
+ * and future releases when the correct compile time option is enabled. See the StdDescriptors.h file
+ * documentation for more details.
+ * - The names of the macros in Host.h for controlling the SOF generation have been renamed, see the Host.h
+ * module documentation for the new macro names.
+ *
+ * <b>Dual Role Mode</b>
+ * - The OTG.h header file has been corrected so that the macros now perform their stated functions. Any existing
+ * projects using custom headers to fix the broken OTG header should now be altered to once again use the OTG
+ * header inside the library.
+ * - The USB_DeviceEnumerationComplete event (see Events.h) now also fires in Device mode, when the host has
+ * finished enumerating the device. Projects relying on the event only firing in Host mode should be updated
+ * so that the event action only ocurrs when the USB_Mode global is set to USB_MODE_HOST.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.c b/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.c
new file mode 100644
index 00000000..ff8946a0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.c
@@ -0,0 +1,95 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "Scheduler.h"
+
+volatile SchedulerDelayCounter_t Scheduler_TickCounter;
+volatile uint8_t Scheduler_TotalTasks;
+
+bool Scheduler_HasDelayElapsed(const uint16_t Delay, SchedulerDelayCounter_t* const DelayCounter)
+{
+ SchedulerDelayCounter_t CurrentTickValue_LCL;
+ SchedulerDelayCounter_t DelayCounter_LCL;
+
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ CurrentTickValue_LCL = Scheduler_TickCounter;
+ }
+
+ DelayCounter_LCL = *DelayCounter;
+
+ if (CurrentTickValue_LCL >= DelayCounter_LCL)
+ {
+ if ((CurrentTickValue_LCL - DelayCounter_LCL) >= Delay)
+ {
+ *DelayCounter = CurrentTickValue_LCL;
+ return true;
+ }
+ }
+ else
+ {
+ if (((MAX_DELAYCTR_COUNT - DelayCounter_LCL) + CurrentTickValue_LCL) >= Delay)
+ {
+ *DelayCounter = CurrentTickValue_LCL;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus)
+{
+ TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
+
+ while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
+ {
+ if (CurrTask->Task == Task)
+ {
+ CurrTask->TaskStatus = TaskStatus;
+ break;
+ }
+
+ CurrTask++;
+ }
+}
+
+void Scheduler_SetGroupTaskMode(const uint8_t GroupID, const bool TaskStatus)
+{
+ TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
+
+ while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
+ {
+ if (CurrTask->GroupID == GroupID)
+ CurrTask->TaskStatus = TaskStatus;
+
+ CurrTask++;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.h b/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.h
new file mode 100644
index 00000000..39f94ef8
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Scheduler/Scheduler.h
@@ -0,0 +1,262 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Simple round-robbin cooperative scheduler for use in basic projects where non realtime tasks need
+ * to be executed. Each task is executed in sequence, and can be enabled or disabled individually or as a group.
+ *
+ * For a task to yield it must return, thus each task should have persistant data marked with the static attribute.
+ *
+ * Usage Example:
+ * \code
+ * #include <LUFA/Scheduler/Scheduler.h>
+ *
+ * TASK(MyTask1);
+ * TASK(MyTask2);
+ *
+ * TASK_LIST
+ * {
+ * { Task: MyTask1, TaskStatus: TASK_RUN, GroupID: 1 },
+ * { Task: MyTask2, TaskStatus: TASK_RUN, GroupID: 1 },
+ * }
+ *
+ * int main(void)
+ * {
+ * Scheduler_Start();
+ * }
+ *
+ * TASK(MyTask1)
+ * {
+ * // Implementation Here
+ * }
+ *
+ * TASK(MyTask2)
+ * {
+ * // Implementation Here
+ * }
+ * \endcode
+ */
+
+#ifndef __SCHEDULER_H__
+#define __SCHEDULER_H__
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include <util/atomic.h>
+
+ #include "../Common/Common.h"
+
+ /* Enable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Creates a new scheduler task body or prototype. Should be used in the form:
+ * \code
+ * TASK(TaskName); // Prototype
+ *
+ * TASK(TaskName)
+ * {
+ * // Task body
+ * }
+ * \endcode
+ */
+ #define TASK(name) void name (void)
+
+ /** Defines a task list array, containing one or more task entries of the type TaskEntry_t. Each task list
+ * should be encased in curly braces and ended with a comma.
+ *
+ * Usage Example:
+ * \code
+ * TASK_LIST
+ * {
+ * { Task: MyTask1, TaskStatus: TASK_RUN, GroupID: 1 },
+ * // More task entries here
+ * }
+ * \endcode
+ */
+ #define TASK_LIST extern TaskEntry_t Scheduler_TaskList[]; TaskEntry_t Scheduler_TaskList[] =
+
+ /** Constant, giving the maximum delay in scheduler ticks which can be stored in a variable of type
+ * SchedulerDelayCounter_t.
+ */
+ #define TASK_MAX_DELAY (MAX_DELAYCTR_COUNT - 1)
+
+ /** Task status mode constant, for passing to Scheduler_SetTaskMode() or Scheduler_SetGroupTaskMode(). */
+ #define TASK_RUN true
+
+ /** Task status mode constant, for passing to Scheduler_SetTaskMode() or Scheduler_SetGroupTaskMode(). */
+ #define TASK_STOP false
+
+ /** Starts the scheduler in its infinite loop, executing running tasks. This should be placed at the end
+ * of the user application's main() function, as it can never return to the calling function.
+ */
+ #define Scheduler_Start() Scheduler_GoSchedule(TOTAL_TASKS);
+
+ /** Initializes the scheduler so that the scheduler functions can be called before the scheduler itself
+ * is started. This must be exeucted before any scheduler function calls other than Scheduler_Start(),
+ * and can be ommitted if no such functions could be called before the scheduler is started.
+ */
+ #define Scheduler_Init() Scheduler_InitScheduler(TOTAL_TASKS);
+
+ /* Type Defines: */
+ /** Type define for a pointer to a scheduler task. */
+ typedef void (*TaskPtr_t)(void);
+
+ /** Type define for a variable which can hold a tick delay value for the scheduler up to the maximum delay
+ * possible.
+ */
+ typedef uint16_t SchedulerDelayCounter_t;
+
+ /** Structure for holding a single task's information in the scheduler task list. */
+ typedef struct
+ {
+ TaskPtr_t Task; /**< Pointer to the task to execute. */
+ bool TaskStatus; /**< Status of the task (either TASK_RUN or TASK_STOP). */
+ uint8_t GroupID; /**< Group ID of the task so that its status can be changed as a group. */
+ } TaskEntry_t;
+
+ /* Global Variables: */
+ /** Task entry list, containing the scheduler tasks, task statuses and group IDs. Each entry is of type
+ * TaskEntry_t and can be manipulated as desired, although it is preferential that the proper Scheduler
+ * functions should be used instead of direct manipulation.
+ */
+ extern TaskEntry_t Scheduler_TaskList[];
+
+ /** Contains the total number of tasks in the task list, irrespective of if the task's status is set to
+ * TASK_RUN or TASK_STOP.
+ *
+ * \note This value should be treated as read-only, and never altered in user-code.
+ */
+ extern volatile uint8_t Scheduler_TotalTasks;
+
+ /** Contains the current scheduler tick count, for use with the delay functions. If the delay functions
+ * are used in the user code, this should be incremented each tick period so that the delays can be
+ * calculated.
+ */
+ extern volatile SchedulerDelayCounter_t Scheduler_TickCounter;
+
+ /* Inline Functions: */
+ /** Resets the delay counter value to the current tick count. This should be called to reset the period
+ * for a delay in a task which is dependant on the current tick value.
+ *
+ * \param DelayCounter Counter which is storing the starting tick count for a given delay.
+ */
+ static inline void Scheduler_ResetDelay(SchedulerDelayCounter_t* const DelayCounter)
+ ATTR_NON_NULL_PTR_ARG(1);
+ static inline void Scheduler_ResetDelay(SchedulerDelayCounter_t* const DelayCounter)
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ *DelayCounter = Scheduler_TickCounter;
+ }
+ }
+
+ /* Function Prototypes: */
+ /** Determines if the given tick delay has elapsed, based on the given .
+ *
+ * \param Delay The delay to test for, measured in ticks
+ * \param DelayCounter The counter which is storing the starting tick value for the delay
+ *
+ * \return Boolean true if the delay has elapsed, false otherwise
+ *
+ * Usage Example:
+ * \code
+ * static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on startup
+ *
+ * // Task runs every 10000 ticks, 10 seconds for this demo
+ * if (Scheduler_HasDelayElapsed(10000, &DelayCounter))
+ * {
+ * // Code to execute after delay interval elapsed here
+ * }
+ * \endcode
+ */
+ bool Scheduler_HasDelayElapsed(const uint16_t Delay,
+ SchedulerDelayCounter_t* const DelayCounter)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(2);
+
+ /** Sets the task mode for a given task.
+ *
+ * \param Task Name of the task whose status is to be changed
+ * \param TaskStatus New task status for the task (TASK_RUN or TASK_STOP)
+ */
+ void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus);
+
+ /** Sets the task mode for a given task group ID, allowing for an entire group of tasks to have their
+ * statuses changed at once.
+ *
+ * \param GroupID Value of the task group ID whose status is to be changed
+ * \param TaskStatus New task status for tasks in the specified group (TASK_RUN or TASK_STOP)
+ */
+ void Scheduler_SetGroupTaskMode(const uint8_t GroupID, const bool TaskStatus);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define TOTAL_TASKS (sizeof(Scheduler_TaskList) / sizeof(TaskEntry_t))
+ #define MAX_DELAYCTR_COUNT 0xFFFF
+
+ /* Inline Functions: */
+ static inline void Scheduler_InitScheduler(const uint8_t TotalTasks)
+ {
+ Scheduler_TotalTasks = TotalTasks;
+ }
+
+ static inline void Scheduler_GoSchedule(const uint8_t TotalTasks) ATTR_NO_RETURN;
+ static inline void Scheduler_GoSchedule(const uint8_t TotalTasks)
+ {
+ Scheduler_InitScheduler(TotalTasks);
+
+ for (;;)
+ {
+ TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
+
+ while (CurrTask != &Scheduler_TaskList[TotalTasks])
+ {
+ if (CurrTask->TaskStatus == TASK_RUN)
+ CurrTask->Task();
+
+ CurrTask++;
+ }
+ }
+ }
+ #endif
+
+ /* Disable C linkage for C++ Compilers: */
+ #if defined(__cplusplus)
+ }
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/SchedulerOverview.txt b/digital/avr/modules/usb/lufa/LUFA/SchedulerOverview.txt
new file mode 100644
index 00000000..0a4f4928
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/SchedulerOverview.txt
@@ -0,0 +1,31 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_SchedulerOverview LUFA Scheduler Overview
+ *
+ * The LUFA library comes with a small, basic round-robbin scheduler which allows for small "tasks" to be executed
+ * continuously in sequence, and enabled/disabled at runtime. Unlike a conventional, complex RTOS scheduler, the
+ * LUFA scheduler is very simple in design and operation and is essentially a loop conditionally executing a series
+ * of functions.
+ *
+ * Each LUFA scheduler task should be written similar to an ISR; it should execute quickly (so that no one task
+ * hogs the processor, preventing another from running before some sort of timeout is exceeded). Unlike normal RTOS
+ * tasks, each LUFA scheduler task is a regular function, and thus must be designed to be called, and designed to
+ * return to the calling scheduler function repeatedly. Data which must be preserved between task calls should be
+ * declared as global or (prefferably) as a static local variable inside the task.
+ *
+ * The scheduler consists of a task list, listing all the tasks which can be executed by the scheduler. Once started,
+ * each task is then called one after another, unless the task is stopped by another running task or interrupt.
+ *
+ *
+ * If desired, the LUFA scheduler <b>does not need to be used</b> in a LUFA powered application. A more conventional
+ * approach to application design can be used, or a proper scheduling RTOS inserted in the place of the LUFA scheduler.
+ * In the case of the former the USB task must be run manually repeatedly to maintain USB communications, and in the
+ * case of the latter a proper RTOS task must be set up to do the same.
+ *
+ *
+ * For more information on the LUFA scheduler, see the Scheduler.h file documentation.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/VIDAndPIDValues.txt b/digital/avr/modules/usb/lufa/LUFA/VIDAndPIDValues.txt
new file mode 100644
index 00000000..9d650b7b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/VIDAndPIDValues.txt
@@ -0,0 +1,224 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_VIDPID VID and PID values
+ *
+ * The LUFA library uses VID/PID combinations generously donated by Atmel. The following VID/PID combinations
+ * are used within the LUFA demos, and thus may be re-used by derivations of each demo. Free PID values may be
+ * used by future LUFA demo projects.
+ *
+ * These VID/PID values should not be used in commercial designs under any circumstances. Private projects may
+ * use the following values freely, but must accept any collisions due to other LUFA derived private projects
+ * sharing identical values. It is suggested that private projects using interfaces compatible with existing
+ * demos share the save VID/PID value.
+ *
+ * <table>
+ *
+ * <tr>
+ * <td>
+ * <b>VID</b>
+ * </td>
+ * <td>
+ * <b>PID</b>
+ * </td>
+ * <td>
+ * <b>Usage</b>
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2040
+ * </td>
+ * <td>
+ * Test Application
+ * </td>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2041
+ * </td>
+ * <td>
+ * Mouse Demo Application (and derivatives)
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2042
+ * </td>
+ * <td>
+ * Keyboard Demo Application (and derivatives)
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2043
+ * </td>
+ * <td>
+ * Joystick Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2044
+ * </td>
+ * <td>
+ * CDC Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2045
+ * </td>
+ * <td>
+ * Mass Storage Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2046
+ * </td>
+ * <td>
+ * Audio Output Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2047
+ * </td>
+ * <td>
+ * Audio Input Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2048
+ * </td>
+ * <td>
+ * MIDI Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x2049
+ * </td>
+ * <td>
+ * MagStripe Project
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204A
+ * </td>
+ * <td>
+ * CDC Bootloader
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204B
+ * </td>
+ * <td>
+ * USB to Serial Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204C
+ * </td>
+ * <td>
+ * RNDIS Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204D
+ * </td>
+ * <td>
+ * Keyboard and Mouse Combination Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204E
+ * </td>
+ * <td>
+ * Dual CDC Demo Application
+ * </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>
+ * 0x03EB
+ * </td>
+ * <td>
+ * 0x204F
+ * </td>
+ * <td>
+ * * UNUSED - FREE FOR PRIVATE HOBBYIST PROJECTS UNTIL ALLOCATED *
+ * </td>
+ * </tr>
+ *
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/Version.h b/digital/avr/modules/usb/lufa/LUFA/Version.h
new file mode 100644
index 00000000..a606beeb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/Version.h
@@ -0,0 +1,49 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Version constants for informational purposes and version-specific macro creation. This header file contains the
+ * current LUFA version number in several forms, for use in the user-application (for example, for printing out
+ * whilst debugging, or for testing for version compatibility).
+ */
+
+#ifndef __LUFA_VERSION_H__
+#define __LUFA_VERSION_H__
+
+ /* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Indicates the version number of the library, as an integer. */
+ #define LUFA_VERSION_INTEGER 090209
+
+ /** Indicates the version number of the library, as a string. */
+ #define LUFA_VERSION_STRING "090209"
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/LUFA/WritingBoardDrivers.txt b/digital/avr/modules/usb/lufa/LUFA/WritingBoardDrivers.txt
new file mode 100644
index 00000000..0d0e74d0
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/WritingBoardDrivers.txt
@@ -0,0 +1,26 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \page Page_WritingBoardDrivers Writing LUFA Board Drivers
+ *
+ * LUFA ships with several basic pre-made board drivers, to control hardware present on the supported board
+ * hardware - such as Dataflash ICs, LEDs, Joysticks, or other hardware peripherals. When compiling an application
+ * which makes use of one or more board drivers located in LUFA/Drivers/Board, you must also indicate what board
+ * hardware you are using in your project makefile. This is done by defining the BOARD macro using the -D switch
+ * passed to the compiler, with a constant of BOARD_{Name}. For example <b>-DBOARD=BOARD_USBKEY</b> instructs the
+ * compiler to use the USBKEY board hardware drivers.
+ *
+ * If your application does not use *any* board level drivers, you can ommit the definition of the BOARD macro.
+ * However, some users may wish to write their own custom board hardware drivers which are to remain compatible
+ * with the LUFA hardware API. To do this, the BOARD macro should be defined to the value BOARD_USER. This indicates
+ * that the board level drivers should be located in a folder named "Board" located inside the application's folder.
+ *
+ * When used, the driver stub files located in the DriverStubs folder should be copied to the user Board directory,
+ * and fleshed out to include the values and code needed to control the custom board hardware. Once done, the existing
+ * LUFA board level APIs (accessed in the regular LUFA/Drivers/Board/ folder) will redirect to the user board drivers,
+ * maintaining code compatibility and allowing for a different board to be selected through the project makefile with
+ * no code changes.
+ */
diff --git a/digital/avr/modules/usb/lufa/LUFA/makefile b/digital/avr/modules/usb/lufa/LUFA/makefile
new file mode 100644
index 00000000..4020936f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/LUFA/makefile
@@ -0,0 +1,42 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2009.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Makefile for the LUFA library itself.
+
+LUFA_SRC_FILES = ./Drivers/USB/LowLevel/LowLevel.c \
+ ./Drivers/USB/LowLevel/Endpoint.c \
+ ./Drivers/USB/LowLevel/Pipe.c \
+ ./Drivers/USB/LowLevel/DevChapter9.c \
+ ./Drivers/USB/LowLevel/HostChapter9.c \
+ ./Drivers/USB/LowLevel/Host.c \
+ ./Drivers/USB/HighLevel/USBTask.c \
+ ./Drivers/USB/HighLevel/USBInterrupt.c \
+ ./Drivers/USB/HighLevel/Events.c \
+ ./Drivers/USB/HighLevel/StdDescriptors.c \
+ ./Drivers/USB/Class/HIDParser.c \
+ ./Drivers/USB/Class/ConfigDescriptor.c \
+ ./Scheduler/Scheduler.c \
+ ./MemoryAllocator/DynAlloc.c \
+ ./Drivers/Board/Temperature.c \
+ ./Drivers/AT90USBXXX/Serial.c \
+ ./Drivers/AT90USBXXX/Serial_Stream.c \
+
+all:
+
+clean:
+ rm -f $(LUFA_SRC_FILES:%.c=%.o)
+
+clean_list:
+
+doxygen:
+ @echo Generating Library Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Firmware_Design.txt b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Firmware_Design.txt
new file mode 100644
index 00000000..643454d4
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Firmware_Design.txt
@@ -0,0 +1,176 @@
+Instructions for converting the LUFA USBtoSerial Demo to an AVR ISP Programmer.
+By Opendous Inc., Copyright under the Creative Commons Attribution License:
+http://creativecommons.org/licenses/by/3.0/
+
+1) Start with the LUFA/Demos/USBtoSerial firmware.
+ - rename USBtoSerial.c, USBtoSerial.h, and USBtoSerial.aps to
+ AVRISP_Programmer.*
+ - edit AVRISP_Programmer.aps and rename all instances of "USBtoSerial" to
+ "AVRISP_Programmer"
+ - copy AVRISP_Programmer.txt from an older version of AVRISP_Programmer
+
+2) Edit makefile by changing TARGET from "USBtoSerial" to "AVRISP_Programmer"
+
+3) Edit AVRISP_Programmer.h:
+ - change ifdef _USB_TO_SERIAL_H to _AVRISP_PROGRAMMER_H_
+ - rename ReconfigureUSART(void) to ReconfigureSPI(void)
+ - add void processHostSPIRequest(void); & void delay_ms(uint8_t dly);
+ - replace the define for Serial.h with one for SPI.h:
+ #include <libs/LUFA/Drivers/AT90USBXXX/SPI.h>
+
+4) Make alterations to Descriptors.c
+ - change manufacturer string to "www.AVRopendous.org", length=19
+ - change product string to "LUFA-Based AVR ISP Programmer", length=29
+
+5) Edit Ringbuff.h to enable the Peek Command: #define BUFF_USEPEEK
+
+6) Edit AVRISP_Programmer.c:
+ - change #include "USBtoSerial.h" to #include "AVRISP_Programmer.h"
+ - change BUTTLOADTAG(ProjName to "LUFA AVR910 ISP Programmer"
+ - in main(), rename ReconfigureUSART() to Reconfigure();
+ - in EVENT_HANDLER(USB_UnhandledControlPacket), rename ReconfigureUSART
+ - delete the ISRs: ISR(USART1_RX_vect) & ISR(USART1_TX_vect)
+ - delete ReconfigureUSART(void)
+ - add void ReconfigureSPI(void), void processHostSPIRequest(void),
+ and void delay_ms(uint8_t dly) from a previous version
+ - add Timer1 and SPI initialization code to main():
+ /* Hardware Initialization */
+ //LEDs_Init();
+ DDRB = 0;
+ PORTB = 0;
+ DDRC |= ((1 << PC2) | (1 << PC4) | (1 << PC5) | (1 << PC6) | (1 << PC7)); //AT90USBxx2
+ // PC2 is also used for RESET, so set it HIGH initially - note 'P' command sets it to LOW (Active)
+ PORTC |= ((1 << PC2) | (1 << PC4) | (1 << PC5) | (1 << PC6) | (1 << PC7)); //AT90USBxx2
+ DDRD = 0;
+ PORTD = (1 << PB7); // only PB7(HWB) should be High as this is the bootloader pin
+ // Prepare PortB for SPI - set PB0(^SS), PB1(SCK), PB2(MOSI) as output as well as all other pins except PB3(MISO)
+ DDRB = (1 << PB0) | (1 << PB1) | (1 << PB2) | (0 << PB3) | (1 << PB4) | (1 << PB5) | (1 << PB6) | (1 << PB7);
+ PORTB |= (1 << PB0);
+
+ // initialize Timer1 for use in delay function
+ TCCR1A = 0;
+ //TCCR1B = (1 << CS10); // no prescaling, use CLK
+ TCCR1B = ((1 << CS12) | (1 << CS10)); // prescale by CLK/1024
+ // 8MHz/1024 = 7813 ticks per second --> ~8 ticks per millisecond (ms)
+ timerval = TCNT1; // start timer1
+
+ - In TASK(CDC_Task) in the
+ if (USB_IsConnected) {
+ if (Endpoint_ReadWriteAllowed()) {
+ while (Endpoint_BytesInEndpoint()) {
+ ...
+ structure, after Buffer_StoreElement(&Rx_Buffer, Endpoint_Read_Byte()):
+
+ /* Each time there is an element, check which comand should be
+ run and if enough data is available to run that command.
+ There are 1-byte, 2-byte, 3-byte, 4-byte commands, and 5-byte commands
+ Remember that the "which command" byte counts as 1 */
+ if (Rx_Buffer.Elements == 0) {
+ // do nothing, wait for data
+ } else {
+ tempByte = Buffer_PeekElement(&Rx_Buffer); // peek at first element
+
+ /* make sure the issued command and associated data are all ready */
+ if (Rx_Buffer.Elements == 1) { // zero data byte command
+ if ((tempByte == 'P') | (tempByte == 'a') | (tempByte == 'm') |
+ (tempByte == 'R') | (tempByte == 'd') | (tempByte == 'e') |
+ (tempByte == 'L') | (tempByte == 's') | (tempByte == 't') |
+ (tempByte == 'S') | (tempByte == 'V') | (tempByte == 'v') |
+ (tempByte == 'p') | (tempByte == 'F')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 2) { // one data byte command
+ if ((tempByte == 'T') | (tempByte == 'c') | (tempByte == 'C') |
+ (tempByte == 'D') | (tempByte == 'l') | (tempByte == 'f') |
+ (tempByte == 'x') | (tempByte == 'y')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 3) { // two data byte command
+ if ((tempByte == 'A') | (tempByte == 'Z')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 4) { // three data byte command
+ if ((tempByte == ':')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 5) { // four data byte command
+ if ((tempByte == '.')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else {
+ // do nothing
+ }
+ }
+
+ - need to add code to flush the buffer. Change:
+ /* Check if Rx buffer contains data */
+ if (Rx_Buffer.Elements)
+ {
+ /* Initiate the transmission of the buffer contents if USART idle*/
+ if (!(Transmitting))
+ {
+ Transmitting = true;
+ Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
+ }
+ }
+ To:
+ /* Check if Rx buffer contains data */
+ if (Rx_Buffer.Elements)
+ {
+ /* Initiate the transmission of the buffer contents if USART idle*/
+ if (!(Transmitting))
+ {
+ Transmitting = true;
+ /* The following flushes the receive buffer to prepare for new
+ data and commands. Need to flush the buffer as the command
+ byte which is peeked above needs to be dealt with, otherwise
+ the command bytes will overflow the buffer eventually */
+ //Buffer_GetElement(&Rx_Buffer); // also works
+ Buffer_Initialize(&Rx_Buffer);
+ }
+ }
+
+ - need to add the following defines and globals:
+ #define RESETPORT PORTB
+ #define RESETPIN PB0
+ #define RESETPORT2 PORTC
+ #define RESETPIN2 PC2
+ #define CR_HEX '\r'
+
+ #define DELAY_VERYSHORT 0x01
+ #define DELAY_SHORT 0x02
+ #define DELAY_MEDIUM 0x03
+ #define DELAY_LONG 0x05
+ #define DELAY_MULTIPLE 0x04
+
+ /* AVR Device Codes - Can have a maximum of 14 but can be any you want.
+ Note that these are completely irrelevent. If AVRdude supports a
+ device, then that device is programmable. Use -F switch to ignore
+ device codes. */
+ #define AVRDEVCODE01 0x55 /* ATtiny12 */
+ #define AVRDEVCODE02 0x56 /* ATtiny15 */
+ #define AVRDEVCODE03 0x5E /* ATtiny261 */
+ #define AVRDEVCODE04 0x76 /* ATmega8 */
+ #define AVRDEVCODE05 0x74 /* ATmega16 */
+ #define AVRDEVCODE06 0x72 /* ATmega32 */
+ #define AVRDEVCODE07 0x45 /* ATmega64 */
+ #define AVRDEVCODE08 0x74 /* ATmega644 */
+ #define AVRDEVCODE09 0x43 /* ATmega128 */
+ #define AVRDEVCODE10 0x63 /* ATmega162 */
+ #define AVRDEVCODE11 0x78 /* ATmega169 */
+ #define AVRDEVCODE12 0x6C /* AT90S4434 */
+ #define AVRDEVCODE13 0x38 /* AT90S8515A */
+ #define AVRDEVCODE14 0x65 /* AT90S8555 */
+
+ /* some global variables used throughout */
+ uint8_t tempIOreg = 0;
+ uint8_t tempIOreg2 = 0;
+ uint8_t tempIOreg3 = 0;
+ uint8_t tempIOreg4 = 0;
+ uint8_t dataWidth = 0;
+ uint8_t firstRun = 1;
+ uint8_t deviceCode = 0;
+ uint8_t tempByte = 0;
+ uint16_t currAddress = 0;
+ uint16_t timerval = 0;
+
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.aps b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.aps
new file mode 100644
index 00000000..74800231
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>AVRISP_Programmer</ProjectName><Created>30-Sep-2008 14:18:39</Created><LastEdit>30-Sep-2008 14:18:52</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:18:39</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Demos\AVRISP_Programmer\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>RingBuff.c</SOURCEFILE><SOURCEFILE>AVRISP_Programmer.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>RingBuff.h</HEADERFILE><HEADERFILE>AVRISP_Programmer.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>AVRISP_Programmer.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.c b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.c
new file mode 100644
index 00000000..4dc18cd6
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.c
@@ -0,0 +1,886 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ AVR ISP Programmer code Copyright 2009 Opendous Inc. (www.opendous.org)
+ For more info and usage instructions for this firmware, visit:
+ http://code.google.com/p/avropendous/wiki/AVR_ISP_Programmer
+
+ Note that this firmware is designed to work with AVRdude:
+ http://savannah.nongnu.org/projects/avrdude
+ But should work with other software that supports the AVR910 ISP
+ programmer or STK200 hardware.
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ Usage:
+ avrdude -vv -F -P COM7 -c avr910 -p t261
+ Note -F flag which overrides signature check and enables programming
+ of any "In-System Programmable via SPI Port" AVR MCU. Part number,
+ t261, should be set to your target device.
+ avrdude -vv -F -P COM7 -c avr910 -p t261 -U flash:w:PROG.hex
+ PROG.hex is the hex file to program your t261 AVR with
+ avrdude -vv -F -P COM7 -b 115200 -c avr910 -p t261 -U flash:w:test.hex
+ The -b 115200 sets the SPI clock to 62.5kHz from the default 125kHz and may
+ work when the default programming speed fails.
+ AVROSP.exe -dATtiny261 -cCOM7 -rf
+ AVRosp is the Open Source AVR ISP Programming Software available from Atmel.com
+
+ Note: on Linux systems, COM7 should be replaced with someting like /dev/ttyACM0
+ You can determine this value by running dmesg after plugging in the device
+ Note: you must RESET the programmer after each use (AVRdude session).
+
+ Note: If you experience errors with older devices, try changing the DELAY defines
+
+ MISO, MOSI, and SCK are connected directly from the AVRopendous board
+ to the pin of the same functionality on the target. RESET pin on the target
+ can be connected either to SS (PB0), or PC2. Do not have any other pins
+ connected - especially HWB pin, to avoid unintentional behaviour.
+
+ AVR910 functionality was overlayed on USBtoSerial functionality.
+ Keep this in mind when looking over the code.
+ Default target speed is 125kHz and corresponds to 19200 baud, which
+ is the default setting for AVRdude.
+
+ Changing "Baud-Rate" will change the SPI speed. Defualt SPI clock speed
+ is 8Mhz / 4 = 2MHz. 8Mhz is the device clock speed. This is the setting at
+ 9600 baud. The following is a table of baud-rate vs. SPI Speed that will result
+ 9600 = 2Mhz
+ 14400 = 1MHz
+ 19200 = 125kHz (AVRdude Default)
+ 38400 = 250kHz
+ 57600 = 500kHz
+ 115200 = 62.5kHz
+
+ Before running, you will need to install the INF file that
+ is located in the project directory. This will enable
+ Windows to use its inbuilt CDC drivers, negating the need
+ for special Windows drivers for the device. To install,
+ right-click the .INF file and choose the Install option.
+*/
+
+/* TODO: - fix the requirement that a RESET must be performed after each session, which
+ is only an issue under Windows. Everything works fine under Linux
+*/
+
+#include "AVRISP_Programmer.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "LUFA AVR910 ISP Programmer");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+
+#define RESETPORT PORTB
+#define RESETPIN PB0
+#define RESETPORT2 PORTC
+#define RESETPIN2 PC2
+#define CR_HEX '\r'
+
+#define DELAY_VERYSHORT 0x01
+#define DELAY_SHORT 0x02
+#define DELAY_MEDIUM 0x03
+#define DELAY_LONG 0x05
+#define DELAY_MULTIPLE 0x02
+
+
+/* AVR Device Codes - Can have a maximum of 14 but can be any you want.
+ Note that these are completely irrelevent. If AVRdude supports a device,
+ then that device is programmable. Use -F switch to ignore device codes. */
+#define AVRDEVCODE01 0x55 /* ATtiny12 */
+#define AVRDEVCODE02 0x56 /* ATtiny15 */
+#define AVRDEVCODE03 0x5E /* ATtiny261 */
+#define AVRDEVCODE04 0x76 /* ATmega8 */
+#define AVRDEVCODE05 0x74 /*ATmega16 */
+#define AVRDEVCODE06 0x72 /* ATmega32 */
+#define AVRDEVCODE07 0x45 /* ATmega64 */
+#define AVRDEVCODE08 0x74 /* ATmega644 */
+#define AVRDEVCODE09 0x43 /* ATmega128 */
+#define AVRDEVCODE10 0x63 /* ATmega162 */
+#define AVRDEVCODE11 0x78 /* ATmega169 */
+#define AVRDEVCODE12 0x6C /* AT90S4434 */
+#define AVRDEVCODE13 0x38 /* AT90S8515A */
+#define AVRDEVCODE14 0x65 /* AT90S8555 */
+
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: CDC_Task , TaskStatus: TASK_STOP },
+};
+
+/* Globals: */
+/** Contains the current baud rate and other settings of the virtual serial port.
+ *
+ These values are set by the host via a class-specific request, and the physical USART should be reconfigured to match the
+ new settings each time they are changed by the host.
+ */
+CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
+ CharFormat: OneStopBit,
+ ParityType: Parity_None,
+ DataBits: 8 };
+
+/** Ring (circular) buffer to hold the RX data - data from the host to the attached device on the serial port. */
+RingBuff_t Rx_Buffer;
+
+/** Ring (circular) buffer to hold the TX data - data from the attached device on the serial port to the host. */
+RingBuff_t Tx_Buffer;
+
+/** Flag to indicate if the USART is currently transmitting data from the Rx_Buffer circular buffer. */
+volatile bool Transmitting = false;
+
+
+/* some global variables used throughout */
+uint8_t tempIOreg = 0;
+uint8_t tempIOreg2 = 0;
+uint8_t tempIOreg3 = 0;
+uint8_t tempIOreg4 = 0;
+uint8_t dataWidth = 0;
+uint8_t firstRun = 1;
+uint8_t deviceCode = 0;
+uint8_t tempByte = 0;
+uint16_t currAddress = 0;
+uint16_t timerval = 0;
+
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ LEDs_Init();
+ ReconfigureSPI();
+ // prepare PortB
+ DDRB = 0;
+ PORTB = 0;
+ DDRC |= ((1 << PC2) | (1 << PC4) | (1 << PC5) | (1 << PC6) | (1 << PC7)); //AT90USBxx2
+ // PC2 is also used for RESET, so set it HIGH initially - note 'P' command sets it to LOW (Active)
+ PORTC |= ((1 << PC2) | (1 << PC4) | (1 << PC5) | (1 << PC6) | (1 << PC7)); //AT90USBxx2
+ DDRD = 0;
+ PORTD = (1 << PB7); // only PB7(HWB) should be High as this is the bootloader pin
+ // Prepare PortB for SPI - set PB0(^SS), PB1(SCK), PB2(MOSI) as output as well as all other pins except PB3(MISO)
+ DDRB = (1 << PB0) | (1 << PB1) | (1 << PB2) | (0 << PB3) | (1 << PB4) | (1 << PB5) | (1 << PB6) | (1 << PB7);
+ PORTB |= (1 << PB0);
+ // make sure DataFlash devices to not interfere - deselect them by setting PE0 and PE1 HIGH:
+ PORTE = 0xFF;
+ DDRE = 0xFF;
+
+ // initialize Timer1 for use in delay function
+ TCCR1A = 0;
+ //TCCR1B = (1 << CS10); // no prescaling, use CLK
+ TCCR1B = ((1 << CS12) | (1 << CS10)); // prescale by CLK/1024
+ // 8MHz/1024 = 7813 ticks per second --> ~8 ticks per millisecond (ms)
+ timerval = TCNT1; // start timer1
+
+
+ /* Ringbuffer Initialization */
+ Buffer_Initialize(&Rx_Buffer);
+ Buffer_Initialize(&Tx_Buffer);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
+ starts the library USB task to begin the enumeration and USB management process.
+ */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+
+ /* Indicate USB enumerating */
+ UpdateStatus(Status_USBEnumerating);
+}
+
+/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
+ the status LEDs and stops the USB management and CDC management tasks.
+ */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running CDC and USB management tasks */
+ Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+
+ /* Indicate USB not ready */
+ UpdateStatus(Status_USBNotReady);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
+ of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Indicate USB connected and ready */
+ UpdateStatus(Status_USBReady);
+
+ /* Start CDC task */
+ Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ control requests that are not handled internally by the USB library (including the CDC control commands,
+ which are all issued via the control endpoint), so that they can be handled appropriately for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ uint8_t* LineCodingData = (uint8_t*)&LineCoding;
+
+ /* Process CDC specific control requests */
+ switch (bRequest)
+ {
+ case REQ_GetLineEncoding:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Write the line coding data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_SetLineEncoding:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Read the line coding data in from the host into the global struct */
+ Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
+
+ /* Finalize the stream transfer to clear the last packet from the host */
+ Endpoint_ClearSetupIN();
+
+ /* Reconfigure the USART with the new settings */
+ ReconfigureSPI();
+ }
+
+ break;
+ case REQ_SetControlLineState:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+#if 0
+ /* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake
+ lines. The mask is read in from the wValue parameter, and can be masked against the CONTROL_LINE_OUT_* masks
+ to determine the RTS and DTR line states using the following code:
+ */
+
+ uint16_t wIndex = Endpoint_Read_Word_LE();
+
+ // Do something with the given line states in wIndex
+#endif
+
+ /* Acknowedge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSetupReceived();
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** Task to manage CDC data transmission and reception to and from the host, from and to the physical USART. */
+TASK(CDC_Task)
+{
+ if (USB_IsConnected)
+ {
+#if 0
+ /* NOTE: Here you can use the notification endpoint to send back line state changes to the host, for the special RS-232
+ handshake signal lines (and some error states), via the CONTROL_LINE_IN_* masks and the following code:
+ */
+
+ USB_Notification_Header_t Notification = (USB_Notification_Header_t)
+ {
+ NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+ Notification: NOTIF_SerialState,
+ wValue: 0,
+ wIndex: 0,
+ wLength: sizeof(uint16_t),
+ };
+
+ uint16_t LineStateMask;
+
+ // Set LineStateMask here to a mask of CONTROL_LINE_IN_* masks to set the input handshake line states to send to the host
+
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+ Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
+ Endpoint_Write_Stream_LE(&LineStateMask, sizeof(LineStateMask));
+ Endpoint_ClearCurrentBank();
+#endif
+
+ /* Select the Serial Rx Endpoint */
+ Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Read the received data endpoint into the transmission buffer */
+ while (Endpoint_BytesInEndpoint())
+ {
+ /* Wait until the buffer has space for a new character */
+ while (!((BUFF_STATICSIZE - Rx_Buffer.Elements)));
+
+ /* Store each character from the endpoint */
+ Buffer_StoreElement(&Rx_Buffer, Endpoint_Read_Byte());
+
+
+
+
+ /* Each time there is an element, check which comand should be
+ run and if enough data is available to run that command.
+ There are 1-byte, 2-byte, 3-byte, 4-byte commands, and 5-byte commands
+ Remember that the "which command" byte counts as 1 */
+ if (Rx_Buffer.Elements == 0) {
+ // do nothing, wait for data
+ } else {
+ tempByte = Buffer_PeekElement(&Rx_Buffer); // peek at first element
+
+ /* make sure the issued command and associated data are all ready */
+ if (Rx_Buffer.Elements == 1) { // zero data byte command
+ if ((tempByte == 'P') | (tempByte == 'a') | (tempByte == 'm') |
+ (tempByte == 'R') | (tempByte == 'd') | (tempByte == 'e') |
+ (tempByte == 'L') | (tempByte == 's') | (tempByte == 't') |
+ (tempByte == 'S') | (tempByte == 'V') | (tempByte == 'v') |
+ (tempByte == 'p') | (tempByte == 'F')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 2) { // one data byte command
+ if ((tempByte == 'T') | (tempByte == 'c') | (tempByte == 'C') |
+ (tempByte == 'D') | (tempByte == 'l') | (tempByte == 'f') |
+ (tempByte == 'x') | (tempByte == 'y')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 3) { // two data byte command
+ if ((tempByte == 'A') | (tempByte == 'Z')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 4) { // three data byte command
+ if ((tempByte == ':')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else if (Rx_Buffer.Elements == 5) { // four data byte command
+ if ((tempByte == '.')) {
+ processHostSPIRequest(); // command has enough data, process it
+ }
+ } else {
+ // do nothing
+ }
+ }
+
+
+
+ }
+
+ /* Clear the endpoint buffer */
+ Endpoint_ClearCurrentBank();
+ }
+
+ /* Check if Rx buffer contains data */
+ if (Rx_Buffer.Elements)
+ {
+ /* Initiate the transmission of the buffer contents if USART idle */
+ if (!(Transmitting))
+ {
+ Transmitting = true;
+ /* The following flushes the receive buffer to prepare for new data and commands */
+ /* Need to flush the buffer as the command byte which is peeked above needs to be */
+ /* dealt with, otherwise the command bytes will overflow the buffer eventually */
+ //Buffer_GetElement(&Rx_Buffer); // works also
+ Buffer_Initialize(&Rx_Buffer);
+ }
+ }
+
+ /* Select the Serial Tx Endpoint */
+ Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+
+ /* Check if the Tx buffer contains anything to be sent to the host */
+ if (Tx_Buffer.Elements)
+ {
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Check before sending the data if the endpoint is completely full */
+ bool IsFull = (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE);
+
+ /* Write the transmission buffer contents to the received data endpoint */
+ while (Tx_Buffer.Elements && (Endpoint_BytesInEndpoint() < CDC_TXRX_EPSIZE))
+ Endpoint_Write_Byte(Buffer_GetElement(&Tx_Buffer));
+
+ /* Send the data */
+ Endpoint_ClearCurrentBank();
+
+ /* If a full endpoint was sent, we need to send an empty packet afterwards to terminate the transfer */
+ if (IsFull)
+ {
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Send an empty packet to terminate the transfer */
+ Endpoint_ClearCurrentBank();
+ }
+ }
+ }
+}
+
+
+
+/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
+ log to a serial port, or anything else that is suitable for status updates.
+ *
+ \param CurrentStatus Current status of the system, from the USBtoSerial_StatusCodes_t enum
+ */
+void UpdateStatus(uint8_t CurrentStatus)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Set the LED mask to the appropriate LED mask based on the given status code */
+ switch (CurrentStatus)
+ {
+ case Status_USBNotReady:
+ LEDMask = (LEDS_LED1);
+ break;
+ case Status_USBEnumerating:
+ LEDMask = (LEDS_LED1 | LEDS_LED2);
+ break;
+ case Status_USBReady:
+ LEDMask = (LEDS_LED2 | LEDS_LED4);
+ break;
+ }
+
+ /* Set the board LEDs to the new LED mask */
+ LEDs_SetAllLEDs(LEDMask);
+}
+
+
+/** Reconfigures SPI to match the current serial port settings issued by the host. */
+void ReconfigureSPI(void)
+{
+ uint8_t SPCRmask = (1 << SPE) | (1 << MSTR); // always enable SPI as Master
+ uint8_t SPSRmask = 0;
+
+ /* Determine data width */
+ if (LineCoding.ParityType == Parity_Odd) {
+ dataWidth = 16;
+ } else if (LineCoding.ParityType == Parity_Even) {
+ dataWidth = 32;
+ } else if (LineCoding.ParityType == Parity_None) {
+ dataWidth = 8;
+ }
+
+ /* Determine stop bits - 1.5 stop bits is set as 1 stop bit due to hardware limitations */
+ /* For SPI, determine whether format is LSB or MSB */
+ if (LineCoding.CharFormat == TwoStopBits) {
+ SPCRmask |= (1 << DORD);
+ } else if (LineCoding.CharFormat == OneStopBit) {
+ SPCRmask |= (0 << DORD);
+ }
+
+ /* Determine data size - 5, 6, 7, or 8 bits are supported */
+ /* Changing line coding changes SPI Mode
+ CPOL=0, CPHA=0 Sample (Rising) Setup (Falling) SPI-Mode0 == 8 bits line coding
+ CPOL=0, CPHA=1 Setup (Rising) Sample (Falling) SPI-Mode1 == 7 bits line coding
+ CPOL=1, CPHA=0 Sample (Falling) Setup (Rising) SPI-Mode2 == 6 bits line coding
+ CPOL=1, CPHA=1 Setup (Falling) Sample (Rising) SPI-Mode3 == 5 bits line coding
+ */
+ if (LineCoding.DataBits == 5) {
+ SPCRmask |= ((1 << CPOL) | (1 << CPHA));
+ } else if (LineCoding.DataBits == 6) {
+ SPCRmask |= ((1 << CPOL) | (0 << CPHA));
+ } else if (LineCoding.DataBits == 7) {
+ SPCRmask |= ((0 << CPOL) | (1 << CPHA));
+ } else if (LineCoding.DataBits == 8) {
+ SPCRmask |= ((0 << CPOL) | (0 << CPHA));
+ }
+
+
+ /* Set the USART baud rate register to the desired baud rate value */
+ /* also alter the SPI speed via value of baud rate */
+ if (LineCoding.BaudRateBPS == 9600) { // 2Mhz SPI (Fosc / 4)
+ SPCRmask |= ((0 << SPR1) | (0 << SPR0));
+ SPSRmask |= (0 << SPI2X);
+ } else if (LineCoding.BaudRateBPS == 14400) { // 1Mhz SPI (Fosc / 8)
+ SPCRmask |= ((0 << SPR1) | (1 << SPR0));
+ SPSRmask |= (1 << SPI2X);
+ } else if (LineCoding.BaudRateBPS == 57600) { // 500kHz SPI (Fosc / 16)
+ SPCRmask |= ((0 << SPR1) | (1 << SPR0));
+ SPSRmask |= (0 << SPI2X);
+ } else if (LineCoding.BaudRateBPS == 38400) { // 250kHz SPI (Fosc / 32)
+ SPCRmask |= ((1 << SPR1) | (0 << SPR0));
+ SPSRmask |= (1 << SPI2X);
+ } else if (LineCoding.BaudRateBPS == 19200) { // 125kHz SPI (Fosc / 64)
+ SPCRmask |= ((1 << SPR1) | (0 << SPR0));
+ SPSRmask |= (0 << SPI2X);
+ } else if (LineCoding.BaudRateBPS == 115200) { // 62.5kHz SPI (Fosc / 128)
+ SPCRmask |= ((1 << SPR1) | (1 << SPR0));
+ SPSRmask |= (0 << SPI2X);
+ }
+
+ SPCR = SPCRmask;
+ SPSR = SPSRmask;
+
+ // only read if first run
+ if (firstRun) {
+ tempIOreg = SPSR; //need to read to initiliaze
+ tempIOreg = SPDR; //need to read to initiliaze
+ firstRun = 0;
+ }
+
+}
+
+
+/* process data according to AVR910 protocol */
+void processHostSPIRequest(void) {
+
+ uint8_t readByte1 = 0;
+ uint8_t readByte2 = 0;
+ uint8_t readByte3 = 0;
+ uint8_t readByte4 = 0;
+ uint8_t firstByte = 0;
+
+ /* Taken from a90isp_ver23.asm:
+ +-------------+------------+------+
+ ;* Commands | Host writes | Host reads | |
+ ;* -------- +-----+-------+------+-----+ |
+ ;* | ID | data | data | | Note |
+ ;* +-----------------------------------+-----+-------+------+-----+------+
+ ;* | Enter programming mode | 'P' | | | 13d | 1 |
+ ;* | Report autoincrement address | 'a' | | | 'Y' | |
+ ;* | Set address | 'A' | ah al | | 13d | 2 |
+ ;* | Write program memory, low byte | 'c' | dd | | 13d | 3 |
+ ;* | Write program memory, high byte | 'C' | dd | | 13d | 3 |
+ ;* | Issue Page Write | 'm' | | | 13d | |
+ ;* | Read program memory | 'R' | |dd(dd)| | 4 |
+ ;* | Write data memory | 'D' | dd | | 13d | |
+ ;* | Read data memory | 'd' | | dd | | |
+ ;* | Chip erase | 'e' | | | 13d | |
+ ;* | Write lock bits | 'l' | dd | | 13d | |
+ ;* | Write fuse bits | 'f' | dd | | 13d | 11 |
+ ;* | Read fuse and lock bits | 'F' | | dd | | 11 |
+ ;* | Leave programming mode | 'L' | | | 13d | 5 |
+ ;* | Select device type | 'T' | dd | | 13d | 6 |
+ ;* | Read signature bytes | 's' | | 3*dd | | |
+ ;* | Return supported device codes | 't' | | n*dd | 00d | 7 |
+ ;* | Return software identifier | 'S' | | s[7] | | 8 |
+ ;* | Return sofware version | 'V' | |dd dd | | 9 |
+ ;* | Return hardware version | 'v' | |dd dd | | 9 |
+ ;* | Return programmer type | 'p' | | dd | | 10 |
+ ;* | Set LED | 'x' | dd | | 13d | 12 |
+ ;* | Clear LED | 'y' | dd | | 13d | 12 |
+ ;* | Universial command | ':' | 3*dd | dd | 13d | |
+ ;* | New universal command | '.' | 4*dd | dd | 13d | |
+ ;* | Special test command | 'Z' | 2*dd | dd | | |
+ */
+
+ firstByte = Buffer_GetElement(&Rx_Buffer);
+ Buffer_Initialize(&Tx_Buffer); // make sure the buffer is clear before proceeding
+
+ if (firstByte == 'P') { // enter Programming mode
+ // enable SPI -- already done
+ // enter programming mode on target:
+ //PORTB = 0; // set clock to zero
+ RESETPORT = (1 << RESETPIN); // set RESET pin on target to 1
+ RESETPORT2 = (1 << RESETPIN2);
+ delay_ms(DELAY_SHORT);
+ //RESETPORT = (RESETPORT & ~(1 << RESETPIN)); // set RESET pin on target to 0 - Active
+ RESETPORT = 0x00;
+ RESETPORT2 = 0;
+ delay_ms(DELAY_SHORT);
+ SPI_SendByte(0xAC);
+ SPI_SendByte(0x53);
+ SPI_SendByte(0x00);
+ SPI_SendByte(0x00);
+ delay_ms(DELAY_VERYSHORT);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'T') { // Select device type
+ deviceCode = Buffer_GetElement(&Rx_Buffer); // set device type
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'a') { // Report autoincrement address
+ Buffer_StoreElement(&Tx_Buffer, 'Y'); // return 'Y' - Auto-increment enabled
+
+ } else if (firstByte == 'A') { //Load Address
+ // get two bytes over serial and set currAddress to them
+ readByte1 = Buffer_GetElement(&Rx_Buffer); // high byte
+ readByte2 = Buffer_GetElement(&Rx_Buffer); // low byte
+ currAddress = (readByte1 << 8) | (readByte2);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'c') { // Write program memory, low byte
+ // send 4 bytes over SPI; 0x40, then Address High Byte, then Low, then data
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ SPI_SendByte(0x40);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ SPI_SendByte(readByte1); // data
+ delay_ms(DELAY_MEDIUM); // certain MCUs require a delay of about 24585 cycles
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'C') { // Write program memory, high byte
+ // send 4 bytes over SPI; 0x48, then Address High Byte, then Low, then data
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ SPI_SendByte(0x48);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ SPI_SendByte(readByte1); // data
+ currAddress++; // increment currAddress
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'm') { // Write Program Memory Page
+ // send 4 bytes over SPI; 0x4c, then Address High Byte, then Low, then 0x00
+ SPI_SendByte(0x4C);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ SPI_SendByte(0x00);
+ delay_ms(DELAY_LONG);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'R') { // Read Program Memory
+ // send 4 bytes over SPI; 0x28, then Address High Byte, then Low, then send back read data from 4th byte over serial
+ SPI_SendByte(0x28);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ readByte1 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ // send 4 bytes over SPI; 0x20, then Address High Byte, then Low, then send back read data from 4th byte over serial
+ SPI_SendByte(0x20);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ readByte2 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte2);
+ currAddress++; // increment currAddress
+
+ } else if (firstByte == 'D') { // Write Data Memory
+ // send 4 bytes over SPI; 0xc0, then Address High Byte, then Low, then data
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ SPI_SendByte(0xC0);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ SPI_SendByte(readByte1); // data
+ delay_ms(DELAY_MEDIUM);
+ currAddress++; // increment currAddress
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'd') { // Read Data Memory
+ // send 4 bytes over SPI; 0xa0, then Address High Byte, then Low, then send back read data from 4th byte over serial
+ SPI_SendByte(0xA0);
+ SPI_SendByte((currAddress >> 8)); // high byte
+ SPI_SendByte((currAddress)); // low byte
+ readByte1 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ currAddress++; // increment currAddress
+
+ } else if (firstByte == 'e') { // erase the target device
+ // send 4 bytes over SPI; 0xac, 0x80, 0x04, 0x00
+ SPI_SendByte(0xAC);
+ SPI_SendByte(0x80);
+ SPI_SendByte(0x04);
+ SPI_SendByte(0x00);
+ delay_ms(DELAY_LONG);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'l') { // write lock bits
+ // send 4 bytes over SPI; 0xac, [andi s_data 0x06], 0xe0, 0x00
+ readByte1 = Buffer_GetElement(&Rx_Buffer); // read in lock bits data
+ SPI_SendByte(0xAC);
+ SPI_SendByte(((0x06 & readByte1) | 0xE0)); // TODO - is this correct???
+ SPI_SendByte(0x00);
+ SPI_SendByte(0x00);
+ delay_ms(DELAY_MEDIUM);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'f') { // write fuse bits
+ // ignore this command, but need to remove data from the receive buffer
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'L') { // leave programming mode
+ RESETPORT |= (1 << RESETPIN); // set RESET pin on target to 1
+ RESETPORT2 |= (1 << RESETPIN2); // set RESET pin on target to 1
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 's') { // Read signature bytes
+ // send 4 bytes over SPI; 0x30, 0x00, 0x02, read and send last byte over serial
+ SPI_SendByte(0x30);
+ SPI_SendByte(0x00);
+ SPI_SendByte(0x02);
+ readByte1 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ SPI_SendByte(0x30);
+ SPI_SendByte(0x00);
+ SPI_SendByte(0x01);
+ readByte1 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ SPI_SendByte(0x30);
+ SPI_SendByte(0x00);
+ SPI_SendByte(0x00);
+ readByte1 = SPI_TransferByte(0x00); // read in data
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+
+ } else if (firstByte == 't') { // Return supported device codes
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE01);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE02);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE03);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE04);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE05);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE06);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE07);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE08);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE09);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE10);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE11);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE12);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE13);
+ Buffer_StoreElement(&Tx_Buffer, AVRDEVCODE14);
+ Buffer_StoreElement(&Tx_Buffer, 0x00);
+
+ } else if (firstByte == 'S') { // Return software identifier
+ // return string[7] with "AVR ISP"
+ Buffer_StoreElement(&Tx_Buffer, 'A');
+ Buffer_StoreElement(&Tx_Buffer, 'V');
+ Buffer_StoreElement(&Tx_Buffer, 'R');
+ Buffer_StoreElement(&Tx_Buffer, 0x20);
+ Buffer_StoreElement(&Tx_Buffer, 'I');
+ Buffer_StoreElement(&Tx_Buffer, 'S');
+ Buffer_StoreElement(&Tx_Buffer, 'P');
+
+ } else if (firstByte == 'V') { // Return sofware version
+ //return two bytes, software Major then Minor
+ Buffer_StoreElement(&Tx_Buffer, '2');
+ Buffer_StoreElement(&Tx_Buffer, '3');
+
+ } else if (firstByte == 'v') { // Return hardware version
+ //return two bytes, hardware Major then Minor
+ Buffer_StoreElement(&Tx_Buffer, ('1'));
+ Buffer_StoreElement(&Tx_Buffer, ('0'));
+
+ } else if (firstByte == 'p') { // Return programmer type
+ // return 'S' for Serial Programmer
+ Buffer_StoreElement(&Tx_Buffer, 'S');
+
+ } else if (firstByte == 'x') { // set LED
+ // ignore this command, but need to remove data from the receive buffer
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'y') { // clear LED
+ // ignore this command, but need to remove data from the receive buffer
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == ':') { // Universal Command
+ // get 3 bytes over serial
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ readByte2 = Buffer_GetElement(&Rx_Buffer);
+ readByte3 = Buffer_GetElement(&Rx_Buffer);
+ SPI_SendByte(readByte1);
+ SPI_SendByte(readByte2);
+ SPI_SendByte(readByte3);
+ readByte1 = SPI_TransferByte(0x00);
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ delay_ms(DELAY_MEDIUM);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == '.') { // New Universal Command
+ // get 4 bytes over serial
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ readByte2 = Buffer_GetElement(&Rx_Buffer);
+ readByte3 = Buffer_GetElement(&Rx_Buffer);
+ readByte4 = Buffer_GetElement(&Rx_Buffer);
+ SPI_SendByte(readByte1);
+ SPI_SendByte(readByte2);
+ SPI_SendByte(readByte3);
+ readByte1 = SPI_TransferByte(readByte4);
+ Buffer_StoreElement(&Tx_Buffer, readByte1);
+ delay_ms(DELAY_MEDIUM);
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+
+ } else if (firstByte == 'Z') { // Special test command
+ // do nothing, but need to remove data from the receive buffer
+ readByte1 = Buffer_GetElement(&Rx_Buffer);
+ readByte2 = Buffer_GetElement(&Rx_Buffer);
+
+ } else {
+ // do nothing, but need to return with a carriage return
+ Buffer_StoreElement(&Tx_Buffer, CR_HEX); // return carriage return (CR_HEX) if successful
+ }
+}
+
+
+void delay_ms(uint8_t dly) {
+ uint16_t endtime = 0;
+
+ endtime = TCNT1;
+ if (endtime > 63486) {
+ endtime = (dly * DELAY_MULTIPLE);
+ } else {
+ endtime += (dly * DELAY_MULTIPLE);
+ }
+
+ timerval = TCNT1;
+ while (timerval < endtime) {
+ timerval = TCNT1;
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.h b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.h
new file mode 100644
index 00000000..e78ba293
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.h
@@ -0,0 +1,194 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for USBtoSerial.c.
+ */
+
+#ifndef _AVRISP_PROGRAMMER_H_
+#define _AVRISP_PROGRAMMER_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+
+ #include "Descriptors.h"
+ #include "RingBuff.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/AT90USBXXX/SPI.h> // SPI driver
+ #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+ /* Macros: */
+ /** CDC Class specific request to get the current virtual serial port configuration settings. */
+ #define REQ_GetLineEncoding 0x21
+
+ /** CDC Class specific request to set the current virtual serial port configuration settings. */
+ #define REQ_SetLineEncoding 0x20
+
+ /** CDC Class specific request to set the current virtual serial port handshake line states. */
+ #define REQ_SetControlLineState 0x22
+
+ /** Notification type constant for a change in the virtual serial port handshake line states, for
+ * use with a USB_Notification_Header_t notification structure when sent to the host via the CDC
+ * notification endpoint.
+ */
+ #define NOTIF_SerialState 0x20
+
+ /** Mask for the DTR handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that the DTR line state should be high.
+ */
+ #define CONTROL_LINE_OUT_DTR (1 << 0)
+
+ /** Mask for the RTS handshake line for use with the REQ_SetControlLineState class specific request
+ * from the host, to indicate that theRTS line state should be high.
+ */
+ #define CONTROL_LINE_OUT_RTS (1 << 1)
+
+ /** Mask for the DCD handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DCD line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DCD (1 << 0)
+
+ /** Mask for the DSR handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the DSR line state is currently high.
+ */
+ #define CONTROL_LINE_IN_DSR (1 << 1)
+
+ /** Mask for the BREAK handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the BREAK line state is currently high.
+ */
+ #define CONTROL_LINE_IN_BREAK (1 << 2)
+
+ /** Mask for the RING handshake line for use with the a NOTIF_SerialState class specific notification
+ * from the device to the host, to indicate that the RING line state is currently high.
+ */
+ #define CONTROL_LINE_IN_RING (1 << 3)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a framing error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_FRAMEERROR (1 << 4)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a parity error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_PARITYERROR (1 << 5)
+
+ /** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
+ * to indicate that a data overrun error has ocurred on the virtual serial port.
+ */
+ #define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Type Defines: */
+ /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration
+ * as set by the host via a class specific request.
+ */
+ typedef struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
+ uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
+ * CDCDevice_CDC_LineCodingFormats_t enum
+ */
+ uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
+ * CDCDevice_LineCodingParity_t enum
+ */
+ uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */
+ } CDC_Line_Coding_t;
+
+ /** Type define for a CDC notification, sent to the host via the CDC notification endpoint to indicate a
+ * change in the device state asynchronously.
+ */
+ typedef struct
+ {
+ uint8_t NotificationType; /**< Notification type, a mask of REQDIR_*, REQTYPE_* and REQREC_* constants
+ * from the library StdRequestType.h header
+ */
+ uint8_t Notification; /**< Notification value, a NOTIF_* constant */
+ uint16_t wValue; /**< Notification wValue, notification-specific */
+ uint16_t wIndex; /**< Notification wIndex, notification-specific */
+ uint16_t wLength; /**< Notification wLength, notification-specific */
+ } USB_Notification_Header_t;
+
+ /* Enums: */
+ /** Enum for the possible line encoding formats of a virtual serial port. */
+ enum CDCDevice_CDC_LineCodingFormats_t
+ {
+ OneStopBit = 0, /**< Each frame contains one stop bit */
+ OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits */
+ TwoStopBits = 2, /**< Each frame contains two stop bits */
+ };
+
+ /** Enum for the possible line encoding parity settings of a virtual serial port. */
+ enum CDCDevice_LineCodingParity_t
+ {
+ Parity_None = 0, /**< No parity bit mode on each frame */
+ Parity_Odd = 1, /**< Odd parity bit mode on each frame */
+ Parity_Even = 2, /**< Even parity bit mode on each frame */
+ Parity_Mark = 3, /**< Mark parity bit mode on each frame */
+ Parity_Space = 4, /**< Space parity bit mode on each frame */
+ };
+
+ /** Enum for the possible status codes for passing to the UpdateStatus() function. */
+ enum USBtoSerial_StatusCodes_t
+ {
+ Status_USBNotReady = 0, /**< USB is not ready (disconnected from a USB host) */
+ Status_USBEnumerating = 1, /**< USB interface is enumerating */
+ Status_USBReady = 2, /**< USB interface is connected and ready */
+ };
+
+ /* Tasks: */
+ TASK(CDC_Task);
+
+ /* Function Prototypes: */
+ void ReconfigureSPI(void);
+ void UpdateStatus(uint8_t CurrentStatus);
+ void processHostSPIRequest(void);
+ void delay_ms(uint8_t dly);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.txt b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.txt
new file mode 100644
index 00000000..1872cfb5
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer.txt
@@ -0,0 +1,89 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage AVRISP_Programmer
+ *
+ * Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a USB to Serial converter using the CDC class. Data communicated
+ * over the USB Virtual Serial Port according to Atmel's AVR910
+ * protocol is used to program AVR MCUs that are
+ * "In-System Programmable via SPI Port".
+ *
+ * After running this firmware for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * Usage:
+ * avrdude -vv -F -P COM7 -c avr910 -p t261
+ * Note -F flag which overrides signature check and enables programming
+ * of any "In-System Programmable via SPI Port" AVR MCU. Part number,
+ * t261, should be set to your target device.
+ * avrdude -vv -F -P COM7 -c avr910 -p t261 -U flash:w:PROG.hex
+ * PROG.hex is the hex file to program your t261 AVR with
+ * avrdude -vv -F -P COM7 -b 115200 -c avr910 -p t261 -U flash:w:test.hex
+ * The -b 115200 sets the SPI clock to 62.5kHz from the default 125kHz and may
+ * work when the default programming speed fails.
+ * AVROSP.exe -dATtiny261 -cCOM7 -rf
+ * AVRosp is the Open Source AVR ISP Programming Software available from Atmel.com
+ *
+ * Note: on Linux systems, COM7 should be replaced with someting like /dev/ttyACM0
+ * You can determine this value by running dmesg after plugging in the device
+ * Note: you must RESET the programmer after each use (AVRdude session).
+ *
+ * Note: If you experience errors with older devices, try changing DELAY_LONG
+ * to a larger value, such as 0xFF in AVRISP_Programmer.c
+ *
+ * MISO, MOSI, and SCK are connected directly from the AVRopendous board
+ * to the pin of the same functionality on the target. RESET pin on the target
+ * can be connected either to SS (PB0), or PC2. Do not have any other pins
+ * connected - especially HWB pin, to avoid unintentional behaviour.
+ *
+ * AVR910 functionality was overlayed on USBtoSerial functionality.
+ * Keep this in mind when looking over the code.
+ * Default target speed is 125kHz and corresponds to 19200 baud, which
+ * is the default setting for AVRdude.
+ *
+ * Changing "Baud-Rate" will change the SPI speed. Defualt SPI clock speed
+ * is 8Mhz / 4 = 2MHz. 8Mhz is the device clock speed. This is the setting at
+ * 9600 baud. The following is a table of baud-rate vs. SPI Speed that will result
+ * 9600 = 2Mhz
+ * 14400 = 1MHz
+ * 19200 = 125kHz (AVRdude Default)
+ * 38400 = 250kHz
+ * 57600 = 500kHz
+ * 115200 = 62.5kHz
+ *
+ *
+ *
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Communications Device Class (CDC)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Abstract Control Model (ACM)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer_Picture.jpg b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer_Picture.jpg
new file mode 100644
index 00000000..87ec3d43
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/AVRISP_Programmer_Picture.jpg
Binary files differ
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.c b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.c
new file mode 100644
index 00000000..b948498f
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.c
@@ -0,0 +1,263 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x02,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2044,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 2,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ CCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 1,
+
+ Class: 0x02,
+ SubClass: 0x02,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ CDC_Functional_IntHeader:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x00,
+
+ Data: {0x01, 0x10}
+ },
+
+ CDC_Functional_CallManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x01,
+
+ Data: {0x03, 0x01}
+ },
+
+ CDC_Functional_AbstractControlManagement:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
+ SubType: 0x02,
+
+ Data: {0x06}
+ },
+
+ CDC_Functional_Union:
+ {
+ Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
+ SubType: 0x06,
+
+ Data: {0x00, 0x01}
+ },
+
+ ManagementEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: CDC_NOTIFICATION_EPSIZE,
+ PollingIntervalMS: 0xFF
+ },
+
+ DCI_Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 1,
+ AlternateSetting: 0,
+
+ TotalEndpoints: 2,
+
+ Class: 0x0A,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ DataOutEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ },
+
+ DataInEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
+ Attributes: EP_TYPE_BULK,
+ EndpointSize: CDC_TXRX_EPSIZE,
+ PollingIntervalMS: 0x00
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
+
+ UnicodeString: L"www.AVRopendous.org"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(29), Type: DTYPE_String},
+
+ UnicodeString: L"LUFA-Based AVR ISP Programmer"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.h b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.h
new file mode 100644
index 00000000..bec5e40d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Descriptors.h
@@ -0,0 +1,98 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
+ * uniform structure but variable sized data payloads, thus cannot be represented accurately by
+ * a single typedef struct. A macro is used instead so that functional descriptors can be created
+ * easily by specifying the size of the payload. This allows sizeof() to work correctly.
+ *
+ * \param DataSize Size in bytes of the CDC functional descriptor's data payload
+ */
+ #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
+ struct \
+ { \
+ USB_Descriptor_Header_t Header; \
+ uint8_t SubType; \
+ uint8_t Data[DataSize]; \
+ }
+
+ /** Endpoint number of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPNUM 2
+
+ /** Endpoint number of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPNUM 3
+
+ /** Endpoint number of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPNUM 4
+
+ /** Size in bytes of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPSIZE 8
+
+ /** Size in bytes of the CDC data IN and OUT endpoints. */
+ #define CDC_TXRX_EPSIZE 16
+
+ /* Type Defines: */
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t CCI_Interface;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_CallManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
+ CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t ManagementEndpoint;
+ USB_Descriptor_Interface_t DCI_Interface;
+ USB_Descriptor_Endpoint_t DataOutEndpoint;
+ USB_Descriptor_Endpoint_t DataInEndpoint;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Doxygen.conf b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Doxygen.conf
new file mode 100644
index 00000000..1eb8c543
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "LUFA Library - USB to Serial Device Demo"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/LUFA AVRISP_Programmer.inf b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/LUFA AVRISP_Programmer.inf
new file mode 100644
index 00000000..bd9c8bf1
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/LUFA AVRISP_Programmer.inf
@@ -0,0 +1,55 @@
+; Windows LUFA USB to Serial Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%COMPANY%
+LayoutFile=layout.inf
+DriverVer=06/06/2006,1.0.0.0
+
+[Manufacturer]
+%MFGNAME% = ManufName
+
+[DestinationDirs]
+DefaultDestDir=12
+
+[ManufName]
+%Modem3% = Modem3, USB\VID_03EB&PID_204B
+
+;------------------------------------------------------------------------------
+; Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[Modem3.nt]
+CopyFiles=USBModemCopyFileSection
+AddReg=Modem3.nt.AddReg
+
+[USBModemCopyFileSection]
+usbser.sys,,,0x20
+
+[Modem3.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[Modem3.nt.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+;------------------------------------------------------------------------------
+; String Definitions
+;------------------------------------------------------------------------------
+
+[Strings]
+COMPANY="LUFA Library"
+MFGNAME="Dean Camera"
+Modem3="USB Virtual Serial Port"
+SERVICE="USB Virtual Serial Port CDC Driver" \ No newline at end of file
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.c b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.c
new file mode 100644
index 00000000..1f477f17
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.c
@@ -0,0 +1,120 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+#include "RingBuff.h"
+
+void Buffer_Initialize(RingBuff_t* Buffer)
+{
+ BUFF_ATOMIC_BLOCK
+ {
+ Buffer->InPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ Buffer->Elements = 0;
+ }
+}
+
+void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data)
+{
+ BUFF_ATOMIC_BLOCK
+ {
+ #if defined(BUFF_DROPOLD)
+ if (Buffer->Elements == BUFF_LENGTH)
+ {
+ Buffer->OutPtr++;
+
+ if (Buffer->OutPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+ else
+ {
+ Buffer->Elements++;
+ }
+ #elif defined(BUFF_DROPNEW)
+ if (Buffer->Elements == BUFF_LENGTH)
+ return;
+
+ Buffer->Elements++;
+ #elif defined(BUFF_NODROPCHECK)
+ Buffer->Elements++;
+ #endif
+
+ *(Buffer->InPtr) = Data;
+ Buffer->InPtr++;
+
+ if (Buffer->InPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->InPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+}
+
+RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer)
+{
+ RingBuff_Data_t BuffData;
+
+ BUFF_ATOMIC_BLOCK
+ {
+#if defined(BUFF_EMPTYRETURNSZERO)
+ if (!(Buffer->Elements))
+ return 0;
+#elif !defined(BUFF_NOEMPTYCHECK)
+ #error No empty buffer check behaviour specified.
+#endif
+
+ BuffData = *(Buffer->OutPtr);
+
+ Buffer->OutPtr++;
+ Buffer->Elements--;
+
+ if (Buffer->OutPtr == &Buffer->Buffer[BUFF_LENGTH])
+ Buffer->OutPtr = (RingBuff_Data_t*)&Buffer->Buffer;
+ }
+
+ return BuffData;
+}
+
+#if defined(BUFF_USEPEEK)
+RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer)
+{
+ RingBuff_Data_t BuffData;
+
+ BUFF_ATOMIC_BLOCK
+ {
+#if defined(BUFF_EMPTYRETURNSZERO)
+ if (!(Buffer->Elements))
+ return 0;
+#elif !defined(BUFF_NOEMPTYCHECK)
+ #error No empty buffer check behaviour specified.
+#endif
+
+ BuffData = *(Buffer->OutPtr);
+ }
+
+ return BuffData;
+}
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.h b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.h
new file mode 100644
index 00000000..68e4a6e7
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/RingBuff.h
@@ -0,0 +1,116 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/* Buffer Configuration: */
+ /* Buffer length - select static size of created ringbuffers: */
+ #define BUFF_STATICSIZE 128 // Set to the static ringbuffer size for all ringbuffers (place size after define)
+
+ /* Volatile mode - uncomment to make buffers volatile, for use in ISRs, etc: */
+ #define BUFF_VOLATILE // Uncomment to cause all ring buffers to become volatile (and atomic if multi-byte) in access
+
+ /* Drop mode - select behaviour when Buffer_StoreElement called on a full buffer: */
+ #define BUFF_DROPOLD // Uncomment to cause full ring buffers to drop the oldest character to make space when full
+ // #define BUFF_DROPNEW // Uncomment to cause full ring buffers to drop the new character when full
+ // #define BUFF_NODROPCHECK // Uncomment to ignore full ring buffer checks - checking left to user!
+
+ /* Underflow behaviour - select behaviour when Buffer_GetElement is called with an empty ringbuffer: */
+ //#define BUFF_EMPTYRETURNSZERO // Uncomment to return 0 when an empty ringbuffer is read
+ #define BUFF_NOEMPTYCHECK // Uncomment to disable checking of empty ringbuffers - checking left to user!
+
+ /* Buffer storage type - set the datatype for the stored data */
+ #define BUFF_DATATYPE uint8_t // Change to the data type that is going to be stored into the buffer
+
+ /* Peek routine - uncomment to include the peek routine (fetches next byte without removing it from the buffer */
+ #define BUFF_USEPEEK
+
+#ifndef _RINGBUFF_H_
+#define _RINGBUFF_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/interrupt.h>
+ #include <util/atomic.h>
+ #include <limits.h>
+
+ #include <LUFA/Common/Common.h>
+
+ /* Defines and checks: */
+ #if defined(BUFF_STATICSIZE)
+ #define BUFF_LENGTH BUFF_STATICSIZE
+ #else
+ #error No buffer length specified!
+ #endif
+
+ #if !(defined(BUFF_DROPOLD) || defined(BUFF_DROPNEW) || defined(BUFF_NODROPCHECK))
+ #error No buffer drop mode specified.
+ #endif
+
+ #if !defined(BUFF_DATATYPE)
+ #error Ringbuffer storage data type not specified.
+ #endif
+
+ #if defined(BUFF_VOLATILE)
+ #define BUFF_MODE volatile
+ #define BUFF_ATOMIC_BLOCK ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ #else
+ #define BUFF_MODE
+ #define BUFF_ATOMIC_BLOCK
+ #endif
+
+ #if (BUFF_STATICSIZE > LONG_MAX)
+ #define RingBuff_Elements_t uint64_t
+ #elif (BUFF_STATICSIZE > INT_MAX)
+ #define RingBuff_Elements_t uint32_t
+ #elif (BUFF_STATICSIZE > CHAR_MAX)
+ #define RingBuff_Elements_t uint16_t
+ #else
+ #define RingBuff_Elements_t uint8_t
+ #endif
+
+ /* Type Defines: */
+ typedef BUFF_DATATYPE RingBuff_Data_t;
+
+ typedef BUFF_MODE struct
+ {
+ RingBuff_Data_t Buffer[BUFF_LENGTH];
+ RingBuff_Data_t* InPtr;
+ RingBuff_Data_t* OutPtr;
+ RingBuff_Elements_t Elements;
+ } RingBuff_t;
+
+ /* Function Prototypes: */
+ void Buffer_Initialize(RingBuff_t* Buff);
+ void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data);
+ RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer);
+ #if defined(BUFF_USEPEEK)
+ RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer);
+ #endif
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Sample_Programming_Session.txt b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Sample_Programming_Session.txt
new file mode 100644
index 00000000..b5af76eb
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/Sample_Programming_Session.txt
@@ -0,0 +1,104 @@
+ubuntu@ubuntu:~/LUFA/Bootloaders/LUFA_DFU_Bootloader_AT90USB162$ sudo avrdude -vv -F -P /dev/ttyACM0 -c avr910 -p usb162 -U flash:w:BootloaderDFU.hex
+
+avrdude: Version 5.5, compiled on May 9 2008 at 13:04:46
+ Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
+
+ System wide configuration file is "/etc/avrdude.conf"
+ User configuration file is "/home/ubuntu/.avrduderc"
+ User configuration file does not exist or is not a regular file, skipping
+
+ Using Port : /dev/ttyACM0
+ Using Programmer : avr910
+ AVR Part : AT90USB162
+ Chip Erase delay : 9000 us
+ PAGEL : PD7
+ BS2 : PA0
+ RESET disposition : dedicated
+ RETRY pulse : SCK
+ serial program mode : yes
+ parallel program mode : yes
+ Timeout : 200
+ StabDelay : 100
+ CmdexeDelay : 25
+ SyncLoops : 32
+ ByteDelay : 0
+ PollIndex : 3
+ PollValue : 0x53
+ Memory Detail :
+
+ Block Poll Page Polled
+ Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
+ ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
+ eeprom 65 10 8 0 no 512 4 0 9000 9000 0x00 0x00
+ flash 65 6 128 0 yes 16384 128 128 4500 4500 0x00 0x00
+ lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
+ hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
+ efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
+ lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
+ calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
+ signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
+
+ Programmer Type : avr910
+ Description : Atmel Low Cost Serial Programmer
+
+Found programmer: Id = "AVR ISP"; type = S
+ Software Version = 2.3; Hardware Version = 1.0
+Programmer supports auto addr increment.
+
+Programmer supports the following devices:
+ Device code: 0x55 = ATtiny12
+ Device code: 0x56 = ATtiny15
+ Device code: 0x5e = ATtiny2313
+ Device code: 0x76 = ATMEGA8
+ Device code: 0x74 = ATMEGA6450
+ Device code: 0x72 = ATMEGA32
+ Device code: 0x45 = ATMEGA64
+ Device code: 0x74 = ATMEGA6450
+ Device code: 0x43 = ATMEGA128
+ Device code: 0x63 = ATMEGA162
+ Device code: 0x78 = ATMEGA169
+ Device code: 0x6c = AT90S4434
+ Device code: 0x38 = AT90S8515
+ Device code: 0x65 = (unknown)
+
+avrdude: warning: selected device is not supported by programmer: usb162
+avrdude: AVR device initialized and ready to accept instructions
+
+Reading | ################################################## | 100% 0.00s
+
+avrdude: Device signature = 0x1e9482
+avrdude: safemode: lfuse reads as 5E
+avrdude: safemode: hfuse reads as D9
+avrdude: safemode: efuse reads as F4
+avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
+ To disable this feature, specify the -D option.
+avrdude: erasing chip
+avrdude: reading input file "BootloaderDFU.hex"
+avrdude: input file BootloaderDFU.hex auto detected as Intel Hex
+avrdude: writing flash (16066 bytes):
+
+Writing | ################################################## | 100% 33.39s
+
+
+
+avrdude: 16066 bytes of flash written
+avrdude: verifying flash memory against BootloaderDFU.hex:
+avrdude: load data flash data from input file BootloaderDFU.hex:
+avrdude: input file BootloaderDFU.hex auto detected as Intel Hex
+avrdude: input file BootloaderDFU.hex contains 16066 bytes
+avrdude: reading on-chip flash data:
+
+Reading | ################################################## | 100% 16.07s
+
+
+
+avrdude: verifying ...
+avrdude: 16066 bytes of flash verified
+
+avrdude: safemode: lfuse reads as 5E
+avrdude: safemode: hfuse reads as D9
+avrdude: safemode: efuse reads as F4
+avrdude: safemode: Fuses OK
+
+avrdude done. Thank you.
+
diff --git a/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/makefile b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/makefile
new file mode 100644
index 00000000..0665aaab
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/AVRISP_Programmer/makefile
@@ -0,0 +1,702 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (USBKEY, STK525, STK526, RZUSBSTICK, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 8000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = AVRISP_Programmer
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ RingBuff.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/AT90USBXXX/Serial.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -ffunction-sections
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.c b/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.c
new file mode 100644
index 00000000..5d23762e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.c
@@ -0,0 +1,113 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** Circular bit buffer library. This will allow for individual bits
+ * to be stored in packed form inside circular buffers, to reduce
+ * overall RAM usage.
+ */
+
+#include "CircularBitBuffer.h"
+
+/** Function to initialize or reset a bit buffer, ready for data to be stored into it. */
+void BitBuffer_Init(BitBuffer_t* Buffer)
+{
+ /* Reset the number of stored bits in the buffer */
+ Buffer->Elements = 0;
+
+ /* Reset the data in and out pointer structures in the buffer to the first buffer bit */
+ Buffer->In.CurrentByte = Buffer->Data;
+ Buffer->In.ByteMask = (1 << 0);
+ Buffer->Out.CurrentByte = Buffer->Data;
+ Buffer->Out.ByteMask = (1 << 0);
+}
+
+/** Function to store the given bit into the given bit buffer. */
+void BitBuffer_StoreNextBit(BitBuffer_t* Buffer, bool Bit)
+{
+ /* If the bit to store is true, set the next bit in the buffer */
+ if (Bit)
+ *Buffer->In.CurrentByte |= Buffer->In.ByteMask;
+
+ /* Increment the number of stored bits in the buffer counter */
+ Buffer->Elements++;
+
+ /* Check if the current buffer byte is full of stored bits */
+ if (Buffer->In.ByteMask == (1 << 7))
+ {
+ /* Check if the end of the buffer has been reached, if so reset to start of buffer, otherwise advance to next bit */
+ if (Buffer->In.CurrentByte != &Buffer->Data[sizeof(Buffer->Data) - 1])
+ Buffer->In.CurrentByte++;
+ else
+ Buffer->In.CurrentByte = Buffer->Data;
+
+ /* Reset the storage bit mask in the current buffer byte to the first bit */
+ Buffer->In.ByteMask = (1 << 0);
+ }
+ else
+ {
+ /* Shift the current storage bit mask to the next bit in the current byte */
+ Buffer->In.ByteMask <<= 1;
+ }
+}
+
+/** Function to retrieve the next bit stored in the given bit buffer. */
+bool BitBuffer_GetNextBit(BitBuffer_t* Buffer)
+{
+ /* Retrieve the value of the next bit stored in the buffer */
+ bool Bit = ((*Buffer->Out.CurrentByte & Buffer->Out.ByteMask) != 0);
+
+ /* Clear the buffer bit */
+ *Buffer->Out.CurrentByte &= ~Buffer->Out.ByteMask;
+
+ /* Decrement the number of stored bits in the buffer counter */
+ Buffer->Elements--;
+
+ /* Check if the current buffer byte is empty of stored bits */
+ if (Buffer->Out.ByteMask == (1 << 7))
+ {
+ /* Check if the end of the buffer has been reached, if so reset to start of buffer, otherwise advance to next bit */
+ if (Buffer->Out.CurrentByte != &Buffer->Data[sizeof(Buffer->Data) - 1])
+ Buffer->Out.CurrentByte++;
+ else
+ Buffer->Out.CurrentByte = Buffer->Data;
+
+ /* Reset the retrieval bit mask in the current buffer byte to the first bit */
+ Buffer->Out.ByteMask = (1 << 0);
+ }
+ else
+ {
+ /* Shift the current retrieval bit mask to the next bit in the current byte */
+ Buffer->Out.ByteMask <<= 1;
+ }
+
+ /* Return the retrieved bit from the buffer */
+ return Bit;
+}
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.h b/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.h
new file mode 100644
index 00000000..0fb80b9d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/CircularBitBuffer.h
@@ -0,0 +1,90 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for CircularBitBuffer.c.
+ */
+
+#ifndef _CIRCULARBITBUFFER_H_
+#define _CIRCULARBITBUFFER_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <stdbool.h>
+
+ #include <LUFA/Common/Common.h>
+
+ /* Macros: */
+ /** Maximum number of bits which can be stored into a bit buffer. The memory usage is one eigth of this value per buffer. */
+ #define MAX_BITS 1024
+
+ /* Type Defines: */
+ /* Type define for a pointer to a bit in a bit buffer. */
+ typedef struct
+ {
+ uint8_t* CurrentByte; /**< Pointer to the current byte in the buffer */
+ uint8_t ByteMask; /**< Mask of the current bit in the buffer */
+ } BitBufferPointer_t;
+
+ /** Type define for a circular packet bit buffer. */
+ typedef struct
+ {
+ uint8_t Data[MAX_BITS / 8]; /**< Buffer to hold the stored bits in packed form */
+ uint16_t Elements; /**< Number of stored bits in the bit buffer */
+
+ BitBufferPointer_t In; /**< Bit pointer to the next storage location in the buffer */
+ BitBufferPointer_t Out; /**< Bit pointer to the next retrieval location in the buffer */
+ } BitBuffer_t;
+
+ /* Function Prototypes: */
+ /** Initializes or resets a given bit buffer, ready to store new bits.
+ *
+ * \param Buffer Bit buffer to initialize
+ */
+ void BitBuffer_Init(BitBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Stores a bit into the next location inside a given bit buffer.
+ *
+ * \param Buffer Bit buffer to store a bit into
+ * \param Bit Bit to store into the buffer
+ */
+ void BitBuffer_StoreNextBit(BitBuffer_t* Buffer, bool Bit) ATTR_NON_NULL_PTR_ARG(1);
+
+ /** Retrieves a bit from the next location inside a given bit buffer.
+ *
+ * \param Buffer Bit buffer to store a bit into
+ *
+ * \return Next bit from the buffer
+ */
+ bool BitBuffer_GetNextBit(BitBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.c b/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.c
new file mode 100644
index 00000000..0a25857b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.c
@@ -0,0 +1,247 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "Descriptors.h"
+
+/** HID report descriptor. This is a HID class specific descriptor, which defines the structure of the
+ * reports sent and received by the HID device to and from the USB host. It indicates what data is sent,
+ * where in the report each element is located and exactly how the data should be interpreted and used.
+ *
+ * See the HID class specification for more information on HID report descriptors.
+ */
+USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
+{
+ 0x05, 0x01, /* Usage Page (Generic Desktop) */
+ 0x09, 0x06, /* Usage (Keyboard) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x75, 0x01, /* Report Size (1) */
+ 0x95, 0x08, /* Report Count (8) */
+ 0x05, 0x07, /* Usage Page (Key Codes) */
+ 0x19, 0xe0, /* Usage Minimum (Keyboard LeftControl) */
+ 0x29, 0xe7, /* Usage Maximum (Keyboard Right GUI) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x01, /* Logical Maximum (1) */
+ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
+ 0x95, 0x01, /* Report Count (1) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x81, 0x03, /* Input (Const, Variable, Absolute) */
+ 0x95, 0x06, /* Report Count (6) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x25, 0x65, /* Logical Maximum (101) */
+ 0x05, 0x07, /* Usage Page (Keyboard) */
+ 0x19, 0x00, /* Usage Minimum (Reserved (no event indicated)) */
+ 0x29, 0x65, /* Usage Maximum (Keyboard Application) */
+ 0x81, 0x00, /* Input (Data, Array, Absolute) */
+ 0xc0 /* End Collection */
+};
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
+
+ USBSpecification: VERSION_BCD(01.10),
+ Class: 0x00,
+ SubClass: 0x00,
+ Protocol: 0x00,
+
+ Endpoint0Size: 8,
+
+ VendorID: 0x03EB,
+ ProductID: 0x2042,
+ ReleaseNumber: 0x0000,
+
+ ManufacturerStrIndex: 0x01,
+ ProductStrIndex: 0x02,
+ SerialNumStrIndex: NO_DESCRIPTOR,
+
+ NumberOfConfigurations: 1
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ Config:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
+
+ TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
+ TotalInterfaces: 1,
+
+ ConfigurationNumber: 1,
+ ConfigurationStrIndex: NO_DESCRIPTOR,
+
+ ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
+ },
+
+ Interface:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
+
+ InterfaceNumber: 0x00,
+ AlternateSetting: 0x00,
+
+ TotalEndpoints: 1,
+
+ Class: 0x03,
+ SubClass: 0x01,
+ Protocol: 0x01,
+
+ InterfaceStrIndex: NO_DESCRIPTOR
+ },
+
+ KeyboardHID:
+ {
+ Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
+
+ HIDSpec: VERSION_BCD(01.11),
+ CountryCode: 0x00,
+ TotalHIDReports: 0x01,
+ HIDReportType: DTYPE_Report,
+ HIDReportLength: sizeof(KeyboardReport)
+ },
+
+ KeyboardEndpoint:
+ {
+ Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
+
+ EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
+ Attributes: EP_TYPE_INTERRUPT,
+ EndpointSize: KEYBOARD_EPSIZE,
+ PollingIntervalMS: 0x02
+ },
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors. */
+USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
+
+ UnicodeString: {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+ Header: {Size: USB_STRING_LEN(32), Type: DTYPE_String},
+
+ UnicodeString: L"Dean Camera and Denver Gingerich"
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+USB_Descriptor_String_t PROGMEM ProductString =
+{
+ Header: {Size: USB_STRING_LEN(20), Type: DTYPE_String},
+
+ UnicodeString: L"Magnetic Card Reader"
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = DESCRIPTOR_ADDRESS(LanguageString);
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = DESCRIPTOR_ADDRESS(ManufacturerString);
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = DESCRIPTOR_ADDRESS(ProductString);
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ case DTYPE_HID:
+ Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
+ Size = sizeof(USB_Descriptor_HID_t);
+ break;
+ case DTYPE_Report:
+ Address = DESCRIPTOR_ADDRESS(KeyboardReport);
+ Size = sizeof(KeyboardReport);
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.h b/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.h
new file mode 100644
index 00000000..77be5402
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Descriptors.h
@@ -0,0 +1,99 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Type Defines: */
+ /** Type define for the HID class specific HID descriptor. A HID descriptor is used in HID class devices
+ * to give information about the HID device, including the HID specification used, and the report descriptors
+ * the device contains to describe how the HID device should be controlled.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Header_t Header; /**< Standard USB descriptor header */
+
+ uint16_t HIDSpec; /**< HID specification implemented by the device, in BCD form */
+ uint8_t CountryCode; /**< Country code for the country the HID device is localised for */
+
+ uint8_t TotalHIDReports; /**< Total number of HID reports linked to this HID interface */
+
+ uint8_t HIDReportType; /**< Type of the first HID report descriptor */
+ uint16_t HIDReportLength; /**< Length of the first HID report descriptor */
+ } USB_Descriptor_HID_t;
+
+ /** Type define for the data type used for the HID Report descriptor data elements. A HID report
+ * descriptor contains an array of this data type, indicating how the reports from and to the
+ * device are formatted and how the report data is to be used by the host.
+ */
+ typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
+
+ /** Type define for the device configuration descriptor structure. This must be defined in the
+ * application code, as the configuration descriptor contains several sub-descriptors which
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */
+ USB_Descriptor_Interface_t Interface; /**< Keyboard interface descriptor */
+ USB_Descriptor_HID_t KeyboardHID; /**< Keyboard HID descriptor */
+ USB_Descriptor_Endpoint_t KeyboardEndpoint; /**< Keyboard key report endpoint descriptor */
+ USB_Descriptor_Endpoint_t KeyboardLEDsEndpoint; /**< Keyboard LED report endpoint descriptor */
+ } USB_Descriptor_Configuration_t;
+
+ /* Macros: */
+ /** Endpoint number of the keyboard key press reporting endpoint. */
+ #define KEYBOARD_EPNUM 1
+
+ /** Size of the keyboard report endpoints, in bytes. */
+ #define KEYBOARD_EPSIZE 8
+
+ /** Descriptor type value for a HID descriptor. */
+ #define DTYPE_HID 0x21
+
+ /** Descriptor type value for a HID report. */
+ #define DTYPE_Report 0x22
+
+ /* Function Prototypes: */
+ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Doxygen.conf b/digital/avr/modules/usb/lufa/Projects/Magstripe/Doxygen.conf
new file mode 100644
index 00000000..4d0abf9b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Doxygen.conf
@@ -0,0 +1,1485 @@
+# Doxyfile 1.5.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "Denver Gingerich's Stripe Snoop Project"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.0.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./Documentation/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.h \
+ *.c \
+ *.txt
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */LowLevel/USBMode.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = __*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file .
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 1
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = __DOXYGEN__
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED = BUTTLOADTAG
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = NO
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = NO
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = "C:/Program Files/Graphviz2.18/bin"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 15
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 2
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.aps b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.aps
new file mode 100644
index 00000000..86d011ab
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.aps
@@ -0,0 +1 @@
+<AVRStudio><MANAGEMENT><ProjectName>Magstripe</ProjectName><Created>30-Sep-2008 14:19:14</Created><LastEdit>30-Sep-2008 14:19:28</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Sep-2008 14:19:14</Created><Version>4</Version><Build>4, 14, 0, 589</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile></ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Users\Dean\Documents\Electronics\Projects\WORK\MyUSBWORK\Projects\Magstripe\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>Descriptors.c</SOURCEFILE><SOURCEFILE>Magstripe.c</SOURCEFILE><HEADERFILE>Descriptors.h</HEADERFILE><HEADERFILE>Magstripe.h</HEADERFILE><HEADERFILE>MagstripeHW.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>Magstripe.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20080512\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20080512\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.c b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.c
new file mode 100644
index 00000000..3696c124
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.c
@@ -0,0 +1,436 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Main source file for the MagStripe application. This file contains the code which drives
+ * the USB keyboard interface from the magnetic card stripe reader device.
+ */
+
+#include "Magstripe.h"
+
+/* Project Tags, for reading out using the ButtLoad project */
+BUTTLOADTAG(ProjName, "Magstripe Reader");
+BUTTLOADTAG(BuildTime, __TIME__);
+BUTTLOADTAG(BuildDate, __DATE__);
+BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
+
+/* Scheduler Task List */
+TASK_LIST
+{
+ { Task: USB_USBTask , TaskStatus: TASK_STOP },
+ { Task: USB_Keyboard_Report , TaskStatus: TASK_STOP },
+ { Task: Magstripe_Read , TaskStatus: TASK_STOP },
+};
+
+/* Global Variables */
+/** Indicates if the device is using Report Protocol mode, instead of Boot Protocol mode. Boot Protocol mode
+ * is a special reporting mode used by compatible PC BIOS to support USB keyboards before a full OS and USB
+ * driver has been loaded, by using predefined report structures indicated in the USB HID standard.
+ */
+bool UsingReportProtocol = true;
+
+/** Total idle period in milliseconds set by the host via a SetIdle request, used to silence the report endpoint
+ * until the report data changes or the idle period elapsed. Generally used to implement hardware key repeats, or
+ * by some BIOS to reduce the number of reports when in Boot Protocol mode.
+ */
+uint8_t IdleCount = 0;
+
+/** Milliseconds remaining counter for the HID class SetIdle and GetIdle requests, used to silence the report
+ * endpoint for an amount of time indicated by the host or until the report changes.
+ */
+uint16_t IdleMSRemaining = 0;
+
+/** Circular buffer to hold the read bits from track 1 of the inserted magnetic card. */
+BitBuffer_t Track1Data;
+
+/** Circular buffer to hold the read bits from track 2 of the inserted magnetic card. */
+BitBuffer_t Track2Data;
+
+/** Circular buffer to hold the read bits from track 3 of the inserted magnetic card. */
+BitBuffer_t Track3Data;
+
+/** Delay counter between sucessive key strokes. This is to prevent the OS from ignoring multiple keys in a short
+ * period of time due to key repeats. Two milliseconds works for most OSes.
+ */
+uint8_t KeyDelayRemaining;
+
+
+/** Main program entry point. This routine configures the hardware required by the application, then
+ * starts the scheduler to run the application tasks.
+ */
+int main(void)
+{
+ /* Disable watchdog if enabled by bootloader/fuses */
+ MCUSR &= ~(1 << WDRF);
+ wdt_disable();
+
+ /* Disable Clock Division */
+ SetSystemClockPrescaler(0);
+
+ /* Hardware Initialization */
+ Magstripe_Init();
+
+ /* Buffer Initialization */
+ BitBuffer_Init(&Track1Data);
+ BitBuffer_Init(&Track2Data);
+ BitBuffer_Init(&Track3Data);
+
+ /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
+ OCR0A = 0xFA;
+ TCCR0A = (1 << WGM01);
+ TCCR0B = ((1 << CS01) | (1 << CS00));
+ TIMSK0 = (1 << OCIE0A);
+
+ /* Initialize Scheduler so that it can be used */
+ Scheduler_Init();
+
+ /* Initialize USB Subsystem */
+ USB_Init();
+
+ /* Scheduling - routine never returns, so put this last in the main function */
+ Scheduler_Start();
+}
+
+/** Event handler for the USB_Connect event. This starts the USB task. */
+EVENT_HANDLER(USB_Connect)
+{
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+}
+
+/** Event handler for the USB_Disconnect event. This stops the USB and keyboard report tasks. */
+EVENT_HANDLER(USB_Disconnect)
+{
+ /* Stop running keyboard reporting, card reading and USB management tasks */
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ Scheduler_SetTaskMode(Magstripe_Read, TASK_STOP);
+}
+
+/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
+ * to relay reports to the host, and starts the keyboard report task.
+ */
+EVENT_HANDLER(USB_ConfigurationChanged)
+{
+ /* Setup Keyboard Keycode Report Endpoint */
+ Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ /* Default to report protocol on connect */
+ UsingReportProtocol = true;
+
+ /* Start Keyboard reporting and card reading tasks */
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_RUN);
+ Scheduler_SetTaskMode(Magstripe_Read, TASK_RUN);
+}
+
+/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+ * control requests that are not handled internally by the USB library, so that they can be handled appropriately
+ * for the application.
+ */
+EVENT_HANDLER(USB_UnhandledControlPacket)
+{
+ /* Handle HID Class specific requests */
+ switch (bRequest)
+ {
+ case REQ_GetReport:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ USB_KeyboardReport_Data_t KeyboardReportData;
+
+ /* Create the next keyboard report for transmission to the host */
+ GetNextReport(&KeyboardReportData);
+
+ /* Ignore report type and ID number value */
+ Endpoint_Discard_Word();
+
+ /* Ignore unused Interface number value */
+ Endpoint_Discard_Word();
+
+ /* Read in the number of bytes in the report to send to the host */
+ uint16_t wLength = Endpoint_Read_Word_LE();
+
+ /* If trying to send more bytes than exist to the host, clamp the value at the report size */
+ if (wLength > sizeof(KeyboardReportData))
+ wLength = sizeof(KeyboardReportData);
+
+ Endpoint_ClearSetupReceived();
+
+ /* Write the report data to the control endpoint */
+ Endpoint_Write_Control_Stream_LE(&KeyboardReportData, wLength);
+
+ /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_ClearSetupOUT();
+ }
+
+ break;
+ case REQ_GetProtocol:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current protocol flag to the host */
+ Endpoint_Write_Byte(UsingReportProtocol);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetProtocol:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the new protocol mode */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Set or clear the flag depending on what the host indicates that the current Protocol should be */
+ UsingReportProtocol = (wValue != 0x0000);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_SetIdle:
+ if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ /* Read in the wValue parameter containing the idle period */
+ uint16_t wValue = Endpoint_Read_Word_LE();
+
+ Endpoint_ClearSetupReceived();
+
+ /* Get idle period in MSB */
+ IdleCount = (wValue >> 8);
+
+ /* Send an empty packet to acknowedge the command */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ case REQ_GetIdle:
+ if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ {
+ Endpoint_ClearSetupReceived();
+
+ /* Write the current idle duration to the host */
+ Endpoint_Write_Byte(IdleCount);
+
+ /* Send the flag to the host */
+ Endpoint_ClearSetupIN();
+ }
+
+ break;
+ }
+}
+
+/** ISR for the timer 0 compare vector. This ISR fires once each millisecond, and decrements the counter indicating
+ * the number of milliseconds left to idle (not send the host reports) if the device has been instructed to idle
+ * by the host via a SetIdle class specific request.
+ */
+ISR(TIMER0_COMPA_vect, ISR_BLOCK)
+{
+ /* One millisecond has elapsed, decrement the idle time remaining counter if it has not already elapsed */
+ if (IdleMSRemaining)
+ IdleMSRemaining--;
+
+ if (KeyDelayRemaining)
+ KeyDelayRemaining--;
+}
+
+/** Constructs a keyboard report indicating the currently pressed keyboard keys to the host.
+ *
+ * \param ReportData Pointer to a USB_KeyboardReport_Data_t report structure where the resulting report should
+ * be stored
+ *
+ * \return Boolean true if the current report is different to the previous report, false otherwise
+ */
+bool GetNextReport(USB_KeyboardReport_Data_t* ReportData)
+{
+ static bool OddReport = false;
+ static bool MustRelease = false;
+
+ BitBuffer_t* Buffer = NULL;
+
+ /* Clear the report contents */
+ memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t));
+
+ /* Get the next non-empty track data buffer */
+ if (Track1Data.Elements)
+ Buffer = &Track1Data;
+ else if (Track2Data.Elements)
+ Buffer = &Track2Data;
+ else if (Track3Data.Elements)
+ Buffer = &Track3Data;
+
+ if (Buffer != NULL)
+ {
+ /* Toggle the odd report number indicator */
+ OddReport = !OddReport;
+
+ /* Set the flag indicating that a null report must eventually be sent to release all pressed keys */
+ MustRelease = true;
+
+ /* Only send the next key on odd reports, so that they are interpersed with null reports to release keys */
+ if (OddReport)
+ {
+ /* Set the report key code to the key code for the next data bit */
+ ReportData->KeyCode[0] = BitBuffer_GetNextBit(Buffer) ? KEY_1 : KEY_0;
+
+ /* If buffer is now empty, a new line must be sent instead of the terminating bit */
+ if (!(Buffer->Elements))
+ {
+ /* Set the keycode to the code for an enter key press */
+ ReportData->KeyCode[0] = KEY_ENTER;
+ }
+ }
+
+ return true;
+ }
+ else if (MustRelease)
+ {
+ /* Leave key code to null (0), to release all pressed keys */
+ return true;
+ }
+
+ return false;
+}
+
+/** Task to read out data from inserted magnetic cards and place the seperate track data into their respective
+ * data buffers for later sending to the host as keyboard key presses.
+ */
+TASK(Magstripe_Read)
+{
+ /* Arrays to hold the buffer pointers, clock and data bit masks for the seperate card tracks */
+ const struct
+ {
+ BitBuffer_t* Buffer;
+ uint8_t ClockMask;
+ uint8_t DataMask;
+ } TrackInfo[] = {{&Track1Data, MAG_T1_CLOCK, MAG_T1_DATA},
+ {&Track2Data, MAG_T2_CLOCK, MAG_T2_DATA},
+ {&Track3Data, MAG_T3_CLOCK, MAG_T3_DATA}};
+
+ /* Previous magnetic card control line' status, for later comparison */
+ uint8_t Magstripe_Prev = 0;
+
+ /* Buffered current card reader control line' status */
+ uint8_t Magstripe_LCL = Magstripe_GetStatus();
+
+ /* Exit the task early if no card is present in the reader */
+ if (!(Magstripe_LCL & MAG_CARDPRESENT))
+ return;
+
+ /* Read out card data while a card is present */
+ while (Magstripe_LCL & MAG_CARDPRESENT)
+ {
+ /* Read out the next bit for each track of the card */
+ for (uint8_t Track = 0; Track < 3; Track++)
+ {
+ /* Current data line status for the current card track */
+ bool DataLevel = ((Magstripe_LCL & TrackInfo[Track].DataMask) != 0);
+
+ /* Current clock line status for the current card track */
+ bool ClockLevel = ((Magstripe_LCL & TrackInfo[Track].ClockMask) != 0);
+
+ /* Current track clock transition check */
+ bool ClockChanged = (((Magstripe_LCL ^ Magstripe_Prev) & TrackInfo[Track].ClockMask) != 0);
+
+ /* Sample the next bit on the falling edge of the track's clock line, store key code into the track's buffer */
+ if (ClockLevel && ClockChanged)
+ BitBuffer_StoreNextBit(TrackInfo[Track].Buffer, DataLevel);
+ }
+
+ /* Retain the current card reader control line states for later edge detection */
+ Magstripe_Prev = Magstripe_LCL;
+
+ /* Retrieve the new card reader control line states */
+ Magstripe_LCL = Magstripe_GetStatus();
+ }
+
+ /* Add terminators to the end of each track buffer */
+ BitBuffer_StoreNextBit(&Track1Data, 0);
+ BitBuffer_StoreNextBit(&Track2Data, 0);
+ BitBuffer_StoreNextBit(&Track3Data, 0);
+}
+
+/** Task for the magnetic card reading and keyboard report generation. This task waits until a card is inserted,
+ * then reads off the card data and sends it to the host as a series of keyboard keypresses via keyboard reports.
+ */
+TASK(USB_Keyboard_Report)
+{
+ USB_KeyboardReport_Data_t KeyboardReportData;
+ bool SendReport = false;
+
+ /* Check if the USB system is connected to a host */
+ if (USB_IsConnected)
+ {
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
+
+ /* Check if Keyboard Endpoint Ready for Read/Write */
+ if (Endpoint_ReadWriteAllowed())
+ {
+ /* Only fetch the next key to send once the period between key presses has elapsed */
+ if (!(KeyDelayRemaining))
+ {
+ /* Create the next keyboard report for transmission to the host */
+ SendReport = GetNextReport(&KeyboardReportData);
+ }
+
+ /* Check if the idle period is set and has elapsed */
+ if (IdleCount && !(IdleMSRemaining))
+ {
+ /* Idle period elapsed, indicate that a report must be sent */
+ SendReport = true;
+
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+
+ /* Write the keyboard report if a report is to be sent to the host */
+ if (SendReport)
+ {
+ /* Write Keyboard Report Data */
+ Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(USB_KeyboardReport_Data_t));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+
+ /* Reset the key delay period counter */
+ KeyDelayRemaining = 2;
+ }
+ }
+ }
+}
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.h b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.h
new file mode 100644
index 00000000..cde2fcdc
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.h
@@ -0,0 +1,121 @@
+/*
+ LUFA Library
+ Copyright (C) Dean Camera, 2009.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+*/
+
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/** \file
+ *
+ * Header file for Magstripe.c.
+ */
+
+#ifndef _MAGSTRIPE_H_
+#define _MAGSTRIPE_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+ #include <avr/wdt.h>
+ #include <avr/interrupt.h>
+ #include <stdbool.h>
+ #include <string.h>
+
+ #include "Descriptors.h"
+ #include "MagstripeHW.h"
+ #include "CircularBitBuffer.h"
+
+ #include <LUFA/Version.h> // Library Version Information
+ #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
+
+
+ /* Task Definitions: */
+ /** Task definition for the keyboard and magnetic card reading task. */
+ TASK(USB_Keyboard_Report);
+
+ TASK(Magstripe_Read);
+
+ /* Macros: */
+ /** HID Class Specific Request to get the current HID report from the device. */
+ #define REQ_GetReport 0x01
+
+ /** HID Class Specific Request to get the current device idle count. */
+ #define REQ_GetIdle 0x02
+
+ /** HID Class Specific Request to set the current HID report to the device. */
+ #define REQ_SetReport 0x09
+
+ /** HID Class Specific Request to set the device's idle count. */
+ #define REQ_SetIdle 0x0A
+
+ /** HID Class Specific Request to get the current HID report protocol mode. */
+ #define REQ_GetProtocol 0x03
+
+ /** HID Class Specific Request to set the current HID report protocol mode. */
+ #define REQ_SetProtocol 0x0B
+
+ /** HID keyboard keycode to indicate that the "1" key is currently pressed. */
+ #define KEY_1 30
+
+ /** HID keyboard keycode to indicate that the "0" key is currently pressed. */
+ #define KEY_0 39
+
+ /** HID keyboard keycode to indicate that the enter key is currently pressed. */
+ #define KEY_ENTER 40
+
+ /* Type Defines: */
+ /** Type define for the keyboard report structure. This structure matches the report layout
+ * given to the host in the HID Report descriptor, as well as matches the boot protocol report
+ * structure. This means that this one report structure can be used in both Report and Boot Protocol
+ * modes. */
+ typedef struct
+ {
+ uint8_t Modifier; /**< Modifier byte, indicating pressed modifier keys such as CTRL or ALT */
+ uint8_t Reserved; /**< Reserved for OEM use, always set to 0 */
+ uint8_t KeyCode[6]; /**< Key code array for pressed keys - up to six can be given simultaneously */
+ } USB_KeyboardReport_Data_t;
+
+ /* Event Handlers: */
+ /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
+ HANDLES_EVENT(USB_Connect);
+
+ /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
+ HANDLES_EVENT(USB_Disconnect);
+
+ /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
+ HANDLES_EVENT(USB_ConfigurationChanged);
+
+ /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
+ HANDLES_EVENT(USB_UnhandledControlPacket);
+
+ /* Function Prototypes: */
+ bool GetNextReport(USB_KeyboardReport_Data_t* ReportData);
+ void SendKey(USB_KeyboardReport_Data_t* KeyboardReportData, uint8_t Key);
+ void Send(USB_KeyboardReport_Data_t* KeyboardReportData, bool SendReport);
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.txt b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.txt
new file mode 100644
index 00000000..d91fddde
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/Magstripe.txt
@@ -0,0 +1,85 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Denver Gingerich's USBSnoop Magnetic Card Reader Project
+ *
+ * Firmware for a USB AVR powered USB TTL magnetic stripe reader (using a card
+ * reader such as the Omron V3B-4K) by Denver Gingerich. This project is designed
+ * to be used with the open source Stripe Snoop project at http://stripesnoop.sourceforge.net/.
+ *
+ * See http://ossguy.com/ss_usb/ for the USB reader hardware project website,
+ * including construction and support details.
+ *
+ * To use, connect your magentic card reader device to the USB AVR as follows (pin and port mapping may be adjusted
+ * from the project makefile):
+ *
+ * <table>
+ * <tr>
+ * <td><b>Signal:</b></td>
+ * <td><b>AVR Port:</b></td>
+ * </tr>
+ * <tr>
+ * <td>Track 1 Data</td>
+ * <td>PORTC, Pin 1</td>
+ * </tr>
+ * <tr>
+ * <td>Track 1 Clock</td>
+ * <td>PORTC, Pin 2</td>
+ * </tr>
+ * <tr>
+ * <td>Track 2 Data</td>
+ * <td>PORTC, Pin 3</td>
+ * </tr>
+ * <tr>
+ * <td>Track 2 Clock</td>
+ * <td>PORTC, Pin 0</td>
+ * </tr>
+ * <tr>
+ * <td>Track 3 Data</td>
+ * <td>PORTC, Pin 5</td>
+ * </tr>
+ * <tr>
+ * <td>Track 3 Clock</td>
+ * <td>PORTC, Pin 6</td>
+ * </tr>
+ * <tr>
+ * <td>Card Detect</td>
+ * <td>PORTC, Pin 4</td>
+ * </tr>
+ * </table>
+ *
+ *
+ * This project is based on the LUFA Keyboard demonstration application,
+ * written by Denver Gingerich.
+ *
+ * This application uses a keyboard HID driver to communicate the data collected
+ * a TTL magnetic stripe reader to the connected computer. The raw bitstream
+ * obtained from the magnetic stripe reader is "typed" through the keyboard
+ * driver as 0's and 1's. After every card swipe, the demo will send a return key.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Keyboard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Standard, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ */
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/MagstripeHW.h b/digital/avr/modules/usb/lufa/Projects/Magstripe/MagstripeHW.h
new file mode 100644
index 00000000..c4681188
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/MagstripeHW.h
@@ -0,0 +1,100 @@
+/*
+ Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
+ Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ The author disclaim all warranties with regard to this
+ software, including all implied warranties of merchantability
+ and fitness. In no event shall the author be liable for any
+ special, indirect or consequential damages or any damages
+ whatsoever resulting from loss of use, data or profits, whether
+ in an action of contract, negligence or other tortious action,
+ arising out of or in connection with the use or performance of
+ this software.
+*/
+
+/*
+ NOTE: The user of this include file MUST define the following macros
+ prior to including the file:
+
+ MAG_T1_CLOCK_PIN Pin connected to Track 1 clock wire (ie. PORTC1)
+ MAG_T1_DATA_PIN Pin connected to Track 1 data wire (ie. PORTC2)
+ MAG_T2_CLOCK_PIN Pin connected to Track 2 clock wire (ie. PORTC3)
+ MAG_T2_DATA_PIN Pin connected to Track 2 data wire (ie. PORTC0)
+ MAG_T3_CLOCK_PIN Pin connected to Track 3 clock wire (ie. PORTC5)
+ MAG_T3_DATA_PIN Pin connected to Track 3 data wire (ie. PORTC6)
+ MAG_CLS_PIN Pin connected to card loaded wire (ie. PORTC4)
+ MAG_PIN PIN macro for the reader's port (ie. PINC)
+ MAG_DDR DDR macro for the reader's port (ie. DDRC)
+ MAG_PORT PORT macro for the reader's port (ie. PORTC)
+
+ The example macros listed above assume that the Track 2 data wire is
+ connected to pin 0 on port C, the Track 2 clock wire is connected to
+ pin 3 on port C (similarly for Tracks 1 and 3), and the card loaded
+ wire is connected to pin 4 on port C.
+
+ If the magstripe reader you are using only reads one or two tracks,
+ then set the clock and data pins for the tracks it doesn't read to a
+ pin that is unused. For example, on the AT90USBKey, any of the pins on
+ port C that do not have wires attached will be unused since they are
+ not connected to any onboard devices (such as the joystick or
+ temperature sensor).
+
+ Connecting wires to pins on different ports (ie. a data wire to pin 0
+ on port C and a clock wire to pin 0 on port D) is currently
+ unsupported. All pins specified above must be on the same port.
+*/
+
+/** \file
+ *
+ * Driver header for a TTL Magnetic Card reader device (such as the Omron V3B-4K).
+ */
+
+#ifndef _MAGSTRIPEHW_H_
+#define _MAGSTRIPEHW_H_
+
+ /* Includes: */
+ #include <avr/io.h>
+
+ #include <LUFA/Common/Common.h>
+
+ /* Private Interface - For use in library only: */
+ /* Macros: */
+ /** Mask of the track data, clock and card detection pins. */
+ #define MAG_MASK (MAG_T1_DATA | MAG_T1_CLOCK | \
+ MAG_T2_DATA | MAG_T2_CLOCK | \
+ MAG_T3_DATA | MAG_T3_CLOCK | \
+ MAG_CARDPRESENT)
+
+ /* Public Interface - May be used in end-application: */
+ /* Inline Functions: */
+ /** Initializes the magnetic stripe card reader ports and pins so that the card reader
+ * device can be controlled and read by the card reader driver. This must be called before
+ * trying to read any of the card reader's status lines.
+ */
+ static inline void Magstripe_Init(void)
+ {
+ MAG_DDR &= ~MAG_MASK;
+ MAG_PORT |= MAG_MASK;
+ };
+
+ /** Returns the status of all the magnetic card reader's outputs.
+ *
+ * \return A mask indicating which card lines are high or low
+ */
+ static inline uint8_t Magstripe_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Magstripe_GetStatus(void)
+ {
+ /* Magstripe IOs are active low and must be inverted when read */
+ return ((uint8_t)~MAG_PIN & MAG_MASK);
+ }
+
+#endif
diff --git a/digital/avr/modules/usb/lufa/Projects/Magstripe/makefile b/digital/avr/modules/usb/lufa/Projects/Magstripe/makefile
new file mode 100644
index 00000000..d90f961d
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/Magstripe/makefile
@@ -0,0 +1,710 @@
+# Hey Emacs, this is a -*- makefile -*-
+#----------------------------------------------------------------------------
+# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
+# >> Modified for use with the LUFA project. <<
+#
+# Released to the Public Domain
+#
+# Additional material for this makefile was written by:
+# Peter Fleury
+# Tim Henigan
+# Colin O'Flynn
+# Reiner Patommel
+# Markus Pfaff
+# Sander Pool
+# Frederik Rouleau
+# Carlos Lamas
+# Dean Camera
+# Opendous Inc.
+#
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device, using avrdude.
+# Please customize the avrdude settings below first!
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+# have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+# have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+# (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+# (must have Atmel FLIP installed).
+#
+# make doxygen = Generate DoxyGen documentation for the project (must have
+# DoxyGen installed)
+#
+# make debug = Start either simulavr or avarice as specified for debugging,
+# with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+# bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+
+# MCU name
+MCU = at90usb1287
+
+
+# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# "Board" inside the application directory.
+BOARD = USBKEY
+
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+# Typical values are:
+# F_CPU = 1000000
+# F_CPU = 1843200
+# F_CPU = 2000000
+# F_CPU = 3686400
+# F_CPU = 4000000
+# F_CPU = 7372800
+# F_CPU = 8000000
+# F_CPU = 11059200
+# F_CPU = 14745600
+# F_CPU = 16000000
+# F_CPU = 18432000
+# F_CPU = 20000000
+F_CPU = 16000000
+
+
+# Output format. (can be srec, ihex, binary)
+FORMAT = ihex
+
+
+# Target file name (without extension).
+TARGET = Magstripe
+
+
+# Object files directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+OBJDIR = .
+
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c \
+ Descriptors.c \
+ CircularBitBuffer.c \
+ ../../LUFA/Scheduler/Scheduler.c \
+ ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \
+ ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \
+ ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBTask.c \
+ ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \
+ ../../LUFA/Drivers/USB/HighLevel/Events.c \
+ ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \
+
+# List C++ source files here. (C dependencies are automatically generated.)
+CPPSRC =
+
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+
+# Optimization level, can be [0, 1, 2, 3, s].
+# 0 = turn off optimization. s = optimize for size.
+# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
+OPT = s
+
+
+# Debugging format.
+# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
+# AVR Studio 4.10 requires dwarf-2.
+# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
+DEBUG = dwarf-2
+
+
+# List any extra directories to look for include files here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRAINCDIRS = ../../
+
+
+# Compiler flag to set the C Standard level.
+# c89 = "ANSI" C
+# gnu89 = c89 plus GCC extensions
+# c99 = ISO C99 standard (not yet fully implemented)
+# gnu99 = c99 plus GCC extensions
+CSTANDARD = -std=gnu99
+
+
+# Place -D or -U options here for C sources
+CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+
+CDEFS += -DMAG_T1_CLOCK="(1 << 0)"
+CDEFS += -DMAG_T1_DATA="(1 << 1)"
+CDEFS += -DMAG_T2_CLOCK="(1 << 2)"
+CDEFS += -DMAG_T2_DATA="(1 << 3)"
+CDEFS += -DMAG_T3_CLOCK="(1 << 4)"
+CDEFS += -DMAG_T3_DATA="(1 << 5)"
+CDEFS += -DMAG_CARDPRESENT="(1 << 6)"
+CDEFS += -DMAG_PIN=PINB
+CDEFS += -DMAG_DDR=DDRB
+CDEFS += -DMAG_PORT=PORTB
+
+# Place -D or -U options here for ASM sources
+ADEFS = -DF_CPU=$(F_CPU)
+
+
+# Place -D or -U options here for C++ sources
+CPPDEFS = -DF_CPU=$(F_CPU)UL
+#CPPDEFS += -D__STDC_LIMIT_MACROS
+#CPPDEFS += -D__STDC_CONSTANT_MACROS
+
+
+
+#---------------- Compiler Options C ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CFLAGS = -g$(DEBUG)
+CFLAGS += $(CDEFS)
+CFLAGS += -O$(OPT)
+CFLAGS += -funsigned-char
+CFLAGS += -funsigned-bitfields
+CFLAGS += -fpack-struct
+CFLAGS += -fshort-enums
+CFLAGS += -ffunction-sections
+CFLAGS += -finline-limit=20
+CFLAGS += -Wall
+CFLAGS += -Wstrict-prototypes
+CFLAGS += -Wundef
+#CFLAGS += -fno-unit-at-a-time
+#CFLAGS += -Wunreachable-code
+#CFLAGS += -Wsign-compare
+CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
+CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+CFLAGS += $(CSTANDARD)
+
+
+#---------------- Compiler Options C++ ----------------
+# -g*: generate debugging information
+# -O*: optimization level
+# -f...: tuning, see GCC manual and avr-libc documentation
+# -Wall...: warning level
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns...: create assembler listing
+CPPFLAGS = -g$(DEBUG)
+CPPFLAGS += $(CPPDEFS)
+CPPFLAGS += -O$(OPT)
+CPPFLAGS += -funsigned-char
+CPPFLAGS += -funsigned-bitfields
+CPPFLAGS += -fpack-struct
+CPPFLAGS += -fshort-enums
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -Wall
+CFLAGS += -Wundef
+#CPPFLAGS += -fno-unit-at-a-time
+#CPPFLAGS += -Wstrict-prototypes
+#CPPFLAGS += -Wunreachable-code
+#CPPFLAGS += -Wsign-compare
+CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
+CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+#CPPFLAGS += $(CSTANDARD)
+
+
+#---------------- Assembler Options ----------------
+# -Wa,...: tell GCC to pass this to the assembler.
+# -adhlns: create listing
+# -gstabs: have the assembler create line number information; note that
+# for use in COFF files, additional information about filenames
+# and function names needs to be present in the assembler source
+# files -- see avr-libc docs [FIXME: not yet described there]
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# dump that will be displayed for a given single line of source input.
+ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
+
+
+#---------------- Library Options ----------------
+# Minimalistic printf version
+PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
+
+# Floating point printf version (requires MATH_LIB = -lm below)
+PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
+
+# If this is left blank, then it will use the Standard printf version.
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
+#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
+
+
+# Minimalistic scanf version
+SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
+
+# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
+SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
+
+# If this is left blank, then it will use the Standard scanf version.
+SCANF_LIB =
+#SCANF_LIB = $(SCANF_LIB_MIN)
+#SCANF_LIB = $(SCANF_LIB_FLOAT)
+
+
+MATH_LIB = -lm
+
+
+# List any extra directories to look for libraries here.
+# Each directory must be seperated by a space.
+# Use forward slashes for directory separators.
+# For a directory that has spaces, enclose it in quotes.
+EXTRALIBDIRS =
+
+
+
+#---------------- External Memory Options ----------------
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# used for variables (.data/.bss) and heap (malloc()).
+#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
+
+# 64 KB of external RAM, starting after internal RAM (ATmega128!),
+# only used for heap (malloc()).
+#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
+
+EXTMEMOPTS =
+
+
+
+#---------------- Linker Options ----------------
+# -Wl,...: tell GCC to pass this to linker.
+# -Map: create map file
+# --cref: add cross reference to map file
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
+LDFLAGS += $(EXTMEMOPTS)
+LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
+LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
+#LDFLAGS += -T linker_script.x
+
+
+
+#---------------- Programming Options (avrdude) ----------------
+
+# Programming hardware: alf avr910 avrisp bascom bsd
+# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
+#
+# Type: avrdude -c ?
+# to get a full listing.
+#
+AVRDUDE_PROGRAMMER = jtagmkII
+
+# com1 = serial port. Use lpt1 to connect to parallel port.
+AVRDUDE_PORT = usb
+
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+
+
+#---------------- Debugging Options ----------------
+
+# For simulavr only - target MCU frequency.
+DEBUG_MFREQ = $(F_CPU)
+
+# Set the DEBUG_UI to either gdb or insight.
+# DEBUG_UI = gdb
+DEBUG_UI = insight
+
+# Set the debugging back-end to either avarice, simulavr.
+DEBUG_BACKEND = avarice
+#DEBUG_BACKEND = simulavr
+
+# GDB Init Filename.
+GDBINIT_FILE = __avr_gdbinit
+
+# When using avarice settings for the JTAG
+JTAG_DEV = /dev/com1
+
+# Debugging port used to communicate between GDB / avarice / simulavr.
+DEBUG_PORT = 4242
+
+# Debugging host used to communicate between GDB / avarice / simulavr, normally
+# just set to localhost unless doing some sort of crazy debugging when
+# avarice is running on a different computer.
+DEBUG_HOST = localhost
+
+
+
+#============================================================================
+
+
+# Define programs and commands.
+SHELL = sh
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+AR = avr-ar rcs
+NM = avr-nm
+AVRDUDE = avrdude
+REMOVE = rm -f
+REMOVEDIR = rm -rf
+COPY = cp
+WINSHELL = cmd
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_BEGIN = -------- begin --------
+MSG_END = -------- end --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling C:
+MSG_COMPILING_CPP = Compiling C++:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+
+
+
+
+# Define all object files.
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+
+# Define all listing files.
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+
+
+# Compiler flags to generate dependency files.
+GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
+
+
+# Combine all necessary flags and optional flags.
+# Add target processor to flags.
+ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
+ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
+
+
+
+
+
+# Default target.
+all: begin gccversion sizebefore build checkhooks checklibmode sizeafter end
+
+# Change the build target to build a HEX file or a library.
+build: elf hex eep lss sym
+#build: lib
+
+
+elf: $(TARGET).elf
+hex: $(TARGET).hex
+eep: $(TARGET).eep
+lss: $(TARGET).lss
+sym: $(TARGET).sym
+LIBNAME=lib$(TARGET).a
+lib: $(LIBNAME)
+
+
+
+# Eye candy.
+# AVR Studio 3.x does not check make's exit code but relies on
+# the following magic strings to be generated by the compile job.
+begin:
+ @echo
+ @echo $(MSG_BEGIN)
+
+end:
+ @echo $(MSG_END)
+ @echo
+
+
+# Display size of file.
+HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
+ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+
+sizebefore:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+sizeafter:
+ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
+ 2>/dev/null; echo; fi
+
+checkhooks: build
+ @echo
+ @echo ------- Unhooked LUFA Events -------
+ @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
+ echo "(None)"
+ @echo ----- End Unhooked LUFA Events -----
+
+checklibmode:
+ @echo
+ @echo ----------- Library Mode -----------
+ @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \
+ | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \
+ || echo "No specific mode (both device and host mode allowable)."
+ @echo ------------------------------------
+
+# Display compiler version information.
+gccversion :
+ @$(CC) --version
+
+
+
+# Program the device.
+program: $(TARGET).hex $(TARGET).eep
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ mv $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase F memory FLASH erase F
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM
+ loadbuffer $(TARGET)eep.hex memory FLASH loadbuffer $(TARGET).hex
+ program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) eeprom --debug 1 $(TARGET).eep
+
+# Generate avr-gdb config/init file which does the following:
+# define the reset signal, load the target file, connect to target, and set
+# a breakpoint at main().
+gdb-config:
+ @$(REMOVE) $(GDBINIT_FILE)
+ @echo define reset >> $(GDBINIT_FILE)
+ @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
+ @echo end >> $(GDBINIT_FILE)
+ @echo file $(TARGET).elf >> $(GDBINIT_FILE)
+ @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
+ifeq ($(DEBUG_BACKEND),simulavr)
+ @echo load >> $(GDBINIT_FILE)
+endif
+ @echo break main >> $(GDBINIT_FILE)
+
+debug: gdb-config $(TARGET).elf
+ifeq ($(DEBUG_BACKEND), avarice)
+ @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
+ @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
+ $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
+ @$(WINSHELL) /c pause
+
+else
+ @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
+ $(DEBUG_MFREQ) --port $(DEBUG_PORT)
+endif
+ @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
+
+
+
+
+# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
+COFFCONVERT = $(OBJCOPY) --debugging
+COFFCONVERT += --change-section-address .data-0x800000
+COFFCONVERT += --change-section-address .bss-0x800000
+COFFCONVERT += --change-section-address .noinit-0x800000
+COFFCONVERT += --change-section-address .eeprom-0x810000
+
+
+
+coff: $(TARGET).elf
+ @echo
+ @echo $(MSG_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
+
+
+extcoff: $(TARGET).elf
+ @echo
+ @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
+ $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
+
+
+
+# Create final output files (.hex, .eep) from ELF output file.
+%.hex: %.elf
+ @echo
+ @echo $(MSG_FLASH) $@
+ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
+
+%.eep: %.elf
+ @echo
+ @echo $(MSG_EEPROM) $@
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+ --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
+
+# Create extended listing file from ELF output file.
+%.lss: %.elf
+ @echo
+ @echo $(MSG_EXTENDED_LISTING) $@
+ $(OBJDUMP) -h -z -S $< > $@
+
+# Create a symbol table from ELF output file.
+%.sym: %.elf
+ @echo
+ @echo $(MSG_SYMBOL_TABLE) $@
+ $(NM) -n $< > $@
+
+
+
+# Create library from object files.
+.SECONDARY : $(TARGET).a
+.PRECIOUS : $(OBJ)
+%.a: $(OBJ)
+ @echo
+ @echo $(MSG_CREATING_LIBRARY) $@
+ $(AR) $@ $(OBJ)
+
+
+# Link: create ELF output file from object files.
+.SECONDARY : $(TARGET).elf
+.PRECIOUS : $(OBJ)
+%.elf: $(OBJ)
+ @echo
+ @echo $(MSG_LINKING) $@
+ $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
+
+
+# Compile: create object files from C source files.
+$(OBJDIR)/%.o : %.c
+ @echo
+ @echo $(MSG_COMPILING) $<
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create object files from C++ source files.
+$(OBJDIR)/%.o : %.cpp
+ @echo
+ @echo $(MSG_COMPILING_CPP) $<
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C source files.
+%.s : %.c
+ $(CC) -S $(ALL_CFLAGS) $< -o $@
+
+
+# Compile: create assembler files from C++ source files.
+%.s : %.cpp
+ $(CC) -S $(ALL_CPPFLAGS) $< -o $@
+
+
+# Assemble: create object files from assembler source files.
+$(OBJDIR)/%.o : %.S
+ @echo
+ @echo $(MSG_ASSEMBLING) $<
+ $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+
+# Create preprocessed source for use in sending a bug report.
+%.i : %.c
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+
+
+# Target: clean project.
+clean: begin clean_list clean_binary end
+
+clean_binary:
+ $(REMOVE) $(TARGET).hex
+
+clean_list:
+ @echo $(MSG_CLEANING)
+ $(REMOVE) $(TARGET).eep
+ $(REMOVE) $(TARGET).cof
+ $(REMOVE) $(TARGET).elf
+ $(REMOVE) $(TARGET).map
+ $(REMOVE) $(TARGET).sym
+ $(REMOVE) $(TARGET).lss
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
+ $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
+ $(REMOVE) $(SRC:.c=.s)
+ $(REMOVE) $(SRC:.c=.d)
+ $(REMOVE) $(SRC:.c=.i)
+ $(REMOVEDIR) .dep
+
+
+doxygen:
+ @echo Generating Project Documentation...
+ @doxygen Doxygen.conf
+ @echo Documentation Generation Complete.
+
+clean_doxygen:
+ rm -rf Documentation
+
+# Create object files directory
+$(shell mkdir $(OBJDIR) 2>/dev/null)
+
+
+# Include the dependency files.
+-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+
+
+# Listing of phony targets.
+.PHONY : all checkhooks checklibmode begin \
+finish end sizebefore sizeafter gccversion \
+build elf hex eep lss sym coff extcoff \
+clean clean_list clean_binary program debug \
+gdb-config doxygen dfu flip
diff --git a/digital/avr/modules/usb/lufa/Projects/makefile b/digital/avr/modules/usb/lufa/Projects/makefile
new file mode 100644
index 00000000..50851a3e
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/Projects/makefile
@@ -0,0 +1,25 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2009.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Makefile to build all the LUFA Projects. Call with "make all" to
+# rebuild all projects.
+
+# Projects are pre-cleaned before each one is built, to ensure any
+# custom LUFA library build options are reflected in the compiled
+# code.
+
+all:
+ make -C Magstripe clean
+ make -C Magstripe all
+
+ make -C AVRISP_Programmer clean
+ make -C AVRISP_Programmer all
+
+%:
+ make -C Magstripe $@
+ make -C AVRISP_Programmer $@
diff --git a/digital/avr/modules/usb/lufa/makefile b/digital/avr/modules/usb/lufa/makefile
new file mode 100644
index 00000000..6fca4a6b
--- /dev/null
+++ b/digital/avr/modules/usb/lufa/makefile
@@ -0,0 +1,27 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2009.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Makefile to build the LUFA library and Demos.
+
+# Call with "make all" to rebuild everything, "make clean" to clean everything,
+# "make clean_list" to remove all intermediatary files but preserve any binaries
+# and "make doxygen" to document the project with DoxyGen (if installed).
+
+# It is suggested that for the master build, the --quiet switch is passed to make,
+# to remove all the commands from the output. This gives a much easier to read
+# report of the entire build process.
+
+%:
+ @echo Executing \"make $@\" on all LUFA library elements.
+ @echo
+ make -C LUFA/ $@
+ make -C Demos/ $@
+ make -C Projects/ $@
+ make -C Bootloaders/ $@
+ @echo
+ @echo LUFA \"make $@\" operation complete.