From 39ece819791eed7f57e0a0492c1aa774be5c4b24 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 7 Jul 2017 11:56:01 -0400 Subject: delete old lufa --- .../CodeTemplates/DeviceTemplate/Descriptors.c | 180 --------------------- .../CodeTemplates/DeviceTemplate/Descriptors.h | 59 ------- .../DeviceTemplate/DeviceApplication.c | 106 ------------ .../DeviceTemplate/DeviceApplication.h | 53 ------ .../LUFA/CodeTemplates/DeviceTemplate/asf.xml | 55 ------- 5 files changed, 453 deletions(-) delete mode 100644 tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c delete mode 100644 tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h delete mode 100644 tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c delete mode 100644 tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h delete mode 100644 tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml (limited to 'tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate') diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c deleted file mode 100644 index 71cebe891..000000000 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c +++ /dev/null @@ -1,180 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * USB Device Descriptors, for library use when in USB device mode. Descriptors are special - * computer-readable structures which the host requests upon device enumeration, to determine - * the device's capabilities and functions. - */ - -#include "Descriptors.h" - -/** Device descriptor structure. This descriptor describes the overall device - * characteristics, including the supported USB version, control endpoint size - * and the number of device configurations. The descriptor is read out by the - * USB host when the enumeration process begins. - */ -const USB_Descriptor_Device_t DeviceDescriptor = -{ - .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - - .USBSpecification = VERSION_BCD(2,0,0), - .Class = USB_CSCP_NoDeviceClass, - .SubClass = USB_CSCP_NoDeviceSubclass, - .Protocol = USB_CSCP_NoDeviceProtocol, - - .Endpoint0Size = 64, - - .VendorID = 0x0000, - .ProductID = 0x0000, - .ReleaseNumber = VERSION_BCD(0,0,2), - - .ManufacturerStrIndex = 0x01, - .ProductStrIndex = 0x02, - .SerialNumStrIndex = NO_DESCRIPTOR, - - .NumberOfConfigurations = 1 -}; - -/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage - * of the device in one of its supported configurations, including information about any device interfaces - * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting - * a configuration so that the host may correctly communicate with the USB device. - */ -const USB_Descriptor_Configuration_t ConfigurationDescriptor = -{ - .Config = - { - .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, - - .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), - .TotalInterfaces = 0, - - .ConfigurationNumber = 1, - .ConfigurationStrIndex = NO_DESCRIPTOR, - - .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED), - - .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) - }, -}; - -/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests - * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate - * via the language ID table available at USB.org what languages the device supports for its string descriptors. - */ -const USB_Descriptor_String_t LanguageString = -{ - .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String}, - - .UnicodeString = {LANGUAGE_ID_ENG} -}; - -/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable - * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device - * Descriptor. - */ -const USB_Descriptor_String_t ManufacturerString = -{ - .Header = {.Size = USB_STRING_LEN(14), .Type = DTYPE_String}, - - .UnicodeString = L"Your Name Here" -}; - -/** Product descriptor string. This is a Unicode string containing the product's details in human readable form, - * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device - * Descriptor. - */ -const USB_Descriptor_String_t ProductString = -{ - .Header = {.Size = USB_STRING_LEN(15), .Type = DTYPE_String}, - - .UnicodeString = L"LUFA USB Device" -}; - -/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" - * documentation) by the application code so that the address and size of a requested descriptor can be given - * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function - * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the - * USB host. - */ -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress - #if defined(HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES) - , uint8_t* const DescriptorMemorySpace - #endif - ) -{ - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - break; - case DTYPE_String: - switch (DescriptorNumber) - { - case 0x00: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - case 0x02: - Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); - break; - } - - break; - } - - #if defined(HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES) - *DescriptorMemorySpace = MEMSPACE_RAM; - #endif - - *DescriptorAddress = Address; - return Size; -} - diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h deleted file mode 100644 index 6d8145d0c..000000000 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for Descriptors.c. - */ - -#ifndef _DESCRIPTORS_H_ -#define _DESCRIPTORS_H_ - - /* Includes: */ - #include - - /* Macros: */ - #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \ - !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))) - #define HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES - #endif - - /* Type Defines: */ - /** Type define for the device configuration descriptor structure. This must be defined in the - * application code, as the configuration descriptor contains several sub-descriptors which - * vary between devices, and which describe the device's usage to the host. - */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; - } USB_Descriptor_Configuration_t; - -#endif - diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c deleted file mode 100644 index ddaa9d089..000000000 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Main source file for the USB device application. This file contains the - * main tasks of the application and is responsible for the initial - * application hardware configuration. - */ - -#include "DeviceApplication.h" - -/** Main program entry point. This routine contains the overall program flow, including initial - * setup of all components and the main program loop. - */ -int main(void) -{ - SetupHardware(); - - GlobalInterruptEnable(); - - for (;;) - { - USB_USBTask(); - } -} - -/** Configures the board hardware and chip peripherals for the demo's functionality. */ -void SetupHardware(void) -{ - #if (ARCH == ARCH_AVR8) - /* Disable watchdog if enabled by bootloader/fuses */ - MCUSR &= ~(1 << WDRF); - wdt_disable(); - - /* Disable clock division */ - clock_prescale_set(clock_div_1); - - /* Hardware Initialization */ - USB_Init(USB_MODE_Device, USB_DEVICE_OPT_FULLSPEED | USB_OPT_AUTO_PLL); - #elif (ARCH == ARCH_XMEGA) - /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ - XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); - XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); - - /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ - XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); - XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); - - PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; - - /* Hardware Initialization */ - USB_Init(USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH); - #endif -} - -/** Event handler for the library USB Connection event. */ -void EVENT_USB_Device_Connect(void) -{ - -} - -/** Event handler for the library USB Disconnection event. */ -void EVENT_USB_Device_Disconnect(void) -{ - -} - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - -} - -/** Event handler for the library USB Control Request reception event. */ -void EVENT_USB_Device_ControlRequest(void) -{ - -} diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h deleted file mode 100644 index 325176c53..000000000 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for DeviceApplication.c. - */ - -#ifndef _USB_DEVICE_APPLICATION_H_ -#define _USB_DEVICE_APPLICATION_H_ - - /* Includes: */ - #include - #include - #include - - #include - #include - - #include "Descriptors.h" - - /* Function Prototypes: */ - void SetupHardware(void); - -#endif - diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml deleted file mode 100644 index e952714e1..000000000 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Template for a LUFA USB device mode application. - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3-24-g4f1b