diff options
author | Drashna Jaelre <drashna@live.com> | 2019-08-02 14:02:40 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-08-30 15:01:52 -0700 |
commit | cf4575b94a3c65e6535a159fc71fc885aebc2620 (patch) | |
tree | 2354f2b7a200e02246a564afefedc32357e62b8e /lib/lufa/Demos/Device/ClassDriver/DualMIDI | |
parent | 75ee8df19e0f14ba466f41ab673dde2fe2fdae9c (diff) |
Fix the LUFA lib to use a submodule instead of just files (#6245)
* Remove LUFA files
* Update descriptions for newer version of LUFA
* Create PR6245.md
* Fix CDC(Serial) type errors
* Fix missed merge conflict for AUDIO_DTYPE_CSInterface
Diffstat (limited to 'lib/lufa/Demos/Device/ClassDriver/DualMIDI')
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/Config/LUFAConfig.h | 126 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.c | 366 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.h | 124 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.c | 211 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.h | 78 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.txt | 78 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/asf.xml | 62 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/doxyfile | 2395 | ||||
-rw-r--r-- | lib/lufa/Demos/Device/ClassDriver/DualMIDI/makefile | 43 |
9 files changed, 0 insertions, 3483 deletions
diff --git a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Config/LUFAConfig.h b/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Config/LUFAConfig.h deleted file mode 100644 index 00eefc7bf7..0000000000 --- a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Config/LUFAConfig.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2017. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2017 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 - * \brief LUFA Library Configuration Header File - * - * This header file is used to configure LUFA's compile time options, - * as an alternative to the compile time constants supplied through - * a makefile. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ - - #if (ARCH == ARCH_AVR8) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ -// #define ORDERED_EP_CONFIG - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) - #define USB_DEVICE_ONLY -// #define USB_HOST_ONLY -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT -// #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ -// #define USE_RAM_DESCRIPTORS - #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS -// #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 -// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE -// #define INTERRUPT_CONTROL_ENDPOINT -// #define NO_DEVICE_REMOTE_WAKEUP -// #define NO_DEVICE_SELF_POWER - - /* USB Host Mode Driver Related Tokens: */ -// #define HOST_STATE_AS_GPIOR {Insert Value Here} -// #define USB_HOST_TIMEOUT_MS {Insert Value Here} -// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} -// #define NO_AUTO_VBUS_MANAGEMENT -// #define INVERTED_VBUS_ENABLE_LINE - - #elif (ARCH == ARCH_XMEGA) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT -// #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ -// #define USE_RAM_DESCRIPTORS - #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS -// #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 -// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE - #define MAX_ENDPOINT_INDEX 2 -// #define NO_DEVICE_REMOTE_WAKEUP -// #define NO_DEVICE_SELF_POWER - - #else - - #error Unsupported architecture for this LUFA configuration file. - - #endif -#endif diff --git a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.c b/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.c deleted file mode 100644 index a286c5e9e0..0000000000 --- a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2017. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2017 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, located in FLASH memory, describes the overall - * device characteristics, including the supported USB version, control endpoint size and the - * number of device configurations. The descriptor is read out by the USB host when the enumeration - * process begins. - */ -const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = -{ - .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - - .USBSpecification = VERSION_BCD(1,1,0), - .Class = USB_CSCP_NoDeviceClass, - .SubClass = USB_CSCP_NoDeviceSubclass, - .Protocol = USB_CSCP_NoDeviceProtocol, - - .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, - - .VendorID = 0x03EB, - .ProductID = 0x206D, - .ReleaseNumber = VERSION_BCD(0,0,2), - - .ManufacturerStrIndex = STRING_ID_Manufacturer, - .ProductStrIndex = STRING_ID_Product, - .SerialNumStrIndex = NO_DESCRIPTOR, - - .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS -}; - -/** 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 PROGMEM ConfigurationDescriptor = -{ - .Config = - { - .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, - - .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), - .TotalInterfaces = 2, - - .ConfigurationNumber = 1, - .ConfigurationStrIndex = NO_DESCRIPTOR, - - .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED), - - .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) - }, - - .Audio_ControlInterface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = INTERFACE_ID_AudioControl, - .AlternateSetting = 0, - - .TotalEndpoints = 0, - - .Class = AUDIO_CSCP_AudioClass, - .SubClass = AUDIO_CSCP_ControlSubclass, - .Protocol = AUDIO_CSCP_ControlProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .Audio_ControlInterface_SPC = - { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, - - .ACSpecification = VERSION_BCD(1,0,0), - .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), - - .InCollection = 1, - .InterfaceNumber = INTERFACE_ID_AudioStream, - }, - - .Audio_StreamInterface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = INTERFACE_ID_AudioStream, - .AlternateSetting = 0, - - .TotalEndpoints = 2, - - .Class = AUDIO_CSCP_AudioClass, - .SubClass = AUDIO_CSCP_MIDIStreamingSubclass, - .Protocol = AUDIO_CSCP_StreamingProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .Audio_StreamInterface_SPC = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_General, - - .AudioSpecification = VERSION_BCD(1,0,0), - - .TotalLength = (sizeof(USB_Descriptor_Configuration_t) - - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)) - }, - - .MIDI_In_Jack_Emb = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - - .JackType = MIDI_JACKTYPE_Embedded, - .JackID = 0x01, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_In_Jack_Emb2 = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - - .JackType = MIDI_JACKTYPE_Embedded, - .JackID = 0x02, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_In_Jack_Ext = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - - .JackType = MIDI_JACKTYPE_External, - .JackID = 0x03, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_In_Jack_Ext2 = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - - .JackType = MIDI_JACKTYPE_External, - .JackID = 0x04, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_Out_Jack_Emb = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - - .JackType = MIDI_JACKTYPE_Embedded, - .JackID = 0x05, - - .NumberOfPins = 1, - .SourceJackID = {0x03}, - .SourcePinID = {0x01}, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_Out_Jack_Emb2 = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - - .JackType = MIDI_JACKTYPE_Embedded, - .JackID = 0x06, - - .NumberOfPins = 1, - .SourceJackID = {0x04}, - .SourcePinID = {0x01}, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_Out_Jack_Ext = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - - .JackType = MIDI_JACKTYPE_External, - .JackID = 0x07, - - .NumberOfPins = 1, - .SourceJackID = {0x01}, - .SourcePinID = {0x01}, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_Out_Jack_Ext2 = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, - .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - - .JackType = MIDI_JACKTYPE_External, - .JackID = 0x08, - - .NumberOfPins = 1, - .SourceJackID = {0x02}, - .SourcePinID = {0x01}, - - .JackStrIndex = NO_DESCRIPTOR - }, - - .MIDI_In_Jack_Endpoint = - { - .Endpoint = - { - .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = MIDI_STREAM_OUT_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x05 - }, - - .Refresh = 0, - .SyncEndpointNumber = 0 - }, - - .MIDI_In_Jack_Endpoint_SPC = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_DualJack_Endpoint_t), .Type = DTYPE_CSEndpoint}, - .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, - - .TotalEmbeddedJacks = 0x02, - .AssociatedJackID = {0x01, 0x02} - }, - - .MIDI_Out_Jack_Endpoint = - { - .Endpoint = - { - .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = MIDI_STREAM_IN_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x05 - }, - - .Refresh = 0, - .SyncEndpointNumber = 0 - }, - - .MIDI_Out_Jack_Endpoint_SPC = - { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_DualJack_Endpoint_t), .Type = DTYPE_CSEndpoint}, - .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, - - .TotalEmbeddedJacks = 0x02, - .AssociatedJackID = {0x05, 0x06} - } -}; - -/** 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 PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(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 PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera"); - -/** Product descriptor string. This is a Unicode string containing the product's details in human readable form, - * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device - * Descriptor. - */ -const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"LUFA Dual MIDI Demo"); - -/** 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 uint16_t wIndex, - const void** const DescriptorAddress) -{ - 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 STRING_ID_Language: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - case STRING_ID_Manufacturer: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - case STRING_ID_Product: - Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); - break; - } - - break; - } - - *DescriptorAddress = Address; - return Size; -} - diff --git a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.h b/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.h deleted file mode 100644 index a7ce6d2cd6..0000000000 --- a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/Descriptors.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2017. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2017 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 <LUFA/Drivers/USB/USB.h> - - #include <avr/pgmspace.h> - - /* Macros: */ - /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ - #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2) - - /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */ - #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 1) - - /** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */ - #define MIDI_STREAM_EPSIZE 64 - - /* Type Defines: */ - /** Type define for a dual jack endpoint descriptor. This is identical to the LUFA MIDI class driver's - * USB_MIDI_Descriptor_Jack_Endpoint_t, except that it contains two jack association entries. - */ - typedef struct - { - USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ - uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ - - uint8_t TotalEmbeddedJacks; /**< Total number of jacks inside this endpoint. */ - uint8_t AssociatedJackID[2]; /**< IDs of each jack inside the endpoint. */ - } ATTR_PACKED USB_MIDI_Descriptor_DualJack_Endpoint_t; - - /** Type define for the device configuration descriptor structure. This must be defined in the - * application code, as the configuration descriptor contains several sub-descriptors which - * vary between devices, and which describe the device's usage to the host. - */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; - - // MIDI Audio Control Interface - USB_Descriptor_Interface_t Audio_ControlInterface; - USB_Audio_Descriptor_Interface_AC_t Audio_ControlInterface_SPC; - - // MIDI Audio Streaming Interface - USB_Descriptor_Interface_t Audio_StreamInterface; - USB_MIDI_Descriptor_AudioInterface_AS_t Audio_StreamInterface_SPC; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb2; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext; - USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext2; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb2; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext; - USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext2; - USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint; - USB_MIDI_Descriptor_DualJack_Endpoint_t MIDI_In_Jack_Endpoint_SPC; - USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint; - USB_MIDI_Descriptor_DualJack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; - } USB_Descriptor_Configuration_t; - - /** Enum for the device interface descriptor IDs within the device. Each interface descriptor - * should have a unique ID index associated with it, which can be used to refer to the - * interface from other descriptors. - */ - enum InterfaceDescriptors_t - { - INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */ - INTERFACE_ID_AudioStream = 1, /**< Audio streaming interface descriptor ID */ - }; - - /** Enum for the device string descriptor IDs within the device. Each string descriptor should - * have a unique ID index associated with it, which can be used to refer to the string from - * other descriptors. - */ - enum StringDescriptors_t - { - STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ - STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ - STRING_ID_Product = 2, /**< Product string ID */ - }; - - /* Function Prototypes: */ - uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint16_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); - -#endif - diff --git a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.c b/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.c deleted file mode 100644 index b31f602498..0000000000 --- a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2017. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2017 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 Dual MIDI demo. This file contains the main tasks of - * the demo and is responsible for the initial application hardware configuration. - */ - -#include "DualMIDI.h" - -/** LUFA MIDI Class driver interface configuration and state information. This structure is - * passed to all MIDI Class driver functions, so that multiple instances of the same class - * within a device can be differentiated from one another. - */ -USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface = - { - .Config = - { - .StreamingInterfaceNumber = INTERFACE_ID_AudioStream, - .DataINEndpoint = - { - .Address = MIDI_STREAM_IN_EPADDR, - .Size = MIDI_STREAM_EPSIZE, - .Banks = 1, - }, - .DataOUTEndpoint = - { - .Address = MIDI_STREAM_OUT_EPADDR, - .Size = MIDI_STREAM_EPSIZE, - .Banks = 1, - }, - }, - }; - - -/** 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(); - - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - GlobalInterruptEnable(); - - for (;;) - { - CheckJoystickMovement(); - - MIDI_EventPacket_t ReceivedMIDIEvent; - while (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent)) - { - if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && (ReceivedMIDIEvent.Data3 > 0)) - LEDs_SetAllLEDs(ReceivedMIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); - else - LEDs_SetAllLEDs(LEDS_NO_LEDS); - } - - MIDI_Device_USBTask(&Keyboard_MIDI_Interface); - 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); -#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; -#endif - - /* Hardware Initialization */ - Joystick_Init(); - LEDs_Init(); - Buttons_Init(); - USB_Init(); -} - -/** Checks for changes in the position of the board joystick, sending MIDI events to the host upon each change. */ -void CheckJoystickMovement(void) -{ - static uint8_t PrevJoystickStatus; - - uint8_t MIDICommand = 0; - uint8_t MIDIPitch; - - /* Get current joystick mask, XOR with previous to detect joystick changes */ - uint8_t JoystickStatus = Joystick_GetStatus(); - uint8_t JoystickChanges = (JoystickStatus ^ PrevJoystickStatus); - - /* Get board button status - if pressed use second virtual cable, otherwise use the first */ - uint8_t VirtualCable = (Buttons_GetStatus() & BUTTONS_BUTTON1) ? 1 : 0; - - if (JoystickChanges & JOY_LEFT) - { - MIDICommand = ((JoystickStatus & JOY_LEFT)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF); - MIDIPitch = 0x3C; - } - - if (JoystickChanges & JOY_UP) - { - MIDICommand = ((JoystickStatus & JOY_UP)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF); - MIDIPitch = 0x3D; - } - - if (JoystickChanges & JOY_RIGHT) - { - MIDICommand = ((JoystickStatus & JOY_RIGHT)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF); - MIDIPitch = 0x3E; - } - - if (JoystickChanges & JOY_DOWN) - { - MIDICommand = ((JoystickStatus & JOY_DOWN)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF); - MIDIPitch = 0x3F; - } - - if (JoystickChanges & JOY_PRESS) - { - MIDICommand = ((JoystickStatus & JOY_PRESS)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF); - MIDIPitch = 0x3B; - } - - if (MIDICommand) - { - MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) - { - .Event = MIDI_EVENT(VirtualCable, MIDICommand), - - .Data1 = MIDICommand | MIDI_CHANNEL(1), - .Data2 = MIDIPitch, - .Data3 = MIDI_STANDARD_VELOCITY, - }; - - MIDI_Device_SendEventPacket(&Keyboard_MIDI_Interface, &MIDIEvent); - MIDI_Device_Flush(&Keyboard_MIDI_Interface); - } - - PrevJoystickStatus = JoystickStatus; -} - -/** Event handler for the library USB Connection event. */ -void EVENT_USB_Device_Connect(void) -{ - LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); -} - -/** Event handler for the library USB Disconnection event. */ -void EVENT_USB_Device_Disconnect(void) -{ - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); -} - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - bool ConfigSuccess = true; - - ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&Keyboard_MIDI_Interface); - - LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); -} - -/** Event handler for the library USB Control Request reception event. */ -void EVENT_USB_Device_ControlRequest(void) -{ - MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface); -} - diff --git a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.h b/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.h deleted file mode 100644 index 3b0dac3be3..0000000000 --- a/lib/lufa/Demos/Device/ClassDriver/DualMIDI/DualMIDI.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2017. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2017 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 DualMIDI.c. - */ - -#ifndef _DUAL_MIDI_H_ -#define _DUAL_MIDI_H_ - - /* Includes: */ - #include <avr/io.h> - #include <avr/wdt.h> - #include <avr/power.h> - #include <avr/interrupt.h> - #include <stdbool.h> - #include <string.h> - - #include "Descriptors.h" - - #include <LUFA/Drivers/Board/LEDs.h> - #include <LUFA/Drivers/Board/Joystick.h> - #include <LUFA/Drivers/Board/Buttons.h> - #include <LUFA/Drivers/USB/USB.h> - #include <LUFA/Platform/Platform.h> - - /* Macros: */ - /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ - #define LEDMASK_USB_NOTREADY LEDS_LED1 - - /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ - #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) - - /** LED mask for the library LED driver, to indicate that the USB inter |