├── 3DPmain.c ├── 3DPro.c ├── 3DPro.h ├── 3DProasm.S ├── Descriptors.c ├── Descriptors.h ├── Doxygen.conf ├── FeedbackTester ├── Feedback.csproj ├── Feedback.sln ├── Feedback.suo ├── UpgradeLog.XML ├── bin │ ├── Debug │ │ ├── Feedback.exe │ │ ├── Feedback.pdb │ │ ├── Feedback.vshost.exe │ │ └── Feedback.vshost.exe.manifest │ └── Release │ │ ├── Feedback.exe │ │ ├── Feedback.vshost.exe │ │ └── Feedback.vshost.exe.manifest ├── csfeedback.jpg ├── frmMain.cs ├── frmMain.resx └── obj │ ├── Debug │ ├── Feedback.csproj.FileListAbsolute.txt │ ├── Feedback.csproj.GenerateResource.Cache │ ├── Feedback.exe │ ├── Feedback.frmMain.resources │ ├── Feedback.pdb │ └── ResolveAssemblyReference.cache │ └── Release │ ├── Feedback.csproj.FileListAbsolute.txt │ ├── Feedback.csproj.GenerateResource.Cache │ ├── Feedback.exe │ └── Feedback.frmMain.resources ├── Joystick.aps ├── Joystick.c ├── Joystick.h ├── LUFA DualVirtualSerial-wheel.inf ├── LUFA DualVirtualSerial.inf ├── LUFA-120219 ├── LUFA.pnproj ├── LUFA │ ├── CodeTemplates │ │ ├── DriverStubs │ │ │ ├── Buttons.h │ │ │ ├── Dataflash.h │ │ │ ├── Joystick.h │ │ │ └── LEDs.h │ │ ├── LUFAConfig.h │ │ ├── makefile_template.avr8 │ │ ├── makefile_template.uc3 │ │ └── makefile_template.xmega │ ├── Common │ │ ├── ArchitectureSpecific.h │ │ ├── Architectures.h │ │ ├── Attributes.h │ │ ├── BoardTypes.h │ │ ├── Common.h │ │ ├── CompilerSpecific.h │ │ └── Endianness.h │ ├── Doxygen.conf │ ├── DoxygenPages │ │ ├── AboutLUFA.txt │ │ ├── AlternativeStacks.txt │ │ ├── Author.jpg │ │ ├── BuildingLinkableLibraries.txt │ │ ├── ChangeLog.txt │ │ ├── CompileTimeTokens.txt │ │ ├── CompilingApps.txt │ │ ├── ConfiguringApps.txt │ │ ├── DevelopingWithLUFA.txt │ │ ├── DeviceSupport.txt │ │ ├── DirectorySummaries.txt │ │ ├── Donating.txt │ │ ├── FutureChanges.txt │ │ ├── GettingStarted.txt │ │ ├── Groups.txt │ │ ├── LUFA.png │ │ ├── LUFAPoweredProjects.txt │ │ ├── LUFA_thumb.png │ │ ├── LUFAvsAtmelStack.txt │ │ ├── LibraryApps.txt │ │ ├── LibraryResources.txt │ │ ├── LicenseInfo.txt │ │ ├── MainPage.txt │ │ ├── MigrationInformation.txt │ │ ├── ProgrammingApps.txt │ │ ├── SoftwareBootloaderJump.txt │ │ ├── VIDAndPIDValues.txt │ │ ├── WhyUseLUFA.txt │ │ ├── WritingBoardDrivers.txt │ │ └── footer.htm │ ├── Drivers │ │ ├── Board │ │ │ ├── AVR8 │ │ │ │ ├── ADAFRUITU4 │ │ │ │ │ └── LEDs.h │ │ │ │ ├── ATAVRUSBRF01 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── BENITO │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── BLACKCAT │ │ │ │ │ └── LEDs.h │ │ │ │ ├── BUI │ │ │ │ │ └── LEDs.h │ │ │ │ ├── BUMBLEB │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── CULV3 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── EVK527 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── JMDBU2 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── MAXIMUS │ │ │ │ │ └── LEDs.h │ │ │ │ ├── MICROPENDOUS │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── MICROSIN162 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── MINIMUS │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── OLIMEX162 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── RZUSBSTICK │ │ │ │ │ └── LEDs.h │ │ │ │ ├── SPARKFUN8U2 │ │ │ │ │ └── LEDs.h │ │ │ │ ├── STK525 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── STK526 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── TEENSY │ │ │ │ │ └── LEDs.h │ │ │ │ ├── TUL │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── UDIP │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── UNO │ │ │ │ │ └── LEDs.h │ │ │ │ ├── USB2AX │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── USBFOO │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── USBKEY │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── USBTINYMKII │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ │ └── XPLAIN │ │ │ │ │ ├── Dataflash.h │ │ │ │ │ └── LEDs.h │ │ │ ├── Buttons.h │ │ │ ├── Dataflash.h │ │ │ ├── Joystick.h │ │ │ ├── LEDs.h │ │ │ ├── Temperature.c │ │ │ ├── Temperature.h │ │ │ ├── UC3 │ │ │ │ ├── EVK1100 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ ├── EVK1101 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ ├── Joystick.h │ │ │ │ │ └── LEDs.h │ │ │ │ └── EVK1104 │ │ │ │ │ ├── Buttons.h │ │ │ │ │ └── LEDs.h │ │ │ └── XMEGA │ │ │ │ ├── A3BU_XPLAINED │ │ │ │ ├── Buttons.h │ │ │ │ ├── Dataflash.h │ │ │ │ └── LEDs.h │ │ │ │ └── B1_XPLAINED │ │ │ │ ├── Buttons.h │ │ │ │ ├── Dataflash.h │ │ │ │ └── LEDs.h │ │ ├── Misc │ │ │ ├── AT45DB321C.h │ │ │ ├── AT45DB642D.h │ │ │ ├── RingBuffer.h │ │ │ └── TerminalCodes.h │ │ ├── Peripheral │ │ │ ├── ADC.h │ │ │ ├── AVR8 │ │ │ │ ├── ADC_AVR8.h │ │ │ │ ├── SPI_AVR8.h │ │ │ │ ├── SerialSPI_AVR8.h │ │ │ │ ├── Serial_AVR8.c │ │ │ │ ├── Serial_AVR8.h │ │ │ │ ├── TWI_AVR8.c │ │ │ │ └── TWI_AVR8.h │ │ │ ├── SPI.h │ │ │ ├── Serial.h │ │ │ ├── SerialSPI.h │ │ │ ├── TWI.h │ │ │ └── XMEGA │ │ │ │ ├── SPI_XMEGA.h │ │ │ │ ├── SerialSPI_XMEGA.h │ │ │ │ ├── Serial_XMEGA.c │ │ │ │ └── Serial_XMEGA.h │ │ └── USB │ │ │ ├── Class │ │ │ ├── AndroidAccessoryClass.h │ │ │ ├── AudioClass.h │ │ │ ├── CDCClass.h │ │ │ ├── Common │ │ │ │ ├── AndroidAccessoryClassCommon.h │ │ │ │ ├── AudioClassCommon.h │ │ │ │ ├── CDCClassCommon.h │ │ │ │ ├── HIDClassCommon.h │ │ │ │ ├── HIDParser.c │ │ │ │ ├── HIDParser.h │ │ │ │ ├── HIDReportData.h │ │ │ │ ├── MIDIClassCommon.h │ │ │ │ ├── MassStorageClassCommon.h │ │ │ │ ├── PrinterClassCommon.h │ │ │ │ ├── RNDISClassCommon.h │ │ │ │ └── StillImageClassCommon.h │ │ │ ├── Device │ │ │ │ ├── AudioClassDevice.c │ │ │ │ ├── AudioClassDevice.h │ │ │ │ ├── CDCClassDevice.c │ │ │ │ ├── CDCClassDevice.h │ │ │ │ ├── HIDClassDevice.c │ │ │ │ ├── HIDClassDevice.h │ │ │ │ ├── MIDIClassDevice.c │ │ │ │ ├── MIDIClassDevice.h │ │ │ │ ├── MassStorageClassDevice.c │ │ │ │ ├── MassStorageClassDevice.h │ │ │ │ ├── RNDISClassDevice.c │ │ │ │ └── RNDISClassDevice.h │ │ │ ├── HIDClass.h │ │ │ ├── Host │ │ │ │ ├── AndroidAccessoryClassHost.c │ │ │ │ ├── AndroidAccessoryClassHost.h │ │ │ │ ├── AudioClassHost.c │ │ │ │ ├── AudioClassHost.h │ │ │ │ ├── CDCClassHost.c │ │ │ │ ├── CDCClassHost.h │ │ │ │ ├── HIDClassHost.c │ │ │ │ ├── HIDClassHost.h │ │ │ │ ├── MIDIClassHost.c │ │ │ │ ├── MIDIClassHost.h │ │ │ │ ├── MassStorageClassHost.c │ │ │ │ ├── MassStorageClassHost.h │ │ │ │ ├── PrinterClassHost.c │ │ │ │ ├── PrinterClassHost.h │ │ │ │ ├── RNDISClassHost.c │ │ │ │ ├── RNDISClassHost.h │ │ │ │ ├── StillImageClassHost.c │ │ │ │ └── StillImageClassHost.h │ │ │ ├── MIDIClass.h │ │ │ ├── MassStorageClass.h │ │ │ ├── PrinterClass.h │ │ │ ├── RNDISClass.h │ │ │ └── StillImageClass.h │ │ │ ├── Core │ │ │ ├── AVR8 │ │ │ │ ├── Device_AVR8.c │ │ │ │ ├── Device_AVR8.h │ │ │ │ ├── EndpointStream_AVR8.c │ │ │ │ ├── EndpointStream_AVR8.h │ │ │ │ ├── Endpoint_AVR8.c │ │ │ │ ├── Endpoint_AVR8.h │ │ │ │ ├── Host_AVR8.c │ │ │ │ ├── Host_AVR8.h │ │ │ │ ├── OTG_AVR8.h │ │ │ │ ├── PipeStream_AVR8.c │ │ │ │ ├── PipeStream_AVR8.h │ │ │ │ ├── Pipe_AVR8.c │ │ │ │ ├── Pipe_AVR8.h │ │ │ │ ├── Template │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ ├── Template_Endpoint_RW.c │ │ │ │ │ └── Template_Pipe_RW.c │ │ │ │ ├── USBController_AVR8.c │ │ │ │ ├── USBController_AVR8.h │ │ │ │ ├── USBInterrupt_AVR8.c │ │ │ │ └── USBInterrupt_AVR8.h │ │ │ ├── ConfigDescriptor.c │ │ │ ├── ConfigDescriptor.h │ │ │ ├── Device.h │ │ │ ├── DeviceStandardReq.c │ │ │ ├── DeviceStandardReq.h │ │ │ ├── Endpoint.h │ │ │ ├── EndpointStream.h │ │ │ ├── Events.c │ │ │ ├── Events.h │ │ │ ├── Host.h │ │ │ ├── HostStandardReq.c │ │ │ ├── HostStandardReq.h │ │ │ ├── OTG.h │ │ │ ├── Pipe.h │ │ │ ├── PipeStream.h │ │ │ ├── StdDescriptors.h │ │ │ ├── StdRequestType.h │ │ │ ├── UC3 │ │ │ │ ├── Device_UC3.c │ │ │ │ ├── Device_UC3.h │ │ │ │ ├── EndpointStream_UC3.c │ │ │ │ ├── EndpointStream_UC3.h │ │ │ │ ├── Endpoint_UC3.c │ │ │ │ ├── Endpoint_UC3.h │ │ │ │ ├── Host_UC3.c │ │ │ │ ├── Host_UC3.h │ │ │ │ ├── PipeStream_UC3.c │ │ │ │ ├── PipeStream_UC3.h │ │ │ │ ├── Pipe_UC3.c │ │ │ │ ├── Pipe_UC3.h │ │ │ │ ├── Template │ │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ │ ├── Template_Endpoint_RW.c │ │ │ │ │ └── Template_Pipe_RW.c │ │ │ │ ├── USBController_UC3.c │ │ │ │ ├── USBController_UC3.h │ │ │ │ ├── USBInterrupt_UC3.c │ │ │ │ └── USBInterrupt_UC3.h │ │ │ ├── USBController.h │ │ │ ├── USBInterrupt.h │ │ │ ├── USBMode.h │ │ │ ├── USBTask.c │ │ │ ├── USBTask.h │ │ │ └── XMEGA │ │ │ │ ├── Device_XMEGA.c │ │ │ │ ├── Device_XMEGA.h │ │ │ │ ├── EndpointStream_XMEGA.c │ │ │ │ ├── EndpointStream_XMEGA.h │ │ │ │ ├── Endpoint_XMEGA.c │ │ │ │ ├── Endpoint_XMEGA.h │ │ │ │ ├── Host_XMEGA.c │ │ │ │ ├── PipeStream_XMEGA.c │ │ │ │ ├── Pipe_XMEGA.c │ │ │ │ ├── Template │ │ │ │ ├── Template_Endpoint_Control_R.c │ │ │ │ ├── Template_Endpoint_Control_W.c │ │ │ │ └── Template_Endpoint_RW.c │ │ │ │ ├── USBController_XMEGA.c │ │ │ │ ├── USBController_XMEGA.h │ │ │ │ ├── USBInterrupt_XMEGA.c │ │ │ │ └── USBInterrupt_XMEGA.h │ │ │ └── USB.h │ ├── License.txt │ ├── Platform │ │ ├── UC3 │ │ │ ├── ClockManagement.h │ │ │ ├── Exception.S │ │ │ ├── InterruptManagement.c │ │ │ └── InterruptManagement.h │ │ └── XMEGA │ │ │ └── ClockManagement.h │ ├── Scheduler │ │ ├── Scheduler.c │ │ └── Scheduler.h │ ├── Version.h │ └── makefile ├── README.txt └── makefile ├── README.md ├── adaptffbjoy-circuit-tinycad.dsn ├── debug.c ├── debug.h ├── downloads ├── adaptffbjoy-breadboard.jpg ├── adaptffbjoy-circuit.png ├── adaptffbjoy-r54-Clean.hex └── adaptffbjoy-r54.hex ├── ffb-pro.c ├── ffb-pro.h ├── ffb-wheel.c ├── ffb-wheel.h ├── ffb.c ├── ffb.h ├── includes.h ├── joystick.aws ├── main.c ├── main.h ├── makefile └── usb_hid.h /FeedbackTester/Feedback.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 10.00 2 | # Visual Studio 2008 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Feedback", "Feedback.csproj", "{C9B4764E-14EF-4DF5-972B-E95AB7D7C597}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {C9B4764E-14EF-4DF5-972B-E95AB7D7C597}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {C9B4764E-14EF-4DF5-972B-E95AB7D7C597}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {C9B4764E-14EF-4DF5-972B-E95AB7D7C597}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {C9B4764E-14EF-4DF5-972B-E95AB7D7C597}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /FeedbackTester/Feedback.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/Feedback.suo -------------------------------------------------------------------------------- /FeedbackTester/UpgradeLog.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /FeedbackTester/bin/Debug/Feedback.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/bin/Debug/Feedback.exe -------------------------------------------------------------------------------- /FeedbackTester/bin/Debug/Feedback.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/bin/Debug/Feedback.pdb -------------------------------------------------------------------------------- /FeedbackTester/bin/Debug/Feedback.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/bin/Debug/Feedback.vshost.exe -------------------------------------------------------------------------------- /FeedbackTester/bin/Debug/Feedback.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /FeedbackTester/bin/Release/Feedback.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/bin/Release/Feedback.exe -------------------------------------------------------------------------------- /FeedbackTester/bin/Release/Feedback.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/bin/Release/Feedback.vshost.exe -------------------------------------------------------------------------------- /FeedbackTester/bin/Release/Feedback.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /FeedbackTester/csfeedback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/csfeedback.jpg -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/Feedback.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\bin\Debug\Feedback.exe 2 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\bin\Debug\Feedback.pdb 3 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\obj\Debug\ResolveAssemblyReference.cache 4 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\obj\Debug\Feedback.frmMain.resources 5 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\obj\Debug\Feedback.csproj.GenerateResource.Cache 6 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\obj\Debug\Feedback.exe 7 | D:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\Managed\DirectInput\Feedback\obj\Debug\Feedback.pdb 8 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Debug\Feedback.exe 9 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Debug\Feedback.pdb 10 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Debug\ResolveAssemblyReference.cache 11 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Debug\Feedback.frmMain.resources 12 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Debug\Feedback.csproj.GenerateResource.Cache 13 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\bin\Debug\Feedback.exe 14 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\bin\Debug\Feedback.pdb 15 | -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/Feedback.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Debug/Feedback.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/Feedback.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Debug/Feedback.exe -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/Feedback.frmMain.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Debug/Feedback.frmMain.resources -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/Feedback.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Debug/Feedback.pdb -------------------------------------------------------------------------------- /FeedbackTester/obj/Debug/ResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Debug/ResolveAssemblyReference.cache -------------------------------------------------------------------------------- /FeedbackTester/obj/Release/Feedback.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\bin\Release\Feedback.exe 2 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Release\ResolveAssemblyReference.cache 3 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Release\Feedback.frmMain.resources 4 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Release\Feedback.csproj.GenerateResource.Cache 5 | D:\Documents and Settings\Santiago\My Documents\adapt-ffb\FeedbackTester\obj\Release\Feedback.exe 6 | -------------------------------------------------------------------------------- /FeedbackTester/obj/Release/Feedback.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Release/Feedback.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /FeedbackTester/obj/Release/Feedback.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Release/Feedback.exe -------------------------------------------------------------------------------- /FeedbackTester/obj/Release/Feedback.frmMain.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/FeedbackTester/obj/Release/Feedback.frmMain.resources -------------------------------------------------------------------------------- /Joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Tero Loimuneva (tloimu [at] gmail [dot] com) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | /** \file 25 | * 26 | * Header file for Joystick.c. 27 | */ 28 | 29 | #ifndef _JOYSTICK_H_ 30 | #define _JOYSTICK_H_ 31 | 32 | #include "main.h" 33 | 34 | extern const uint8_t INPUT_REPORTID_ALL; 35 | 36 | // Data structures for input reports from the joystick positions 37 | 38 | typedef struct 39 | { 40 | // Joystick Input Report 41 | uint8_t reportId; // =1 42 | int16_t X; 43 | int16_t Y; 44 | //int16_t Z; 45 | int8_t Rz; //, Rx, Ry; 46 | //uint8_t Rudder; 47 | uint8_t Throttle; 48 | uint16_t Button; 49 | uint8_t Hat; 50 | } USB_JoystickReport_Data_t; 51 | 52 | // Functions that form the inferface from the generic parts of the code 53 | // to joystick model specific parts. 54 | 55 | 56 | // Gets called at very beginning to allow joystick model specific 57 | // initializations of the hardware and software to occur. 58 | void Joystick_Init(void); 59 | 60 | // Gets called to check connection to the joystick at startup 61 | // or after disconnect. 62 | // If initialization succeeds, the function should return true. 63 | // If it fails, return false and this functions gets called again 64 | // until further progress is made (e.g. waiting for the actual 65 | // joystick to be connected). 66 | int Joystick_Connect(void); 67 | 68 | // Gets called when input report of joysticks position, buttons etc. are 69 | // requested. Data written to is sent to host if the function 70 | // returns true. If false is returned, nothing is sent. 71 | // If has value INPUT_REPORTID_ALL, all input report IDs should 72 | // generated. 73 | int Joystick_CreateInputReport(uint8_t inReportId, USB_JoystickReport_Data_t* const outReportData); 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/CodeTemplates/DriverStubs/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /* 32 | This is a stub driver header file, for implementing custom board 33 | layout hardware with compatible LUFA board specific drivers. If 34 | the library is configured to use the BOARD_USER board mode, this 35 | driver file should be completed and copied into the "/Board/" folder 36 | inside the application's folder. 37 | 38 | This stub is for the board-specific component of the LUFA Buttons driver, 39 | for the control of physical board-mounted GPIO pushbuttons. 40 | */ 41 | 42 | #ifndef __BUTTONS_USER_H__ 43 | #define __BUTTONS_USER_H__ 44 | 45 | /* Includes: */ 46 | // TODO: Add any required includes here 47 | 48 | /* Enable C linkage for C++ Compilers: */ 49 | #if defined(__cplusplus) 50 | extern "C" { 51 | #endif 52 | 53 | /* Preprocessor Checks: */ 54 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 55 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 56 | #endif 57 | 58 | /* Public Interface - May be used in end-application: */ 59 | /* Macros: */ 60 | /** Button mask for the first button on the board. */ 61 | #define BUTTONS_BUTTON1 // TODO: Add mask for first board button here 62 | 63 | /* Inline Functions: */ 64 | #if !defined(__DOXYGEN__) 65 | static inline void Buttons_Init(void) 66 | { 67 | // TODO: Initialize the appropriate port pins as an inputs here, with pull-ups 68 | } 69 | 70 | static inline void Buttons_Disable(void) 71 | { 72 | // TODO: Clear the appropriate port pins as high impedance inputs here 73 | } 74 | 75 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 76 | static inline uint8_t Buttons_GetStatus(void) 77 | { 78 | // TODO: Return current button status here, debounced if required 79 | } 80 | #endif 81 | 82 | /* Disable C linkage for C++ Compilers: */ 83 | #if defined(__cplusplus) 84 | } 85 | #endif 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/CodeTemplates/makefile_template.avr8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/CodeTemplates/makefile_template.avr8 -------------------------------------------------------------------------------- /LUFA-120219/LUFA/CodeTemplates/makefile_template.uc3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/CodeTemplates/makefile_template.uc3 -------------------------------------------------------------------------------- /LUFA-120219/LUFA/CodeTemplates/makefile_template.xmega: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/CodeTemplates/makefile_template.xmega -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Common/Architectures.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Supported library architecture defines. 33 | * 34 | * \copydetails Group_Architectures 35 | * 36 | * \note Do not include this file directly, rather include the Common.h header file instead to gain this file's 37 | * functionality. 38 | */ 39 | 40 | /** \ingroup Group_Common 41 | * \defgroup Group_Architectures Hardware Architectures 42 | * \brief Supported library architecture defines. 43 | * 44 | * Architecture macros for selecting the desired target microcontroller architecture. One of these values should be 45 | * defined as the value of \c ARCH in the user project makefile via the \c -D compiler switch to GCC, to select the 46 | * target architecture. 47 | * 48 | * The selected architecture should remain consistent with the makefile \c ARCH value, which is used to select the 49 | * underlying driver source files for each architecture. 50 | * 51 | * @{ 52 | */ 53 | 54 | #ifndef __LUFA_ARCHITECTURES_H__ 55 | #define __LUFA_ARCHITECTURES_H__ 56 | 57 | /* Preprocessor Checks: */ 58 | #if !defined(__INCLUDE_FROM_COMMON_H) 59 | #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality. 60 | #endif 61 | 62 | /* Public Interface - May be used in end-application: */ 63 | /* Macros: */ 64 | /** Selects the Atmel 8-bit AVR (AT90USB* and ATMEGA*U* chips) architecture. */ 65 | #define ARCH_AVR8 0 66 | 67 | /** Selects the Atmel 32-bit UC3 AVR (AT32UC3* chips) architecture. */ 68 | #define ARCH_UC3 1 69 | 70 | /** Selects the Atmel XMEGA AVR (ATXMEGA*U chips) architecture. */ 71 | #define ARCH_XMEGA 2 72 | 73 | #if !defined(__DOXYGEN__) 74 | #define ARCH_ ARCH_AVR8 75 | 76 | #if !defined(ARCH) 77 | #define ARCH ARCH_AVR8 78 | #endif 79 | #endif 80 | 81 | #endif 82 | 83 | /** @} */ 84 | 85 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/AboutLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_AboutLUFA About LUFA 9 | * 10 | * This section of the manual contains information about the library as a whole, including its supported targets, 11 | * past and planned changes, and links to other projects incorporating LUFA. 12 | * 13 | * Subsections: 14 | * \li \subpage Page_DeviceSupport - Current Device and Hardware Support 15 | * \li \subpage Page_Resources - LUFA and USB Related Resources 16 | * \li \subpage Page_ChangeLog - Project Changelog 17 | * \li \subpage Page_FutureChanges - Planned Changes to the Library 18 | * \li \subpage Page_LUFAPoweredProjects - Other Projects Using LUFA 19 | */ 20 | 21 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/Author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/DoxygenPages/Author.jpg -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/BuildingLinkableLibraries.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_BuildLibrary Building as a Linkable Library 8 | * 9 | * The LUFA library can be built as a proper linkable library (with the extention .a) under AVR-GCC, so that 10 | * the library does not need to be recompiled with each revision of a user project. Instructions for creating 11 | * a library from a given source tree can be found in the AVR-GCC user manual included in the WinAVR install 12 | * /Docs/ directory. 13 | * 14 | * However, building the library is not recommended, as the static (compile-time) options will be 15 | * unable to be changed without a recompilation of the LUFA code. Therefore, if the library is to be built 16 | * from the LUFA source, it should be made to be application-specific and compiled with the static options 17 | * that are required for each project (which should be recorded along with the library). 18 | * 19 | * Normal library use has the library components compiled in at the same point as the application code, as 20 | * demonstrated in the library demos and applications. This is the preferred method, as the library is recompiled 21 | * each time to ensure that all static options for a particular application are applied. 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/CompilingApps.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_CompilingApps Compiling the Demos, Bootloaders and Projects 8 | * 9 | * The following details how to compile the included LUFA demos, applications and bootloaders using AVR-GCC. 10 | * 11 | * \section Sec_Prerequisites Prerequisites 12 | * Before you can compile any of the LUFA library code or demos, you will need a recent distribution of avr-libc (1.6.2+) 13 | * and the AVR-GCC (4.2+) compiler. For Windows users, the best way to obtain these is the WinAVR project 14 | * (http://winavr.sourceforge.net) as this provides a single-file setup for everything required to compile your 15 | * own AVR projects. 16 | * 17 | * \section Sec_Compiling Compiling a LUFA Application 18 | * Compiling the LUFA demos, applications and/or bootloaders is very simple. LUFA comes with makefile scripts for 19 | * each individual demo, bootloader and project folder, as well as scripts in the /Demos/, /Bootloaders/, /Projects/ 20 | * and the LUFA root directory. This means that compilation can be started from any of the above directories, with 21 | * a build started from an upper directory in the directory structure executing build of all child directories under it. 22 | * This means that while a build inside a particular demo directory will build only that particular demo, a build stated 23 | * from the /Demos/ directory will build all LUFA demo projects sequentially. 24 | * 25 | * To build a project from the source via the command line, the command "make all" should be executed from the command line in the directory 26 | * of interest. To remove compiled files (including the binary output, all intermediately files and all diagnostic output 27 | * files), execute "make clean". Once a "make all" has been run and no errors were encountered, the resulting binary will 28 | * be located in the generated ".HEX" file. If your project makes use of pre-initialized EEPROM variables, the generated ".EEP" 29 | * file will contain the project's EEPROM data. 30 | */ 31 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/DevelopingWithLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_DevelopingWithLUFA Developing With LUFA 9 | * 10 | * This section of the manual contains information on LUFA development, such as Getting Started information, 11 | * information on compile-time tuning of the library and other developer-related sections. 12 | * 13 | * Subsections: 14 | * \li \subpage Page_TokenSummary - Summary of Compile Time Tokens 15 | * \li \subpage Page_Migration - Migrating from an Older LUFA Version 16 | * \li \subpage Page_VIDPID - Allocated USB VID and PID Values 17 | * \li \subpage Page_BuildLibrary - Building as a Linkable Library 18 | * \li \subpage Page_WritingBoardDrivers - How to Write Custom Board Drivers 19 | * \li \subpage Page_SoftwareBootloaderStart - How to jump to the bootloader in software 20 | */ 21 | 22 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/Donating.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Donating Donating to Support This Project 9 | * 10 | * \image html Author.jpg "Dean Camera, LUFA Developer" 11 | * 12 | * I am a 22 year old University student studying for a double degree in Computer Science and Electronics Engineering. 13 | * The development and support of this library requires much effort from myself, as I am the sole developer, maintainer 14 | * and supporter. Please consider donating a small amount to support this and my future Open Source projects - All 15 | * donations are greatly appreciated. 16 | * 17 | * Note that commercial entities can remove the attribution portion of the LUFA license by a one-time fee - see 18 | * \ref Page_LicenseInfo for more details (Note: Please do NOT pay this in advance through the donation link below - 19 | * contact author for payment details.). 20 | * 21 | * \image html "http://www.pledgie.com/campaigns/6927.png?skin_name=chrome" 22 | * Donate to this project via PayPal - Thanks in Advance! 23 | */ 24 | 25 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/FutureChanges.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_FutureChanges Future Changes 8 | * 9 | * Below is a list of future changes which are proposed for the LUFA library, but not yet started/complete. 10 | * This gives an unordered list of future changes which may be available in future releases of the library. 11 | * If you have an item to add to this list, please contact the library author via email, the LUFA mailing list, 12 | * or post your suggestion as an enhancement request to the project bug tracker. 13 | * 14 | * Targeted for Future Releases: 15 | * - Code Features 16 | * -# Add hub support when in Host mode for multiple devices 17 | * -# Investigate virtual hubs when in device mode instead of composite devices 18 | * -# Change makefiles to allow for absolute LUFA location to be used 19 | * -# Re-add interrupt Pipe/Endpoint support 20 | * -# Add makefile includes to reduce boilerplate in user makefiles 21 | * -# Update stream APIs to use DMA transfers on supported architectures 22 | * -# Pull out third party libraries into a separate folder and reference them as required 23 | * -# Add a LUFA_YIELD macro for integration into a third-party RTOS 24 | * -# Abstract out Mass Storage byte send/receive to prevent low level API use in projects 25 | * -# Consider switch from endpoint numbers to full endpoint addresses to ease future architecture expansion 26 | * -# Fix HID report parser usage support for array types 27 | * -# Make HOST_DEVICE_SETTLE_DELAY_MS a global variable that can be changed 28 | * -# Add MANDATORY_EVENT_FUNCTIONS compile time option 29 | * -# Add watchdog support to the library and apps/bootloaders 30 | * -# Re-run USBIF test suite on all classes to formally verify operation 31 | * - Documentation/Support 32 | * -# Add detailed overviews of how each demo works 33 | * -# Add board overviews 34 | * -# Write LUFA tutorials 35 | * - Demos/Projects 36 | * -# Device/Host USB bridge 37 | * -# Finish incomplete demos and projects 38 | * -# Add class driver support for Test and Measurement class 39 | * -# Add class driver support for EEM class 40 | * -# Add class driver support for ECM class 41 | * -# Port all demos to multiple architectures 42 | * - Ports 43 | * -# Finish USB XMEGA port 44 | * -# Add AVR32 UC3C, UC3D and UC3L support 45 | * -# Atmel ARM7 series microcontrollers 46 | * -# Other (commercial) C compilers 47 | */ 48 | 49 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/GettingStarted.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_GettingStarted Getting Started 8 | * 9 | * Out of the box, LUFA contains a large number of pre-made class demos for you to test, experiment with and 10 | * ultimately build upon for your own projects. All the demos (where possible) come pre-configured to build and 11 | * run correctly on the AT90USB1287 AVR microcontroller, mounted on the Atmel USBKEY board and running at an 8MHz 12 | * master clock. This is due to two reasons; one, it is the hardware the author possesses, and two, it is the most 13 | * popular Atmel USB demonstration board to date. To learn how to reconfigure, recompile and program the included 14 | * LUFA applications using different settings, see the subsections below. 15 | * 16 | * Most of the included demos in the /Demos/ folder come in both ClassDriver and LowLevel varieties. If you are new 17 | * to LUFA, it is highly recommended that you look at the ClassDriver versions first, which use the pre-made USB 18 | * Class Drivers (\ref Group_USBClassDrivers) to simplify the use of the standard USB classes in user applications. 19 | * 20 | * For an overview of the included library applications, bootloaders and demos, see \ref Page_LibraryApps. 21 | * 22 | * Subsections: 23 | * \li \subpage Page_ConfiguringApps - How to Configure the Included Demos, Projects and Bootloaders 24 | * \li \subpage Page_CompilingApps - How to Compile the Included Demos, Projects and Bootloaders 25 | * \li \subpage Page_ProgrammingApps - How to Program an AVR with the Included Demos, Projects and Bootloaders 26 | */ 27 | 28 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/Groups.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \defgroup Group_BoardDrivers Board Drivers 8 | * 9 | * Functions, macros, variables, enums and types related to the control of physical board hardware. 10 | */ 11 | 12 | /** \defgroup Group_PeripheralDrivers On-chip Peripheral Drivers 13 | * 14 | * Functions, macros, variables, enums and types related to the control of AVR subsystems. 15 | */ 16 | 17 | /** \defgroup Group_MiscDrivers Miscellaneous Drivers 18 | * 19 | * Miscellaneous driver Functions, macros, variables, enums and types. 20 | */ 21 | 22 | /** \defgroup Group_PlatformDrivers System Platform Drivers 23 | * 24 | * Drivers relating to the general architecture platform, such as clock setup and interrupt management. 25 | */ 26 | 27 | /** \defgroup Group_PlatformDrivers_AVR8 AVR8 28 | * \ingroup Group_PlatformDrivers 29 | * 30 | * Drivers relating to the AVR8 architecture platform, such as clock setup and interrupt management. 31 | */ 32 | 33 | /** \defgroup Group_PlatformDrivers_XMEGA XMEGA 34 | * \ingroup Group_PlatformDrivers 35 | * 36 | * Drivers relating to the XMEGA architecture platform, such as clock setup and interrupt management. 37 | */ 38 | 39 | /** \defgroup Group_PlatformDrivers_UC3 UC3 40 | * \ingroup Group_PlatformDrivers 41 | * 42 | * Drivers relating to the UC3 architecture platform, such as clock setup and interrupt management. 43 | */ 44 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/LUFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/DoxygenPages/LUFA.png -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/LUFA_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/LUFA-120219/LUFA/DoxygenPages/LUFA_thumb.png -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/LibraryResources.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Resources Library Resources 9 | * 10 | * \section Sec_UnofficialResources Unofficial Resources 11 | * Unofficial Russian LUFA documentation translation: http://microsin.ru/Download.cnt/doc/LUFA/ \n 12 | * 13 | * \section Sec_ProjectPages LUFA Related Webpages 14 | * Project Homepage: http://www.lufa-lib.org \n 15 | * Commercial Licenses: http://www.lufa-lib.org/license \n 16 | * Author's Website: http://www.fourwalledcubicle.com \n 17 | * Development Blog: http://www.fourwalledcubicle.com/blog \n 18 | * 19 | * \section Sec_ProjectHelp Assistance With LUFA 20 | * Discussion Group: http://www.lufa-lib.org/support \n 21 | * Author's Email: dean [at] fourwalledcubicle [dot] com \n 22 | * 23 | * \section Sec_InDevelopment Latest In-Development Source Code 24 | * Issue Tracker: http://www.lufa-lib.org/tracker \n 25 | * SVN Access: http://www.lufa-lib.org/svn \n 26 | * GIT Access: http://www.lufa-lib.org/git \n 27 | * Latest Repository Source Archive: http://www.lufa-lib.org/latest-archive \n 28 | * Commit RSS Feed: http://www.lufa-lib.org/rss \n 29 | * 30 | * \section Sec_USBResources USB Resources 31 | * USB-IF Website: http://www.usb.org \n 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/LicenseInfo.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_LicenseInfo Source Code License 9 | * 10 | * The LUFA library is currently released under the MIT license, included below. 11 | * 12 | * Commercial entities can opt out of the public disclosure clause in this license 13 | * for a one-time US$1500 payment. This provides a non-exclusive modified MIT licensed which 14 | * allows for the free use of the LUFA library, bootloaders and (where the sole copyright 15 | * is attributed to Dean Camera) demos without public disclosure within an organization, in 16 | * addition to three free hours of consultation with the library author, and priority support. 17 | * Please visit the Commercial License link on \ref Page_Resources for more information on 18 | * ordering a commercial license for your company. 19 | * 20 | * \verbinclude License.txt 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/MainPage.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \mainpage 9 | * 10 | * \image html LUFA.png 11 | *
Logo design by Studio Monsoon Photography
12 | * \n 13 | *
http://www.lufa-lib.org
14 | * \n 15 | * 16 | * LUFA is donationware. For author and donation information, see \ref Page_Donating. 17 | * 18 | * LUFA is an open-source USB library for the USB-enabled AVR microcontrollers, released under the MIT license (see \ref Page_LicenseInfo). 19 | * It supports a large number of USB AVR models and boards (see \ref Page_DeviceSupport). It is designed to provide an easy to use, 20 | * feature rich framework for the development of USB peripherals and hosts. 21 | * 22 | * LUFA focuses on the microcontroller side of USB development only; it includes no PC host USB driver development facilities - other projects 23 | * such as the Windows Driver Development Kit, Windows USB Device Mode Framework and libusb may be of interest for developing custom OS drivers. 24 | * While custom USB devices can be made with LUFA using such tools, the included demos all use the inbuilt OS drivers for each USB class for 25 | * simplicity. 26 | * 27 | * The library is currently in a stable release, suitable for download and incorporation into user projects for 28 | * both host and device modes. For information about the project progression, see the blog link at \ref Page_Resources. 29 | * 30 | * LUFA is written specifically for the free AVR-GCC compiler, and uses several GCC-only extensions to make the 31 | * library API more streamlined and robust. You can download AVR-GCC for free in a convenient windows package, 32 | * from the the WinAVR website (see \ref Page_Resources). 33 | * 34 | * The only required AVR peripherals for LUFA is the USB controller itself and interrupts - LUFA does not require the use of the 35 | * microcontroller's timers or other hardware, leaving more hardware to the application developer. 36 | * 37 | * Accompanying LUFA in the download package is a set of example demo applications, plus several Bootloaders of different classes 38 | * and open source LUFA powered projects. 39 | * 40 | * Subsections: 41 | * \li \subpage Page_WhyUseLUFA - What are the advantages of using LUFA? 42 | * \li \subpage Page_LUFAvsAtmelStack - How does LUFA compare to the Atmel USB AVR stack? 43 | * \li \subpage Page_AlternativeStacks - Alternative USB AVR Stacks 44 | * \li \subpage Page_LicenseInfo - Project source license and commercial use information 45 | * \li \subpage Page_Donating - Donating to support this project 46 | * \li \subpage Page_LibraryApps - Overview of included Demos, Bootloaders and Projects 47 | */ 48 | 49 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/ProgrammingApps.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_ProgrammingApps Programming an Application into a USB AVR 8 | * 9 | * Once you have built an application, you will need a way to program in the resulting ".HEX" file (and, if your 10 | * application uses EEPROM variables with initial values, also a ".EEP" file) into your USB AVR. Normally, the 11 | * reprogramming of an AVR device must be performed using a special piece of programming hardware, through one of the 12 | * supported AVR programming protocols - ISP, HVSP, HVPP, JTAG or dW. This can be done through a custom programmer, 13 | * a third party programmer, or an official Atmel AVR tool - for more information, see the Atmel.com website. 14 | * 15 | * Alternatively, you can use the bootloader. From the Atmel factory, each USB AVR comes preloaded with the Atmel 16 | * DFU (Device Firmware Update) class bootloader, a small piece of AVR firmware which allows the remainder of the 17 | * AVR to be programmed through a non-standard interface such as the serial USART port, SPI, or (in this case) USB. 18 | * Bootloaders have the advantage of not requiring any special hardware for programming, and cannot usually be erased 19 | * or broken without an external programming device. They have disadvantages however; they cannot change the fuses of 20 | * the AVR (special configuration settings that control the operation of the chip itself) and a small portion of the 21 | * AVR's FLASH program memory must be reserved to contain the bootloader firmware, and thus cannot be used by the 22 | * loaded application. Atmel's DFU bootloader is either 4KB (for the smaller USB AVRs) or 8KB (for the larger USB AVRs). 23 | * 24 | * If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation. 25 | * Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible) 26 | * alternative exists called "dfu-programmer". 27 | */ 28 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/SoftwareBootloaderJump.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_SoftwareBootloaderStart Entering the Bootloader via Software 9 | * 10 | * A common requirement of many applications is the ability to jump to the programmed bootloader of a chip 11 | * on demand, via the code's firmware (i.e. not as a result of any physical user interaction with the 12 | * hardware). This might be required because the device does not have any physical user input, or simply 13 | * just to streamline the device upgrade process on the host PC. 14 | * 15 | * The following C code snippets may be used to enter the bootloader upon request by the user application. 16 | * By using the watchdog to physically reset the controller, it is ensured that all system hardware is 17 | * completely reset to their defaults before the bootloader is run. This is important; since bootloaders 18 | * are written to occupy a very limited space, they usually make assumptions about the register states based 19 | * on the default values after a hard-reset of the chip. 20 | * 21 | * \section Sec_SoftareBootAVR8 AVR8 Architecture 22 | * The following software bootloader jump code is written for the AVR8 architecture. 23 | * 24 | * \code 25 | * #include 26 | * #include 27 | * #include 28 | * 29 | * #include 30 | * #include 31 | * 32 | * uint32_t Boot_Key ATTR_NO_INIT; 33 | * 34 | * #define MAGIC_BOOT_KEY 0xDC42ACCA 35 | * #define BOOTLOADER_START_ADDRESS (FLASH_SIZE_BYTES - BOOTLOADER_SEC_SIZE_BYTES) 36 | * 37 | * void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3); 38 | * void Bootloader_Jump_Check(void) 39 | * { 40 | * // If the reset source was the bootloader and the key is correct, clear it and jump to the bootloader 41 | * if ((MCUSR & (1 << WDRF)) && (Boot_Key == MAGIC_BOOT_KEY)) 42 | * { 43 | * Boot_Key = 0; 44 | * ((void (*)(void))BOOTLOADER_START_ADDRESS)(); 45 | * } 46 | * } 47 | * 48 | * void Jump_To_Bootloader(void) 49 | * { 50 | * // If USB is used, detach from the bus and reset it 51 | * USB_Disable(); 52 | * 53 | * // Disable all interrupts 54 | * cli(); 55 | * 56 | * // Wait two seconds for the USB detachment to register on the host 57 | * Delay_MS(2000); 58 | * 59 | * // Set the bootloader key to the magic value and force a reset 60 | * Boot_Key = MAGIC_BOOT_KEY; 61 | * wdt_enable(WDTO_250MS); 62 | * for (;;); 63 | * } 64 | * \endcode 65 | * 66 | * Note that the bootloader magic key can be any arbitrary value. The FLASH_SIZE_BYTES and 67 | * BOOTLOADER_SEC_SIZE_BYTES tokens should be replaced with the total flash size of the AVR 68 | * in bytes, and the allocated size of the bootloader section for the target AVR. 69 | * 70 | */ 71 | 72 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/WhyUseLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_WhyUseLUFA Why Use LUFA? 9 | * 10 | * The LUFA Library has many advantages over implementing the code required to drive the USB AVRs directly. 11 | * It is much more preferable to incorporate LUFA into your existing projects - or even make a new project 12 | * using LUFA - than it is to start from scratch and use the USB AVR registers directly. Some of these reasons 13 | * are: 14 | * 15 | * - Portability: 16 | * The LUFA stack is designed to run (at some capacity) on the entire Atmel range of USB AVRs, regardless of the 17 | * exact USB controller revision used. If you decide to implement your own USB stack, you will either need to 18 | * code around the differences between each USB AVR controller's implementation between different chip models, or 19 | * require your code to run on only one specific USB AVR model series. 20 | * 21 | * - Speed of Development: 22 | * LUFA ships with a wide range of pre-made demos, bootloaders and projects for you to try, learn and extend. Each 23 | * of these demos are tested (where possible) across as many USB AVRs and Operating Systems as possible, to ensure 24 | * that they work under as many conditions as possible. In addition, there are inbuilt class drivers for several of 25 | * the USB classes which you can make use of in your projects with minimal effort. 26 | * 27 | * - Maintainability: 28 | * As LUFA takes care of much of the USB implementation, you can be left to focusing on your actual project's 29 | * functionality, rather than being held back developing and debugging the USB stack code. Since LUFA uses clear APIs 30 | * for USB development, your code will be more readable than if it had the low level USB stack code integrated into 31 | * it directly. Updating the LUFA library is a simple folder-replacement and gives new features and bug fixes in 32 | * seconds each time a new release is made. 33 | * 34 | * - Size: 35 | * Not just requiring less code to make complex USB devices, LUFA is written to compile down as much as possible into 36 | * optimal code, to occupy only a small space for its feature set. 37 | * 38 | * - Support: 39 | * Since many people are now using LUFA in their own projects, you can take advantage of other's knowledge when you run 40 | * into difficulties or need some advice. In addition, you can also email the library author to receive personalized 41 | * support when you need it (subject to author's schedule). 42 | */ 43 | 44 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/WritingBoardDrivers.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_WritingBoardDrivers Writing LUFA Board Drivers 8 | * 9 | * LUFA ships with several basic pre-made board drivers, to control hardware present on the supported board 10 | * hardware - such as Dataflash ICs, LEDs, Joysticks, or other hardware peripherals. When compiling an application 11 | * which makes use of one or more board drivers located in LUFA/Drivers/Board, you must also indicate what board 12 | * hardware you are using in your project makefile. This is done by defining the BOARD macro using the -D switch 13 | * passed to the compiler, with a constant of BOARD_{Name}. For example -DBOARD=BOARD_USBKEY instructs the 14 | * compiler to use the USBKEY board hardware drivers. 15 | * 16 | * If your application does not use *any* board level drivers, you can omit the definition of the BOARD macro. 17 | * However, some users may wish to write their own custom board hardware drivers which are to remain compatible 18 | * with the LUFA hardware API. To do this, the BOARD macro should be defined to the value BOARD_USER. This indicates 19 | * that the board level drivers should be located in a folder named "Board" located inside the application's folder. 20 | * 21 | * When used, the driver stub files located in the LUFA/CodeTemplates/DriverStubs folder should be copied to the user 22 | * Board/ directory, and fleshed out to include the values and code needed to control the custom board hardware. Once 23 | * done, the existing LUFA board level APIs (accessed in the regular LUFA/Drivers/Board/ folder) will redirect to the 24 | * user board drivers, maintaining code compatibility and allowing for a different board to be selected through the 25 | * project makefile with no code changes. 26 | */ 27 | 28 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/DoxygenPages/footer.htm: -------------------------------------------------------------------------------- 1 | LUFA Project Page | Support Mailing List | Donate | Four Walled Cubicle - LUFA, the Lightweight USB Framework for AVRs -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 33 | * \copydetails Group_Buttons_ATAVRUSBRF01 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_ATAVRUSBRF01 ATAVRUSBRF01 41 | * \brief Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 42 | * 43 | * Board specific Buttons driver header for the Atmel ATAVRUSBRF01. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_ATAVRUSBRF01_H__ 49 | #define __BUTTONS_ATAVRUSBRF01_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Tempusdictum Benito. 33 | * \copydetails Group_Buttons_BENITO 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_BENITO BENITO 41 | * \brief Board specific Buttons driver header for the Tempusdictum Benito. 42 | * 43 | * Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_BENITO_H__ 49 | #define __BUTTONS_BENITO_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific LED driver header for the Busware CULV3. 33 | * \copydetails Group_LEDs_CULV3 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/LEDs.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_CULV3 CULV3 41 | * \brief Board specific Buttons driver header for the Busware CULV3. 42 | * 43 | * Board specific Buttons driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_CULV3_H__ 49 | #define __BUTTONS_CULV3_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 2) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRE &= ~BUTTONS_BUTTON1; 74 | PORTE |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel EVK527. 33 | * \copydetails Group_Buttons_EVK527 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_EVK527 EVK527 41 | * \brief Board specific Buttons driver header for the Atmel EVK527. 42 | * 43 | * Board specific Buttons driver header for the Atmel EVK527. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_EVK527_H__ 49 | #define __BUTTONS_EVK527_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 2) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRE &= ~BUTTONS_BUTTON1; 74 | PORTE |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Mattairtech JM-DB-U2. 33 | * \copydetails Group_Buttons_JMDBU2 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_JMDBU2 JMDBU2 41 | * \brief Board specific Buttons driver header for the Mattairtech JM-DB-U2. 42 | * 43 | * Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_JMDBU2_H__ 49 | #define __BUTTONS_JMDBU2_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the MINIMUS. 33 | * \copydetails Group_Buttons_MINIMUS 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_MINIMUS MINIMUS 41 | * \brief Board specific Buttons driver header for the MINIMUS. 42 | * 43 | * Board specific Buttons driver header for the MINIMUS. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_MINIMUS_H__ 49 | #define __BUTTONS_MINIMUS_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/STK525/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel STK525. 33 | * \copydetails Group_Buttons_STK525 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_STK525 STK525 41 | * \brief Board specific Buttons driver header for the Atmel STK525. 42 | * 43 | * Board specific Buttons driver header for the Atmel STK525. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_STK525_H__ 49 | #define __BUTTONS_STK525_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 2) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRE &= ~BUTTONS_BUTTON1; 74 | PORTE |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/STK526/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel STK526. 33 | * \copydetails Group_Buttons_STK526 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_STK526 STK526 41 | * \brief Board specific Buttons driver header for the Atmel STK526. 42 | * 43 | * Board specific Buttons driver header for the Atmel STK526. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_STK526_H__ 49 | #define __BUTTONS_STK526_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/TUL/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the TUL. 33 | * \copydetails Group_Buttons_TUL 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_TUL TUL 41 | * \brief Board specific Buttons driver header for the TUL. 42 | * 43 | * Board specific Buttons driver header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_TUL_H__ 49 | #define __BUTTONS_TUL_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 2) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRE &= ~BUTTONS_BUTTON1; 74 | PORTE |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the UDIP. 33 | * \copydetails Group_Buttons_UDIP 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_UDIP UDIP 41 | * \brief Board specific Buttons driver header for the UDIP. 42 | * 43 | * Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_UDIP_H__ 49 | #define __BUTTONS_UDIP_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for the Atmel USBKEY. 33 | * \copydetails Group_Buttons_USBKEY 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_USBKEY USBKEY 41 | * \brief Board specific Buttons driver header for the Atmel USBKEY. 42 | * 43 | * Board specific Buttons driver header for the Atmel USBKEY. 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_USBKEY_H__ 49 | #define __BUTTONS_USBKEY_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 2) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRE &= ~BUTTONS_BUTTON1; 74 | PORTE |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRE &= ~BUTTONS_BUTTON1; 80 | PORTE &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Board specific Buttons driver header for Tom's USBTINY MKII. 33 | * \copydetails Group_Buttons_USBTINYMKII 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the Buttons driver 36 | * dispatch header located in LUFA/Drivers/Board/Buttons.h. 37 | */ 38 | 39 | /** \ingroup Group_Buttons 40 | * \defgroup Group_Buttons_USBTINYMKII USBTINYMKII 41 | * \brief Board specific Buttons driver header for Tom's USBTINY MKII. 42 | * 43 | * Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). 44 | * 45 | * @{ 46 | */ 47 | 48 | #ifndef __BUTTONS_USBTINYMKII_H__ 49 | #define __BUTTONS_USBTINYMKII_H__ 50 | 51 | /* Includes: */ 52 | #include "../../../../Common/Common.h" 53 | 54 | /* Enable C linkage for C++ Compilers: */ 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | 59 | /* Preprocessor Checks: */ 60 | #if !defined(__INCLUDE_FROM_BUTTONS_H) 61 | #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. 62 | #endif 63 | 64 | /* Public Interface - May be used in end-application: */ 65 | /* Macros: */ 66 | /** Button mask for the first button on the board. */ 67 | #define BUTTONS_BUTTON1 (1 << 7) 68 | 69 | /* Inline Functions: */ 70 | #if !defined(__DOXYGEN__) 71 | static inline void Buttons_Init(void) 72 | { 73 | DDRD &= ~BUTTONS_BUTTON1; 74 | PORTD |= BUTTONS_BUTTON1; 75 | } 76 | 77 | static inline void Buttons_Disable(void) 78 | { 79 | DDRD &= ~BUTTONS_BUTTON1; 80 | PORTD &= ~BUTTONS_BUTTON1; 81 | } 82 | 83 | static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; 84 | static inline uint8_t Buttons_GetStatus(void) 85 | { 86 | return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); 87 | } 88 | #endif 89 | 90 | /* Disable C linkage for C++ Compilers: */ 91 | #if defined(__cplusplus) 92 | } 93 | #endif 94 | 95 | #endif 96 | 97 | /** @} */ 98 | 99 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Board/Temperature.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "Temperature.h" 32 | 33 | static const uint16_t PROGMEM Temperature_Lookup[TEMP_TABLE_SIZE] = 34 | { 35 | 0x3B4, 0x3B0, 0x3AB, 0x3A6, 0x3A0, 0x39A, 0x394, 0x38E, 0x388, 0x381, 0x37A, 0x373, 36 | 0x36B, 0x363, 0x35B, 0x353, 0x34A, 0x341, 0x338, 0x32F, 0x325, 0x31B, 0x311, 0x307, 37 | 0x2FC, 0x2F1, 0x2E6, 0x2DB, 0x2D0, 0x2C4, 0x2B8, 0x2AC, 0x2A0, 0x294, 0x288, 0x27C, 38 | 0x26F, 0x263, 0x256, 0x24A, 0x23D, 0x231, 0x225, 0x218, 0x20C, 0x200, 0x1F3, 0x1E7, 39 | 0x1DB, 0x1CF, 0x1C4, 0x1B8, 0x1AC, 0x1A1, 0x196, 0x18B, 0x180, 0x176, 0x16B, 0x161, 40 | 0x157, 0x14D, 0x144, 0x13A, 0x131, 0x128, 0x11F, 0x117, 0x10F, 0x106, 0x0FE, 0x0F7, 41 | 0x0EF, 0x0E8, 0x0E1, 0x0DA, 0x0D3, 0x0CD, 0x0C7, 0x0C0, 0x0BA, 0x0B5, 0x0AF, 0x0AA, 42 | 0x0A4, 0x09F, 0x09A, 0x096, 0x091, 0x08C, 0x088, 0x084, 0x080, 0x07C, 0x078, 0x074, 43 | 0x071, 0x06D, 0x06A, 0x067, 0x064, 0x061, 0x05E, 0x05B, 0x058, 0x055, 0x053, 0x050, 44 | 0x04E, 0x04C, 0x049, 0x047, 0x045, 0x043, 0x041, 0x03F, 0x03D, 0x03C, 0x03A, 0x038 45 | }; 46 | 47 | int8_t Temperature_GetTemperature(void) 48 | { 49 | uint16_t Temp_ADC = ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | TEMP_ADC_CHANNEL_MASK); 50 | 51 | if (Temp_ADC > pgm_read_word(&Temperature_Lookup[0])) 52 | return TEMP_MIN_TEMP; 53 | 54 | for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; Index++) 55 | { 56 | if (Temp_ADC > pgm_read_word(&Temperature_Lookup[Index])) 57 | return (Index + TEMP_TABLE_OFFSET_DEGREES); 58 | } 59 | 60 | return TEMP_MAX_TEMP; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/ADC.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Hardware Analogue-to-Digital converter driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific ADC driver, for microcontrollers 35 | * containing an ADC. 36 | * 37 | * User code should include this file, which will in turn include the correct ADC driver header file for the 38 | * currently selected architecture and microcontroller model. 39 | */ 40 | 41 | /** \ingroup Group_PeripheralDrivers 42 | * \defgroup Group_ADC ADC Driver - LUFA/Drivers/Peripheral/ADC.h 43 | * \brief Hardware Analogue-to-Digital converter driver. 44 | * 45 | * \section Sec_Dependencies Module Source Dependencies 46 | * The following files must be built with any user project that uses this module: 47 | * - None 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * Hardware ADC driver. This module provides an easy to use driver for the hardware ADC 51 | * present on many microcontrollers, for the conversion of analogue signals into the 52 | * digital domain. 53 | * 54 | * \note The exact API for this driver may vary depending on the target used - see 55 | * individual target module documentation for the API specific to your target processor. 56 | */ 57 | 58 | #ifndef __ADC_H__ 59 | #define __ADC_H__ 60 | 61 | /* Macros: */ 62 | #define __INCLUDE_FROM_ADC_H 63 | 64 | /* Includes: */ 65 | #include "../../Common/Common.h" 66 | 67 | /* Includes: */ 68 | #if (ARCH == ARCH_AVR8) 69 | #include "AVR8/ADC_AVR8.h" 70 | #else 71 | #error The ADC peripheral driver is not currently available for your selected architecture. 72 | #endif 73 | 74 | #endif 75 | 76 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_SERIAL_C 32 | #include "../Serial.h" 33 | 34 | FILE USARTSerialStream; 35 | 36 | int Serial_putchar(char DataByte, 37 | FILE *Stream) 38 | { 39 | (void)Stream; 40 | 41 | Serial_SendByte(DataByte); 42 | return 0; 43 | } 44 | 45 | int Serial_getchar(FILE *Stream) 46 | { 47 | (void)Stream; 48 | 49 | if (!(Serial_IsCharReceived())) 50 | return _FDEV_EOF; 51 | 52 | return Serial_ReceiveByte(); 53 | } 54 | 55 | int Serial_getchar_Blocking(FILE *Stream) 56 | { 57 | (void)Stream; 58 | 59 | while (!(Serial_IsCharReceived())); 60 | return Serial_ReceiveByte(); 61 | } 62 | 63 | void Serial_SendString_P(const char* FlashStringPtr) 64 | { 65 | uint8_t CurrByte; 66 | 67 | while ((CurrByte = pgm_read_byte(FlashStringPtr)) != 0x00) 68 | { 69 | Serial_SendByte(CurrByte); 70 | FlashStringPtr++; 71 | } 72 | } 73 | 74 | void Serial_SendString(const char* StringPtr) 75 | { 76 | uint8_t CurrByte; 77 | 78 | while ((CurrByte = *StringPtr) != 0x00) 79 | { 80 | Serial_SendByte(CurrByte); 81 | StringPtr++; 82 | } 83 | } 84 | 85 | void Serial_SendData(const uint8_t* Buffer, 86 | uint16_t Length) 87 | { 88 | while (Length--) 89 | Serial_SendByte(*(Buffer++)); 90 | } 91 | 92 | void Serial_CreateStream(FILE* Stream) 93 | { 94 | if (!(Stream)) 95 | { 96 | Stream = &USARTSerialStream; 97 | stdin = Stream; 98 | stdout = Stream; 99 | } 100 | 101 | *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); 102 | } 103 | 104 | void Serial_CreateBlockingStream(FILE* Stream) 105 | { 106 | if (!(Stream)) 107 | { 108 | Stream = &USARTSerialStream; 109 | stdin = Stream; 110 | stdout = Stream; 111 | } 112 | 113 | *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); 114 | } 115 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/SPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Hardware Serial Peripheral Interface driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific SPI driver, for microcontrollers 35 | * containing a hardware SPI. 36 | * 37 | * User code should include this file, which will in turn include the correct SPI driver header file for the 38 | * currently selected architecture and microcontroller model. 39 | */ 40 | 41 | /** \ingroup Group_PeripheralDrivers 42 | * \defgroup Group_SPI SPI Driver - LUFA/Drivers/Peripheral/SPI.h 43 | * \brief Hardware Serial Peripheral Interface driver. 44 | * 45 | * \section Sec_Dependencies Module Source Dependencies 46 | * The following files must be built with any user project that uses this module: 47 | * - None 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * Hardware SPI driver. This module provides an easy to use driver for the setup and transfer of data over 51 | * the selected architecture and microcontroller model's SPI port. 52 | * 53 | * \note The exact API for this driver may vary depending on the target used - see 54 | * individual target module documentation for the API specific to your target processor. 55 | */ 56 | 57 | #ifndef __SPI_H__ 58 | #define __SPI_H__ 59 | 60 | /* Macros: */ 61 | #define __INCLUDE_FROM_SPI_H 62 | 63 | /* Includes: */ 64 | #include "../../Common/Common.h" 65 | 66 | /* Includes: */ 67 | #if (ARCH == ARCH_AVR8) 68 | #include "AVR8/SPI_AVR8.h" 69 | #elif (ARCH == ARCH_XMEGA) 70 | #include "XMEGA/SPI_XMEGA.h" 71 | #else 72 | #error The SPI peripheral driver is not currently available for your selected architecture. 73 | #endif 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/Serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Hardware Serial USART driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific USART driver, for microcontrollers 35 | * containing a hardware USART. 36 | * 37 | * User code should include this file, which will in turn include the correct ADC driver header file for the 38 | * currently selected architecture and microcontroller model. 39 | */ 40 | 41 | /** \ingroup Group_PeripheralDrivers 42 | * \defgroup Group_Serial Serial USART Driver - LUFA/Drivers/Peripheral/Serial.h 43 | * \brief Hardware Serial USART driver. 44 | * 45 | * \section Sec_Dependencies Module Source Dependencies 46 | * The following files must be built with any user project that uses this module: 47 | * - LUFA/Drivers/Peripheral/ARCH/Serial_ARCH.c (Makefile source module name: LUFA_SRC_SERIAL) 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * Hardware serial USART driver. This module provides an easy to use driver for the setup and transfer 51 | * of data over the selected architecture and microcontroller model's USART port. 52 | * 53 | * \note The exact API for this driver may vary depending on the target used - see 54 | * individual target module documentation for the API specific to your target processor. 55 | */ 56 | 57 | #ifndef __SERIAL_H__ 58 | #define __SERIAL_H__ 59 | 60 | /* Macros: */ 61 | #define __INCLUDE_FROM_SERIAL_H 62 | 63 | /* Includes: */ 64 | #include "../../Common/Common.h" 65 | 66 | /* Includes: */ 67 | #if (ARCH == ARCH_AVR8) 68 | #include "AVR8/Serial_AVR8.h" 69 | #elif (ARCH == ARCH_XMEGA) 70 | #include "XMEGA/Serial_XMEGA.h" 71 | #else 72 | #error The Serial peripheral driver is not currently available for your selected architecture. 73 | #endif 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/SerialSPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Hardware SPI Master Mode Serial USART driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific SPI Master Mode USART driver, for 35 | * microcontrollers containing a hardware USART capable of operating in a Master SPI mode. 36 | * 37 | * User code should include this file, which will in turn include the correct ADC driver header file for the 38 | * currently selected architecture and microcontroller model. 39 | */ 40 | 41 | /** \ingroup Group_PeripheralDrivers 42 | * \defgroup Group_SerialSPI Master SPI Mode Serial USART Driver - LUFA/Drivers/Peripheral/SerialSPI.h 43 | * \brief Hardware SPI Master Mode Serial USART driver. 44 | * 45 | * \section Sec_Dependencies Module Source Dependencies 46 | * The following files must be built with any user project that uses this module: 47 | * - None 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * Hardware SPI Master Mode serial USART driver. This module provides an easy to use driver for the setup and transfer 51 | * of data over the selected architecture and microcontroller model's USART port, using a SPI framing format. 52 | * 53 | * \note The exact API for this driver may vary depending on the target used - see 54 | * individual target module documentation for the API specific to your target processor. 55 | */ 56 | 57 | #ifndef __SERIAL_SPI_H__ 58 | #define __SERIAL_SPI_H__ 59 | 60 | /* Macros: */ 61 | #define __INCLUDE_FROM_SERIAL_SPI_H 62 | 63 | /* Includes: */ 64 | #include "../../Common/Common.h" 65 | 66 | /* Includes: */ 67 | #if (ARCH == ARCH_AVR8) 68 | #include "AVR8/SerialSPI_AVR8.h" 69 | #elif (ARCH == ARCH_XMEGA) 70 | #include "XMEGA/SerialSPI_XMEGA.h" 71 | #else 72 | #error The Serial SPI Master Mode peripheral driver is not currently available for your selected architecture. 73 | #endif 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/Peripheral/TWI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Hardware Two Wire Interface (I2C) driver. 33 | * 34 | * This file is the master dispatch header file for the device-specific SPI driver, for microcontrollers 35 | * containing a hardware TWI. 36 | * 37 | * User code should include this file, which will in turn include the correct TWI driver header file for the 38 | * currently selected architecture and microcontroller model. 39 | */ 40 | 41 | /** \ingroup Group_PeripheralDrivers 42 | * \defgroup Group_TWI TWI Driver - LUFA/Drivers/Peripheral/TWI.h 43 | * \brief Hardware Two Wire Interface (I2C) driver. 44 | * 45 | * \section Sec_Dependencies Module Source Dependencies 46 | * The following files must be built with any user project that uses this module: 47 | * - LUFA/Drivers/Peripheral/ARCH/TWI_ARCH.c (Makefile source module name: LUFA_SRC_TWI) 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * Hardware TWI driver. This module provides an easy to use driver for the setup and transfer of data over 51 | * the selected architecture and microcontroller model's TWI bus port. 52 | * 53 | * \note The exact API for this driver may vary depending on the target used - see 54 | * individual target module documentation for the API specific to your target processor. 55 | */ 56 | 57 | #ifndef __TWI_H__ 58 | #define __TWI_H__ 59 | 60 | /* Macros: */ 61 | #define __INCLUDE_FROM_TWI_H 62 | 63 | /* Includes: */ 64 | #include "../../Common/Common.h" 65 | 66 | /* Includes: */ 67 | #if (ARCH == ARCH_AVR8) 68 | #include "AVR8/TWI_AVR8.h" 69 | #else 70 | #error The TWI peripheral driver is not currently available for your selected architecture. 71 | #endif 72 | 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Android Open Accessory Class driver. 33 | * 34 | * Master include file for the library USB Android Open Accessory Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassAOA Android Open Accessory Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Sec_ModDescription Module Description 48 | * Android Open Accessory Class Driver module. This module contains an internal implementation of the USB Android Open Accessory 49 | * Class, for Host USB mode. User applications can use this class driver instead of implementing the Android Open Accessory Class 50 | * manually via the low-level LUFA APIs. 51 | * 52 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 53 | * Host using the USB Android Open Accessory Class. 54 | * 55 | * @{ 56 | */ 57 | 58 | #ifndef _AOA_CLASS_H_ 59 | #define _AOA_CLASS_H_ 60 | 61 | /* Macros: */ 62 | #define __INCLUDE_FROM_USB_DRIVER 63 | #define __INCLUDE_FROM_AOA_DRIVER 64 | 65 | /* Includes: */ 66 | #include "../Core/USBMode.h" 67 | 68 | #if defined(USB_CAN_BE_HOST) 69 | #include "Host/AndroidAccessoryClassHost.h" 70 | #endif 71 | 72 | #endif 73 | 74 | /** @} */ 75 | 76 | 77 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/AudioClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Audio 1.0 Class driver. 33 | * 34 | * Master include file for the library USB Audio 1.0 Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassAudio Audio 1.0 Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/AudioClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/AudioClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Sec_ModDescription Module Description 49 | * Audio 1.0 Class Driver module. This module contains an internal implementation of the USB Audio 1.0 Class, for both 50 | * Device and Host USB modes. User applications can use this class driver instead of implementing the Audio 1.0 class 51 | * manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB Audio 1.0 Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _AUDIO_CLASS_H_ 60 | #define _AUDIO_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_AUDIO_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../Core/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/AudioClassDevice.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/AudioClassHost.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/CDCClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB CDC-ACM Class driver. 33 | * 34 | * Master include file for the library USB CDC Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassCDC CDC-ACM (Virtual Serial) Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/CDCClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/CDCClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Sec_ModDescription Module Description 49 | * CDC Class Driver module. This module contains an internal implementation of the USB CDC-ACM class Virtual Serial 50 | * Ports, for both Device and Host USB modes. User applications can use this class driver instead of implementing the 51 | * CDC class manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB CDC Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _CDC_CLASS_H_ 60 | #define _CDC_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_CDC_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../Core/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/CDCClassDevice.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/CDCClassHost.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/HIDClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB HID Class driver. 33 | * 34 | * Master include file for the library USB HID Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassHID HID Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/HIDClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/HIDClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * - LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB) 48 | * 49 | * \section Sec_ModDescription Module Description 50 | * HID Class Driver module. This module contains an internal implementation of the USB HID Class, for both Device 51 | * and Host USB modes. User applications can use this class driver instead of implementing the HID class manually 52 | * via the low-level LUFA APIs. 53 | * 54 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 55 | * Hosts or Devices using the USB HID Class. 56 | * 57 | * @{ 58 | */ 59 | 60 | #ifndef _HID_CLASS_H_ 61 | #define _HID_CLASS_H_ 62 | 63 | /* Macros: */ 64 | #define __INCLUDE_FROM_USB_DRIVER 65 | #define __INCLUDE_FROM_HID_DRIVER 66 | 67 | /* Includes: */ 68 | #include "../Core/USBMode.h" 69 | 70 | #if defined(USB_CAN_BE_DEVICE) 71 | #include "Device/HIDClassDevice.h" 72 | #endif 73 | 74 | #if defined(USB_CAN_BE_HOST) 75 | #include "Host/HIDClassHost.h" 76 | #endif 77 | 78 | #endif 79 | 80 | /** @} */ 81 | 82 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/MassStorageClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Mass Storage Class driver. 33 | * 34 | * Master include file for the library USB Mass Storage Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassMS Mass Storage Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Sec_ModDescription Module Description 49 | * Mass Storage Class Driver module. This module contains an internal implementation of the USB Mass Storage Class, for both 50 | * Device and Host USB modes. User applications can use this class driver instead of implementing the Mass Storage class 51 | * manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts or Devices using the USB Mass Storage Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _MS_CLASS_H_ 60 | #define _MS_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_MS_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../Core/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/MassStorageClassDevice.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/MassStorageClassHost.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/PrinterClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Printer Class driver. 33 | * 34 | * Master include file for the library USB Printer Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassPrinter Printer Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Host/PrinterClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Sec_ModDescription Module Description 48 | * Printer Class Driver module. This module contains an internal implementation of the USB Printer Class, for the base 49 | * USB Printer transport layer for USB Host mode only. Note that printers are free to implement whatever printer language 50 | * they choose on top of this (e.g. Postscript), and so this driver exposes low level data transport functions only rather 51 | * than high level raster or text functions. User applications can use this class driver instead of implementing the Printer 52 | * class manually via the low-level LUFA APIs. 53 | * 54 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 55 | * Devices using the USB Printer Class. 56 | * 57 | * @{ 58 | */ 59 | 60 | #ifndef _PRINTER_CLASS_H_ 61 | #define _PRINTER_CLASS_H_ 62 | 63 | /* Macros: */ 64 | #define __INCLUDE_FROM_USB_DRIVER 65 | #define __INCLUDE_FROM_PRINTER_DRIVER 66 | 67 | /* Includes: */ 68 | #include "../Core/USBMode.h" 69 | 70 | #if defined(USB_CAN_BE_HOST) 71 | #include "Host/PrinterClassHost.h" 72 | #endif 73 | 74 | #endif 75 | 76 | /** @} */ 77 | 78 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/RNDISClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB RNDIS Class driver. 33 | * 34 | * Master include file for the library USB RNDIS Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassRNDIS RNDIS (Networking) Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * - LUFA/Drivers/USB/Class/Host/RNDISClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 47 | * 48 | * \section Sec_ModDescription Module Description 49 | * RNDIS Class Driver module. This module contains an internal implementation of the Microsoft USB RNDIS Networking 50 | * Class, for both Device and Host USB modes. User applications can use this class driver instead of implementing the 51 | * RNDIS class manually via the low-level LUFA APIs. 52 | * 53 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 54 | * Hosts using the USB RNDIS Class. 55 | * 56 | * @{ 57 | */ 58 | 59 | #ifndef _RNDIS_CLASS_H_ 60 | #define _RNDIS_CLASS_H_ 61 | 62 | /* Macros: */ 63 | #define __INCLUDE_FROM_USB_DRIVER 64 | #define __INCLUDE_FROM_RNDIS_DRIVER 65 | 66 | /* Includes: */ 67 | #include "../Core/USBMode.h" 68 | 69 | #if defined(USB_CAN_BE_DEVICE) 70 | #include "Device/RNDISClassDevice.h" 71 | #endif 72 | 73 | #if defined(USB_CAN_BE_HOST) 74 | #include "Host/RNDISClassHost.h" 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Class/StillImageClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Master include file for the library USB Still Image Class driver. 33 | * 34 | * Master include file for the library USB Still Image Class driver, for both host and device modes, where available. 35 | * 36 | * This file should be included in all user projects making use of this optional class driver, instead of 37 | * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. 38 | */ 39 | 40 | /** \ingroup Group_USBClassDrivers 41 | * \defgroup Group_USBClassSI Still Image Class Driver 42 | * 43 | * \section Sec_Dependencies Module Source Dependencies 44 | * The following files must be built with any user project that uses this module: 45 | * - LUFA/Drivers/USB/Class/Host/StillImageClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS) 46 | * 47 | * \section Sec_ModDescription Module Description 48 | * Still Image Class Driver module. This module contains an internal implementation of the USB Still Image Class, 49 | * for USB Host mode only. User applications can use this class driver instead of implementing the Still Image class 50 | * manually via the low-level LUFA APIs. 51 | * 52 | * This module is designed to simplify the user code by exposing only the required interface needed to interface with 53 | * Devices using the USB Still Image Class. 54 | * 55 | * @{ 56 | */ 57 | 58 | #ifndef _SI_CLASS_H_ 59 | #define _SI_CLASS_H_ 60 | 61 | /* Macros: */ 62 | #define __INCLUDE_FROM_USB_DRIVER 63 | #define __INCLUDE_FROM_SI_DRIVER 64 | 65 | /* Includes: */ 66 | #include "../Core/USBMode.h" 67 | 68 | #if defined(USB_CAN_BE_HOST) 69 | #include "Host/StillImageClassHost.h" 70 | #endif 71 | 72 | #endif 73 | 74 | /** @} */ 75 | 76 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_DEVICE) 35 | 36 | #include "../Device.h" 37 | 38 | void USB_Device_SendRemoteWakeup(void) 39 | { 40 | if (!(USB_Options & USB_OPT_MANUAL_PLL)) 41 | { 42 | USB_PLL_On(); 43 | while (!(USB_PLL_IsReady())); 44 | } 45 | 46 | USB_CLK_Unfreeze(); 47 | 48 | UDCON |= (1 << RMWKUP); 49 | while (UDCON & (1 << RMWKUP)); 50 | } 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | 38 | if (!(Length)) 39 | Endpoint_ClearOUT(); 40 | 41 | while (Length) 42 | { 43 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 44 | 45 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 46 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 47 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 48 | return ENDPOINT_RWCSTREAM_BusSuspended; 49 | else if (Endpoint_IsSETUPReceived()) 50 | return ENDPOINT_RWCSTREAM_HostAborted; 51 | 52 | if (Endpoint_IsOUTReceived()) 53 | { 54 | while (Length && Endpoint_BytesInEndpoint()) 55 | { 56 | TEMPLATE_TRANSFER_BYTE(DataStream); 57 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 58 | Length--; 59 | } 60 | 61 | Endpoint_ClearOUT(); 62 | } 63 | } 64 | 65 | while (!(Endpoint_IsINReady())) 66 | { 67 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 68 | 69 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 70 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 71 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 72 | return ENDPOINT_RWCSTREAM_BusSuspended; 73 | } 74 | 75 | return ENDPOINT_RWCSTREAM_NoError; 76 | } 77 | 78 | #undef TEMPLATE_BUFFER_OFFSET 79 | #undef TEMPLATE_BUFFER_MOVE 80 | #undef TEMPLATE_FUNC_NAME 81 | #undef TEMPLATE_TRANSFER_BYTE 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | bool LastPacketFull = false; 38 | 39 | if (Length > USB_ControlRequest.wLength) 40 | Length = USB_ControlRequest.wLength; 41 | else if (!(Length)) 42 | Endpoint_ClearIN(); 43 | 44 | while (Length || LastPacketFull) 45 | { 46 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 47 | 48 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 49 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 50 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 51 | return ENDPOINT_RWCSTREAM_BusSuspended; 52 | else if (Endpoint_IsSETUPReceived()) 53 | return ENDPOINT_RWCSTREAM_HostAborted; 54 | else if (Endpoint_IsOUTReceived()) 55 | break; 56 | 57 | if (Endpoint_IsINReady()) 58 | { 59 | uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); 60 | 61 | while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) 62 | { 63 | TEMPLATE_TRANSFER_BYTE(DataStream); 64 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 65 | Length--; 66 | BytesInEndpoint++; 67 | } 68 | 69 | LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); 70 | Endpoint_ClearIN(); 71 | } 72 | } 73 | 74 | while (!(Endpoint_IsOUTReceived())) 75 | { 76 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 77 | 78 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 79 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 80 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 81 | return ENDPOINT_RWCSTREAM_BusSuspended; 82 | } 83 | 84 | return ENDPOINT_RWCSTREAM_NoError; 85 | } 86 | 87 | #undef TEMPLATE_BUFFER_OFFSET 88 | #undef TEMPLATE_BUFFER_MOVE 89 | #undef TEMPLATE_FUNC_NAME 90 | #undef TEMPLATE_TRANSFER_BYTE 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | Pipe_SetPipeToken(TEMPLATE_TOKEN); 42 | 43 | if ((ErrorCode = Pipe_WaitUntilReady())) 44 | return ErrorCode; 45 | 46 | if (BytesProcessed != NULL) 47 | { 48 | Length -= *BytesProcessed; 49 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 50 | } 51 | 52 | while (Length) 53 | { 54 | if (!(Pipe_IsReadWriteAllowed())) 55 | { 56 | TEMPLATE_CLEAR_PIPE(); 57 | 58 | if (BytesProcessed != NULL) 59 | { 60 | *BytesProcessed += BytesInTransfer; 61 | return PIPE_RWSTREAM_IncompleteTransfer; 62 | } 63 | 64 | if ((ErrorCode = Pipe_WaitUntilReady())) 65 | return ErrorCode; 66 | } 67 | else 68 | { 69 | TEMPLATE_TRANSFER_BYTE(DataStream); 70 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 71 | Length--; 72 | BytesInTransfer++; 73 | } 74 | } 75 | 76 | return PIPE_RWSTREAM_NoError; 77 | } 78 | 79 | #undef TEMPLATE_FUNC_NAME 80 | #undef TEMPLATE_BUFFER_TYPE 81 | #undef TEMPLATE_TOKEN 82 | #undef TEMPLATE_TRANSFER_BYTE 83 | #undef TEMPLATE_CLEAR_PIPE 84 | #undef TEMPLATE_BUFFER_OFFSET 85 | #undef TEMPLATE_BUFFER_MOVE 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/Events.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_EVENTS_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "Events.h" 34 | 35 | void USB_Event_Stub(void) 36 | { 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/OTG.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Common USB OTG definitions for all architectures. 33 | * \copydetails Group_OTG 34 | * 35 | * \note This file should not be included directly. It is automatically included as needed by the USB driver 36 | * dispatch header located in LUFA/Drivers/USB/USB.h. 37 | */ 38 | 39 | /** \ingroup Group_USB 40 | * \defgroup Group_OTG USB On The Go (OTG) Management 41 | * \brief USB OTG management definitions. 42 | * 43 | * This module contains macros for embedded USB hosts with dual role On The Go capabilities, for managing role 44 | * exchange. OTG is a way for two USB dual role devices to talk to one another directly without fixed device/host 45 | * roles. 46 | * 47 | * @{ 48 | */ 49 | 50 | #ifndef __USBOTG_H__ 51 | #define __USBOTG_H__ 52 | 53 | /* Includes: */ 54 | #include "../../../Common/Common.h" 55 | #include "USBMode.h" 56 | 57 | /* Enable C linkage for C++ Compilers: */ 58 | #if defined(__cplusplus) 59 | extern "C" { 60 | #endif 61 | 62 | /* Preprocessor Checks: */ 63 | #if !defined(__INCLUDE_FROM_USB_DRIVER) 64 | #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 65 | #endif 66 | 67 | /* Architecture Includes: */ 68 | #if (ARCH == ARCH_AVR8) 69 | #include "AVR8/OTG_AVR8.h" 70 | #endif 71 | 72 | /* Disable C linkage for C++ Compilers: */ 73 | #if defined(__cplusplus) 74 | } 75 | #endif 76 | 77 | #endif 78 | 79 | /** @} */ 80 | 81 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/UC3/Device_UC3.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_DEVICE) 35 | 36 | #include "../Device.h" 37 | 38 | void USB_Device_SendRemoteWakeup(void) 39 | { 40 | USB_CLK_Unfreeze(); 41 | 42 | AVR32_USBB.UDCON.rmwkup = true; 43 | while (AVR32_USBB.UDCON.rmwkup); 44 | } 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | 38 | if (!(Length)) 39 | Endpoint_ClearOUT(); 40 | 41 | while (Length) 42 | { 43 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 44 | 45 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 46 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 47 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 48 | return ENDPOINT_RWCSTREAM_BusSuspended; 49 | else if (Endpoint_IsSETUPReceived()) 50 | return ENDPOINT_RWCSTREAM_HostAborted; 51 | 52 | if (Endpoint_IsOUTReceived()) 53 | { 54 | while (Length && Endpoint_BytesInEndpoint()) 55 | { 56 | TEMPLATE_TRANSFER_BYTE(DataStream); 57 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 58 | Length--; 59 | } 60 | 61 | Endpoint_ClearOUT(); 62 | } 63 | } 64 | 65 | while (!(Endpoint_IsINReady())) 66 | { 67 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 68 | 69 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 70 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 71 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 72 | return ENDPOINT_RWCSTREAM_BusSuspended; 73 | } 74 | 75 | return ENDPOINT_RWCSTREAM_NoError; 76 | } 77 | 78 | #undef TEMPLATE_BUFFER_OFFSET 79 | #undef TEMPLATE_BUFFER_MOVE 80 | #undef TEMPLATE_FUNC_NAME 81 | #undef TEMPLATE_TRANSFER_BYTE 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | bool LastPacketFull = false; 38 | 39 | if (Length > USB_ControlRequest.wLength) 40 | Length = USB_ControlRequest.wLength; 41 | else if (!(Length)) 42 | Endpoint_ClearIN(); 43 | 44 | while (Length || LastPacketFull) 45 | { 46 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 47 | 48 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 49 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 50 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 51 | return ENDPOINT_RWCSTREAM_BusSuspended; 52 | else if (Endpoint_IsSETUPReceived()) 53 | return ENDPOINT_RWCSTREAM_HostAborted; 54 | else if (Endpoint_IsOUTReceived()) 55 | break; 56 | 57 | if (Endpoint_IsINReady()) 58 | { 59 | uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); 60 | 61 | while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) 62 | { 63 | TEMPLATE_TRANSFER_BYTE(DataStream); 64 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 65 | Length--; 66 | BytesInEndpoint++; 67 | } 68 | 69 | LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); 70 | Endpoint_ClearIN(); 71 | } 72 | } 73 | 74 | while (!(Endpoint_IsOUTReceived())) 75 | { 76 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 77 | 78 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 79 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 80 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 81 | return ENDPOINT_RWCSTREAM_BusSuspended; 82 | } 83 | 84 | return ENDPOINT_RWCSTREAM_NoError; 85 | } 86 | 87 | #undef TEMPLATE_BUFFER_OFFSET 88 | #undef TEMPLATE_BUFFER_MOVE 89 | #undef TEMPLATE_FUNC_NAME 90 | #undef TEMPLATE_TRANSFER_BYTE 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | Pipe_SetPipeToken(TEMPLATE_TOKEN); 42 | 43 | if ((ErrorCode = Pipe_WaitUntilReady())) 44 | return ErrorCode; 45 | 46 | if (BytesProcessed != NULL) 47 | { 48 | Length -= *BytesProcessed; 49 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 50 | } 51 | 52 | while (Length) 53 | { 54 | if (!(Pipe_IsReadWriteAllowed())) 55 | { 56 | TEMPLATE_CLEAR_PIPE(); 57 | 58 | if (BytesProcessed != NULL) 59 | { 60 | *BytesProcessed += BytesInTransfer; 61 | return PIPE_RWSTREAM_IncompleteTransfer; 62 | } 63 | 64 | if ((ErrorCode = Pipe_WaitUntilReady())) 65 | return ErrorCode; 66 | } 67 | else 68 | { 69 | TEMPLATE_TRANSFER_BYTE(DataStream); 70 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 71 | Length--; 72 | BytesInTransfer++; 73 | } 74 | } 75 | 76 | return PIPE_RWSTREAM_NoError; 77 | } 78 | 79 | #undef TEMPLATE_FUNC_NAME 80 | #undef TEMPLATE_BUFFER_TYPE 81 | #undef TEMPLATE_TOKEN 82 | #undef TEMPLATE_TRANSFER_BYTE 83 | #undef TEMPLATE_CLEAR_PIPE 84 | #undef TEMPLATE_BUFFER_OFFSET 85 | #undef TEMPLATE_BUFFER_MOVE 86 | 87 | #endif 88 | 89 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/USBInterrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief USB controller interrupt service routine management. 33 | * 34 | * This file contains definitions required for the correct handling of low level USB service routine interrupts 35 | * from the USB controller. 36 | * 37 | * \note This file should not be included directly. It is automatically included as needed by the USB driver 38 | * dispatch header located in LUFA/Drivers/USB/USB.h. 39 | */ 40 | 41 | #ifndef __USBINTERRUPT_H__ 42 | #define __USBINTERRUPT_H__ 43 | 44 | /* Includes: */ 45 | #include "../../../Common/Common.h" 46 | #include "USBMode.h" 47 | 48 | /* Enable C linkage for C++ Compilers: */ 49 | #if defined(__cplusplus) 50 | extern "C" { 51 | #endif 52 | 53 | /* Preprocessor Checks: */ 54 | #if !defined(__INCLUDE_FROM_USB_DRIVER) 55 | #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 56 | #endif 57 | 58 | /* Architecture Includes: */ 59 | #if (ARCH == ARCH_AVR8) 60 | #include "AVR8/USBInterrupt_AVR8.h" 61 | #elif (ARCH == ARCH_UC3) 62 | #include "UC3/USBInterrupt_UC3.h" 63 | #elif (ARCH == ARCH_XMEGA) 64 | #include "XMEGA/USBInterrupt_XMEGA.h" 65 | #endif 66 | 67 | /* Disable C linkage for C++ Compilers: */ 68 | #if defined(__cplusplus) 69 | } 70 | #endif 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/USBTask.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USBTASK_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "USBTask.h" 34 | 35 | volatile bool USB_IsInitialized; 36 | USB_Request_Header_t USB_ControlRequest; 37 | 38 | #if defined(USB_CAN_BE_HOST) && !defined(HOST_STATE_AS_GPIOR) 39 | volatile uint8_t USB_HostState; 40 | #endif 41 | 42 | #if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) 43 | volatile uint8_t USB_DeviceState; 44 | #endif 45 | 46 | void USB_USBTask(void) 47 | { 48 | #if defined(USB_HOST_ONLY) 49 | USB_HostTask(); 50 | #elif defined(USB_DEVICE_ONLY) 51 | USB_DeviceTask(); 52 | #else 53 | if (USB_CurrentMode == USB_MODE_Device) 54 | USB_DeviceTask(); 55 | #if defined(USB_CAN_BE_HOST) 56 | else if (USB_CurrentMode == USB_MODE_Host) 57 | USB_HostTask(); 58 | #endif 59 | #endif 60 | } 61 | 62 | #if defined(USB_CAN_BE_DEVICE) 63 | static void USB_DeviceTask(void) 64 | { 65 | if (USB_DeviceState != DEVICE_STATE_Unattached) 66 | { 67 | uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); 68 | 69 | Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); 70 | 71 | if (Endpoint_IsSETUPReceived()) 72 | USB_Device_ProcessControlRequest(); 73 | 74 | Endpoint_SelectEndpoint(PrevEndpoint); 75 | } 76 | } 77 | #endif 78 | 79 | #if defined(USB_CAN_BE_HOST) 80 | static void USB_HostTask(void) 81 | { 82 | uint8_t PrevPipe = Pipe_GetCurrentPipe(); 83 | 84 | Pipe_SelectPipe(PIPE_CONTROLPIPE); 85 | 86 | USB_Host_ProcessNextHostState(); 87 | 88 | Pipe_SelectPipe(PrevPipe); 89 | } 90 | #endif 91 | 92 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_DEVICE) 35 | 36 | #include "../Device.h" 37 | 38 | void USB_Device_SendRemoteWakeup(void) 39 | { 40 | USB.CTRLB |= USB_RWAKEUP_bm; 41 | } 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_HOST) 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_HOST) 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_HOST) 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | 38 | Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); 39 | 40 | if (!(Length)) 41 | Endpoint_ClearOUT(); 42 | 43 | while (Length) 44 | { 45 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 46 | 47 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 48 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 49 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 50 | return ENDPOINT_RWCSTREAM_BusSuspended; 51 | else if (Endpoint_IsSETUPReceived()) 52 | return ENDPOINT_RWCSTREAM_HostAborted; 53 | 54 | if (Endpoint_IsOUTReceived()) 55 | { 56 | while (Length && Endpoint_BytesInEndpoint()) 57 | { 58 | TEMPLATE_TRANSFER_BYTE(DataStream); 59 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 60 | Length--; 61 | } 62 | 63 | Endpoint_ClearOUT(); 64 | } 65 | } 66 | 67 | while (!(Endpoint_IsINReady())) 68 | { 69 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 70 | 71 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 72 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 73 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 74 | return ENDPOINT_RWCSTREAM_BusSuspended; 75 | } 76 | 77 | return ENDPOINT_RWCSTREAM_NoError; 78 | } 79 | 80 | #undef TEMPLATE_BUFFER_OFFSET 81 | #undef TEMPLATE_BUFFER_MOVE 82 | #undef TEMPLATE_FUNC_NAME 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, 34 | uint16_t Length) 35 | { 36 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 37 | bool LastPacketFull = false; 38 | 39 | Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); 40 | 41 | if (Length > USB_ControlRequest.wLength) 42 | Length = USB_ControlRequest.wLength; 43 | else if (!(Length)) 44 | Endpoint_ClearIN(); 45 | 46 | while (Length || LastPacketFull) 47 | { 48 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 49 | 50 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 51 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 52 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 53 | return ENDPOINT_RWCSTREAM_BusSuspended; 54 | else if (Endpoint_IsSETUPReceived()) 55 | return ENDPOINT_RWCSTREAM_HostAborted; 56 | else if (Endpoint_IsOUTReceived()) 57 | break; 58 | 59 | if (Endpoint_IsINReady()) 60 | { 61 | uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); 62 | 63 | while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) 64 | { 65 | TEMPLATE_TRANSFER_BYTE(DataStream); 66 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 67 | Length--; 68 | BytesInEndpoint++; 69 | } 70 | 71 | LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); 72 | Endpoint_ClearIN(); 73 | } 74 | } 75 | 76 | while (!(Endpoint_IsOUTReceived())) 77 | { 78 | uint8_t USB_DeviceState_LCL = USB_DeviceState; 79 | 80 | if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) 81 | return ENDPOINT_RWCSTREAM_DeviceDisconnected; 82 | else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) 83 | return ENDPOINT_RWCSTREAM_BusSuspended; 84 | } 85 | 86 | return ENDPOINT_RWCSTREAM_NoError; 87 | } 88 | 89 | #undef TEMPLATE_BUFFER_OFFSET 90 | #undef TEMPLATE_BUFFER_MOVE 91 | #undef TEMPLATE_FUNC_NAME 92 | #undef TEMPLATE_TRANSFER_BYTE 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #if defined(TEMPLATE_FUNC_NAME) 32 | 33 | uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer, 34 | uint16_t Length, 35 | uint16_t* const BytesProcessed) 36 | { 37 | uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); 38 | uint16_t BytesInTransfer = 0; 39 | uint8_t ErrorCode; 40 | 41 | if ((ErrorCode = Endpoint_WaitUntilReady())) 42 | return ErrorCode; 43 | 44 | if (BytesProcessed != NULL) 45 | { 46 | Length -= *BytesProcessed; 47 | TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed); 48 | } 49 | 50 | while (Length) 51 | { 52 | if (!(Endpoint_IsReadWriteAllowed())) 53 | { 54 | TEMPLATE_CLEAR_ENDPOINT(); 55 | 56 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) 57 | USB_USBTask(); 58 | #endif 59 | 60 | if (BytesProcessed != NULL) 61 | { 62 | *BytesProcessed += BytesInTransfer; 63 | return ENDPOINT_RWSTREAM_IncompleteTransfer; 64 | } 65 | 66 | if ((ErrorCode = Endpoint_WaitUntilReady())) 67 | return ErrorCode; 68 | } 69 | else 70 | { 71 | TEMPLATE_TRANSFER_BYTE(DataStream); 72 | TEMPLATE_BUFFER_MOVE(DataStream, 1); 73 | Length--; 74 | BytesInTransfer++; 75 | } 76 | } 77 | 78 | return ENDPOINT_RWSTREAM_NoError; 79 | } 80 | 81 | #undef TEMPLATE_FUNC_NAME 82 | #undef TEMPLATE_BUFFER_TYPE 83 | #undef TEMPLATE_TRANSFER_BYTE 84 | #undef TEMPLATE_CLEAR_ENDPOINT 85 | #undef TEMPLATE_BUFFER_OFFSET 86 | #undef TEMPLATE_BUFFER_MOVE 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/License.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and distribute this software 2 | and its documentation for any purpose is hereby granted without 3 | fee, provided that the above copyright notice appear in all 4 | copies and that both that the copyright notice and this 5 | permission notice and warranty disclaimer appear in supporting 6 | documentation, and that the name of the author not be used in 7 | advertising or publicity pertaining to distribution of the 8 | software without specific, written prior permission. 9 | 10 | The author disclaim all warranties with regard to this 11 | software, including all implied warranties of merchantability 12 | and fitness. In no event shall the author be liable for any 13 | special, indirect or consequential damages or any damages 14 | whatsoever resulting from loss of use, data or profits, whether 15 | in an action of contract, negligence or other tortious action, 16 | arising out of or in connection with the use or performance of 17 | this software. 18 | 19 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Platform/UC3/InterruptManagement.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_INTMANAGEMENT_C 32 | #include "InterruptManagement.h" 33 | 34 | /** Interrupt vector table, containing the ISR to call for each interrupt group */ 35 | InterruptHandlerPtr_t InterruptHandlers[AVR32_INTC_NUM_INT_GRPS]; 36 | 37 | /** ISR for unhandled interrupt groups */ 38 | ISR(Unhandled_Interrupt) 39 | { 40 | for (;;); 41 | } 42 | 43 | /** Retrieves the associated interrupt handler for the interrupt group currently being fired. This 44 | * is called directly from the exception handler routine before dispatching to the ISR. 45 | */ 46 | InterruptHandlerPtr_t INTC_GetInterruptHandler(const uint_reg_t InterruptLevel) 47 | { 48 | return InterruptHandlers[AVR32_INTC.icr[AVR32_INTC_INT3 - InterruptLevel]]; 49 | } 50 | 51 | /** Initializes the interrupt controller ready to handle interrupts. This must be called at the 52 | * start of the user program before any interrupts are registered or enabled. 53 | */ 54 | void INTC_Init(void) 55 | { 56 | for (uint8_t InterruptGroup = 0; InterruptGroup < AVR32_INTC_NUM_INT_GRPS; InterruptGroup++) 57 | { 58 | InterruptHandlers[InterruptGroup] = Unhandled_Interrupt; 59 | AVR32_INTC.ipr[InterruptGroup] = Autovector_Table[AVR32_INTC_INT0]; 60 | } 61 | 62 | __builtin_mtsr(AVR32_EVBA, (uintptr_t)&EVBA_Table); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Scheduler/Scheduler.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "Scheduler.h" 32 | 33 | volatile SchedulerDelayCounter_t Scheduler_TickCounter; 34 | volatile uint_least8_t Scheduler_TotalTasks; 35 | 36 | bool Scheduler_HasDelayElapsed(const uint_least16_t Delay, 37 | SchedulerDelayCounter_t* const DelayCounter) 38 | { 39 | SchedulerDelayCounter_t CurrentTickValue_LCL; 40 | SchedulerDelayCounter_t DelayCounter_LCL; 41 | 42 | uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); 43 | GlobalInterruptDisable(); 44 | 45 | CurrentTickValue_LCL = Scheduler_TickCounter; 46 | 47 | SetGlobalInterruptMask(CurrentGlobalInt); 48 | 49 | DelayCounter_LCL = *DelayCounter; 50 | 51 | if (CurrentTickValue_LCL >= DelayCounter_LCL) 52 | { 53 | if ((CurrentTickValue_LCL - DelayCounter_LCL) >= Delay) 54 | { 55 | *DelayCounter = CurrentTickValue_LCL; 56 | return true; 57 | } 58 | } 59 | else 60 | { 61 | if (((MAX_DELAYCTR_COUNT - DelayCounter_LCL) + CurrentTickValue_LCL) >= Delay) 62 | { 63 | *DelayCounter = CurrentTickValue_LCL; 64 | return true; 65 | } 66 | } 67 | 68 | return false; 69 | } 70 | 71 | void Scheduler_SetTaskMode(const TaskPtr_t Task, 72 | const bool TaskStatus) 73 | { 74 | TaskEntry_t* CurrTask = &Scheduler_TaskList[0]; 75 | 76 | while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks]) 77 | { 78 | if (CurrTask->Task == Task) 79 | { 80 | CurrTask->TaskStatus = TaskStatus; 81 | break; 82 | } 83 | 84 | CurrTask++; 85 | } 86 | } 87 | 88 | void Scheduler_SetGroupTaskMode(const uint_least8_t GroupID, 89 | const bool TaskStatus) 90 | { 91 | TaskEntry_t* CurrTask = &Scheduler_TaskList[0]; 92 | 93 | while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks]) 94 | { 95 | if (CurrTask->GroupID == GroupID) 96 | CurrTask->TaskStatus = TaskStatus; 97 | 98 | CurrTask++; 99 | } 100 | } 101 | 102 | -------------------------------------------------------------------------------- /LUFA-120219/LUFA/Version.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2012. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * \brief LUFA library version constants. 34 | * 35 | * Version constants for informational purposes and version-specific macro creation. This header file contains the 36 | * current LUFA version number in several forms, for use in the user-application (for example, for printing out 37 | * whilst debugging, or for testing for version compatibility). 38 | */ 39 | 40 | #ifndef __LUFA_VERSION_H__ 41 | #define __LUFA_VERSION_H__ 42 | 43 | /* Public Interface - May be used in end-application: */ 44 | /* Macros: */ 45 | /** Indicates the version number of the library, as an integer. */ 46 | #define LUFA_VERSION_INTEGER 0x120219 47 | 48 | /** Indicates the version number of the library, as a string. */ 49 | #define LUFA_VERSION_STRING "120219" 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /LUFA-120219/README.txt: -------------------------------------------------------------------------------- 1 | 2 | _ _ _ ___ _ 3 | | | | | | __/ \ 4 | | |_| U | _| o | - The Lightweight USB 5 | |___|___|_||_n_| Framework for AVRs 6 | ========================================= 7 | Written by Dean Camera 8 | dean [at] fourwalledcubicle [dot] com 9 | 10 | http://www.lufa-lib.org 11 | ========================================= 12 | 13 | LUFA is donation supported. To support LUFA, 14 | please donate at http://www.lufa-lib.org/donate 15 | 16 | For Commercial Licensing information, see 17 | http://www.lufa-lib.org/license 18 | 19 | 20 | This package contains the complete LUFA library, demos, user-submitted 21 | projects and bootloaders for use with compatible microcontroller models. 22 | LUFA is a simple to use, lightweight framework which sits atop the hardware 23 | USB controller in specific AVR microcontroller models, and allows for the 24 | quick and easy creation of complex USB devices and hosts. 25 | 26 | To get started, you will need to install the "Doxygen" documentation 27 | generation tool. If you use Linux, this can be installed via the "doxygen" 28 | package in your chosen package management tool - under Ubuntu, this can be 29 | achieved by running the following command in the terminal: 30 | 31 | sudo apt-get install doxygen 32 | 33 | Other package managers and distributions will have similar methods to 34 | install Doxygen. In Windows, you can download a prebuilt installer for 35 | Doxygen from its website, www.doxygen.org. 36 | 37 | Once installed, you can then use the Doxygen tool to generate the library 38 | documentation from the command line or terminal of your operating system. To 39 | do this, open your terminal or command line to the root directory of the 40 | LUFA package, and type the following command: 41 | 42 | make doxygen 43 | 44 | Which will recursively generate documentation for all elements in the 45 | library - the core, plus all demos, projects and bootloaders. Generated 46 | documentation will then be available by opening the file "index.html" of the 47 | created Documentation/html/ subdirectories inside each project folder. 48 | 49 | The documentation for the library itself (but not the documentation for the 50 | individual demos, projects or bootloaders) is also available as a separate 51 | package from the project webpage for convenience if Doxygen cannot be 52 | installed. 53 | 54 | -------------------------------------------------------------------------------- /LUFA-120219/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2011. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | # Makefile to build the LUFA library, projects and demos. 10 | 11 | # Call with "make all" to rebuild everything, "make clean" to clean everything, 12 | # "make clean_list" to remove all intermediatary files but preserve any binaries, 13 | # "make doxygen" to document everything with Doxygen (if installed) and 14 | # "make clean_doxygen" to remove generated Doxygen documentation from everything. 15 | 16 | all: 17 | %: 18 | @echo Executing \"make $@\" on all LUFA library elements. 19 | @echo 20 | $(MAKE) -C LUFA $@ -s 21 | $(MAKE) -C Demos $@ -s 22 | $(MAKE) -C Projects $@ -s 23 | $(MAKE) -C Bootloaders $@ -s 24 | @echo 25 | @echo LUFA \"make $@\" operation complete. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is Adapt-FFB-Joy # 2 | 3 | Adapt-FFB-Joy is an AVR microcontroller based device that looks like a joystick with advanced force feedback features in a Windows machine without need for installing any device drivers to PC. 4 | 5 | This project contains the software for the AVR microcontroller as well as basic instructions for [building the hardware](https://github.com/tloimu/adapt-ffb-joy/blob/wiki/HowToBuild.md). 6 | 7 | Currently, it allows connecting a Microsoft Sidewinder Force Feedback Pro (FFP) joystick (with a game port connector) to various MS Windows versions as a standard **USB joystick with force feedback** and **no need to install any device drivers**. The adapter also allows to solder a few additional trim pots to work e.g. as elevator trims, aileron trims and rudder pedals in your favorite simulator game. 8 | 9 | For more information, see [Adapt-ffb-joy Wiki] (https://github.com/tloimu/adapt-ffb-joy/blob/wiki/README.md) 10 | 11 | The firmware software project is configured to compile for ATmega32U4 with WinAVR-20100110 or newer version. 12 | -------------------------------------------------------------------------------- /debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | Force Feedback Joystick 3 | Basic debugging utilities. 4 | 5 | This code is for Microsoft Sidewinder Force Feedback Pro joystick 6 | with some room for additional extra controls. 7 | 8 | Copyright 2012 Tero Loimuneva (tloimu [at] gmail [dot] com) 9 | MIT License. 10 | 11 | Permission to use, copy, modify, distribute, and sell this 12 | software and its documentation for any purpose is hereby granted 13 | without fee, provided that the above copyright notice appear in 14 | all copies and that both that the copyright notice and this 15 | permission notice and warranty disclaimer appear in supporting 16 | documentation, and that the name of the author not be used in 17 | advertising or publicity pertaining to distribution of the 18 | software without specific, written prior permission. 19 | 20 | The author disclaim all warranties with regard to this 21 | software, including all implied warranties of merchantability 22 | and fitness. In no event shall the author be liable for any 23 | special, indirect or consequential damages or any damages 24 | whatsoever resulting from loss of use, data or profits, whether 25 | in an action of contract, negligence or other tortious action, 26 | arising out of or in connection with the use or performance of 27 | this software. 28 | */ 29 | 30 | #ifndef _DEBUG_H_ 31 | #define _DEBUG_H_ 32 | 33 | #include "main.h" 34 | 35 | // Method of debugging 36 | extern const uint8_t DEBUG_TO_NONE; 37 | extern const uint8_t DEBUG_TO_UART; 38 | extern const uint8_t DEBUG_TO_USB; 39 | extern const uint8_t DEBUG_DETAIL; 40 | 41 | extern volatile uint8_t gDebugMode; 42 | 43 | // Returns true if debug settings contain all of the given attributes 44 | // (see above constants DEBUG_xxx). 45 | bool DoDebug(const uint8_t type); 46 | 47 | // If below are defined, code for respective debug target is included into build 48 | //#define DEBUG_ENABLE_UART 49 | //#define DEBUG_ENABLE_USB 50 | 51 | #define DEBUG_BUFFER_SIZE 512 52 | 53 | // Debugging utilities 54 | 55 | // The basic debug data sending method used by all other methods. 56 | // Implement this to send debug data to desired destination. 57 | void LogSendByte(uint8_t data); 58 | 59 | // Send out the given null terminated text 60 | void LogText(const char *text); 61 | void LogTextLf(const char *text); // Adds linefeed 62 | void LogTextP(const char *text); // From program memory 63 | void LogTextLfP(const char *text); // From program memory, adds linefeed 64 | 65 | // Send out the given binary data 66 | void LogBinary(const void *data, uint16_t len); 67 | void LogBinaryLf(const void *data, uint16_t len); // Adds linefeed 68 | 69 | // Send out data with a prefix of text and an integer 70 | void LogData(const char *text, uint8_t reportId, const void *data, uint16_t len); 71 | void LogDataLf(const char *text, uint8_t reportId, const void *data, uint16_t len); // Adds linefeed 72 | 73 | // Log all reports found in the given data (may have one or more) 74 | // The must point to string in program memory. 75 | void LogReport(const char *text, const uint16_t *reportSizeArray, uint8_t *data, uint16_t len); 76 | 77 | // Debugging utils for USB-serial debugging 78 | void FlushDebugBuffer(void); 79 | 80 | #endif // _DEBUG_H_ 81 | -------------------------------------------------------------------------------- /downloads/adaptffbjoy-breadboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/downloads/adaptffbjoy-breadboard.jpg -------------------------------------------------------------------------------- /downloads/adaptffbjoy-circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/downloads/adaptffbjoy-circuit.png -------------------------------------------------------------------------------- /ffb-pro.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FFB_PRO_ 3 | #define _FFB_PRO_ 4 | 5 | #include 6 | #include "ffb.h" 7 | 8 | // ---------------------------------- 9 | // Microsoft Sidewinder Force Feedback Pro FFB structures 10 | 11 | typedef struct 12 | { 13 | uint8_t command; // always 0x23 -- start counting checksum from here 14 | uint8_t waveForm; // 2=sine, 5=Square, 6=RampUp, 7=RampDown, 8=Triange, 0x12=Constant 15 | uint8_t unknown1; // ? always 0x7F 16 | uint16_t duration; // unit=2ms 17 | uint16_t unknown2; // ? always 0x0000 18 | uint16_t direction; 19 | uint8_t unknown3[5]; // ? always 7f 64 00 10 4e 20 | uint8_t attackLevel; 21 | uint16_t attackTime; 22 | uint8_t magnitude; 23 | uint16_t fadeTime; 24 | uint8_t fadeLevel; 25 | uint8_t waveLength; // 0x6F..0x01 => 1/Hz 26 | uint8_t unknown5; // ? always 0x00 27 | uint16_t param1; // Varies by effect type; Constant: positive=7f 00, negative=01 01, Other effects: 01 01 28 | uint16_t param2; // Varies by effect type; Constant: 00 00, Other effects 01 01 29 | } FFP_MIDI_Effect_Basic; 30 | 31 | typedef struct 32 | { 33 | uint8_t command; // always 0x23 -- start counting checksum from here 34 | uint8_t waveForm; // 0xd=Spring, 0x0e=Damper, 0xf=Inertia 35 | uint8_t unknown1; // ? always 0x7F 36 | uint16_t duration; // unit=2ms 37 | uint16_t unknown2; // ? always 0x0000 38 | uint16_t coeffAxis0; 39 | uint16_t coeffAxis1; 40 | uint16_t offsetAxis0; 41 | uint16_t offsetAxis1; 42 | } FFP_MIDI_Effect_Spring_Inertia_Damper; 43 | 44 | typedef struct 45 | { 46 | uint8_t command; // always 0x23 -- start counting checksum from here 47 | uint8_t waveForm; // 0x10=Friction 48 | uint8_t unknown1; // ? always 0x7F 49 | uint16_t duration; // unit=2ms 50 | uint16_t unknown2; // ? always 0x0000 51 | uint16_t coeffAxis0; 52 | uint16_t coeffAxis1; 53 | } FFP_MIDI_Effect_Friction; 54 | 55 | void FfbproEnableInterrupts(void); 56 | const uint8_t* FfbproGetSysExHeader(uint8_t* hdr_len); 57 | void FfbproSetAutoCenter(uint8_t enable); 58 | 59 | void FfbproStartEffect(uint8_t id); 60 | void FfbproStopEffect(uint8_t id); 61 | void FfbproFreeEffect(uint8_t id); 62 | 63 | void FfbproModifyDuration(uint8_t effectId, uint16_t duration); 64 | 65 | void FfbproSetEnvelope(USB_FFBReport_SetEnvelope_Output_Data_t* data, volatile TEffectState* effect); 66 | void FfbproSetCondition(USB_FFBReport_SetCondition_Output_Data_t* data, volatile TEffectState* effect); 67 | void FfbproSetPeriodic(USB_FFBReport_SetPeriodic_Output_Data_t* data, volatile TEffectState* effect); 68 | void FfbproSetConstantForce(USB_FFBReport_SetConstantForce_Output_Data_t* data, volatile TEffectState* effect); 69 | void FfbproSetRampForce(USB_FFBReport_SetRampForce_Output_Data_t* data, volatile TEffectState* effect); 70 | int FfbproSetEffect(USB_FFBReport_SetEffect_Output_Data_t *data, volatile TEffectState* effect); 71 | void FfbproCreateNewEffect(USB_FFBReport_CreateNewEffect_Feature_Data_t* inData, volatile TEffectState* effect); 72 | 73 | uint8_t FfbproUsbToMidiEffectType(uint8_t usb_effect_type); 74 | 75 | #endif // _FFB_PRO_ -------------------------------------------------------------------------------- /joystick.aws: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /main.h: -------------------------------------------------------------------------------- 1 | /* 2 | Force Feedback Joystick 3 | Generic main file for force feedback joysticks. 4 | 5 | Copyright 2012 Tero Loimuneva (tloimu [at] gmail [dot] com) 6 | MIT License 7 | 8 | This file is based on LUFA Libarary for which 9 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) 10 | 11 | Permission to use, copy, modify, distribute, and sell this 12 | software and its documentation for any purpose is hereby granted 13 | without fee, provided that the above copyright notice appear in 14 | all copies and that both that the copyright notice and this 15 | permission notice and warranty disclaimer appear in supporting 16 | documentation, and that the name of the author not be used in 17 | advertising or publicity pertaining to distribution of the 18 | software without specific, written prior permission. 19 | 20 | The author disclaim all warranties with regard to this 21 | software, including all implied warranties of merchantability 22 | and fitness. In no event shall the author be liable for any 23 | special, indirect or consequential damages or any damages 24 | whatsoever resulting from loss of use, data or profits, whether 25 | in an action of contract, negligence or other tortious action, 26 | arising out of or in connection with the use or performance of 27 | this software. 28 | */ 29 | 30 | /** \file 31 | * 32 | * Header file for main.c. 33 | */ 34 | 35 | #ifndef _MAIN_H_ 36 | #define _MAIN_H_ 37 | 38 | /* Includes: */ 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #include "Descriptors.h" 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | /* Macros: */ 52 | /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ 53 | #define LEDMASK_USB_NOTREADY LEDS_LED1 54 | 55 | /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ 56 | #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) 57 | 58 | /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ 59 | #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) 60 | 61 | /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ 62 | #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) 63 | 64 | /* Type Defines: */ 65 | /** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC. 66 | * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c. 67 | */ 68 | 69 | /* Function Prototypes: */ 70 | void SetupHardware(void); 71 | void HID_Task(void); 72 | 73 | void EVENT_USB_Device_Connect(void); 74 | void EVENT_USB_Device_Disconnect(void); 75 | void EVENT_USB_Device_ConfigurationChanged(void); 76 | void EVENT_USB_Device_ControlRequest(void); 77 | void EVENT_USB_Device_StartOfFrame(void); 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JayBee-git/adapt-ffb-joy/b3c6cedb9c093dcd345941d274729172a0c10251/makefile -------------------------------------------------------------------------------- /usb_hid.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : usb_hid.h 3 | * Project : 3DP-Vert, Microsoft Sidewinder 3D Pro/PP/FFP to USB converter 4 | * Date : 2009/06/27 5 | * Version : 1.0 6 | * Target MCU : AT90USB162/82, AT90USB646/1286, ATMEGA16U4/32U4 7 | * Tool Chain : Atmel AVR Studio 4.18 716 / WinAVR 20100110 8 | * Author : Detlef "Grendel" Mueller 9 | * detlef@gmail.com 10 | * Release Notes: 11 | * 12 | * ================ 13 | * WARNING: This version has been heavily modified to only support 14 | * Force Feedback Pro and ATmega32U4. 15 | * Do not use except for testing purposes! 16 | * 17 | * -- tloimu 18 | * ================ 19 | * 20 | * $Id: usb_hid.h 1.5 2009/10/26 07:34:30 Detlef Exp Detlef $ 21 | ******************************************************************************/ 22 | 23 | #ifndef __usb_hid_h__ 24 | #define __usb_hid_h__ 25 | 26 | //------------------------------------------------------------------------------ 27 | // Standard control endpoint request types 28 | 29 | #define GET_STATUS 0 30 | #define CLEAR_FEATURE 1 31 | #define SET_FEATURE 3 32 | #define SET_ADDRESS 5 33 | #define GET_DESCRIPTOR 6 34 | #define GET_CONFIGURATION 8 35 | #define SET_CONFIGURATION 9 36 | #define GET_INTERFACE 10 37 | #define SET_INTERFACE 11 38 | 39 | //------------------------------------------------------------------------------ 40 | // HID (human interface device) 41 | 42 | #define HID_GET_REPORT 1 43 | #define HID_GET_IDLE 2 44 | #define HID_GET_PROTOCOL 3 45 | #define HID_SET_REPORT 9 46 | #define HID_SET_IDLE 10 47 | #define HID_SET_PROTOCOL 11 48 | 49 | //------------------------------------------------------------------------------ 50 | 51 | #define LSB( n ) ( (uint16_t)(n) & 0xFF) 52 | #define MSB( n ) (((uint16_t)(n) >> 8) & 0xFF) 53 | 54 | #define LVAL( n ) LSB( n ), MSB( n ) 55 | 56 | #endif // __usb_hid_h__ 57 | 58 | //------------------------------------------------------------------------------ 59 | --------------------------------------------------------------------------------