diff options
Diffstat (limited to 'LUFA/Drivers/USB/Class')
57 files changed, 1388 insertions, 362 deletions
diff --git a/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h b/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h index f1c0109ea..c36625c2a 100644 --- a/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h +++ b/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/AudioClass.h b/LUFA/Drivers/USB/Class/AudioClass.h index d6ced05dc..8abb1030e 100644 --- a/LUFA/Drivers/USB/Class/AudioClass.h +++ b/LUFA/Drivers/USB/Class/AudioClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/CCIDClass.h b/LUFA/Drivers/USB/Class/CCIDClass.h new file mode 100644 index 000000000..7bfde1101 --- /dev/null +++ b/LUFA/Drivers/USB/Class/CCIDClass.h @@ -0,0 +1,82 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2019. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Filipe Rodrigues (filipepazrodrigues [at] gmail [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 Master include file for the library USB CCID Class driver. + * + * Master include file for the library USB CCID Class driver, for both host and device modes, where available. + * + * This file should be included in all user projects making use of this optional class driver, instead of + * including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories. + */ + +/** \ingroup Group_USBClassDrivers + * \defgroup Group_USBClassCCID CCID Class Driver + * \brief USB class driver for the USB-IF CCID class standard. + * + * \section Sec_USBClassCCID_Dependencies Module Source Dependencies + * The following files must be built with any user project that uses this module: + * - LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c <i>(Makefile source module name: LUFA_SRC_USBCLASS)</i> + * + * \section Sec_USBClassCCID_ModDescription Module Description + * CCID Class Driver module. This module contains an internal implementation of the USB CCID Class, for Device USB + * mode. User applications can use this class driver instead of implementing the CCID class manually via the low-level + * LUFA APIs. + * + * This module is designed to simplify the user code by exposing only the required interface needed to interface with + * Devices using the USB CCID Class. + * + * \warning + * LUFA is not a secure USB stack, and has not undergone, not is it expected to pass, any form of security audit. The + * CCID class here is presented as-is and is intended for research purposes only, and *should not* be used in a security + * critical application under any circumstances. + * + * @{ + */ + +#ifndef _CCID_CLASS_H_ +#define _CCID_CLASS_H_ + + /* Macros: */ + #define __INCLUDE_FROM_USB_DRIVER + #define __INCLUDE_FROM_CCID_DRIVER + + /* Includes: */ + #include "../Core/USBMode.h" + + #if defined(USB_CAN_BE_DEVICE) + #include "Device/CCIDClassDevice.h" + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/USB/Class/CDCClass.h b/LUFA/Drivers/USB/Class/CDCClass.h index 30b3ee237..302d02300 100644 --- a/LUFA/Drivers/USB/Class/CDCClass.h +++ b/LUFA/Drivers/USB/Class/CDCClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h index fdf8671fc..3fd58bc06 100644 --- a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h b/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h index 46ecd0858..4ab201800 100644 --- a/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -245,6 +245,13 @@ */ }; + /** Enum for the Audio class specific descriptor types. */ + enum AUDIO_DescriptorTypes_t + { + AUDIO_DTYPE_CSInterface = 0x24, /**< Audio class specific Interface functional descriptor. */ + AUDIO_DTYPE_CSEndpoint = 0x25, /**< Audio class specific Endpoint functional descriptor. */ + }; + /** Audio class specific interface description subtypes, for the Audio Control interface. */ enum Audio_CSInterface_AC_SubTypes_t { diff --git a/LUFA/Drivers/USB/Class/Common/CCIDClassCommon.h b/LUFA/Drivers/USB/Class/Common/CCIDClassCommon.h new file mode 100644 index 000000000..3f4031ac8 --- /dev/null +++ b/LUFA/Drivers/USB/Class/Common/CCIDClassCommon.h @@ -0,0 +1,293 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2019. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Filipe Rodrigues (filipepazrodrigues [at] gmail [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 Common definitions and declarations for the library USB CCID Class driver. + * + * Common definitions and declarations for the library USB CCID Class driver. + * + * \note This file should not be included directly. It is automatically included as needed by the USB module driver + * dispatch header located in LUFA/Drivers/USB.h. + */ + +/** \ingroup Group_USBClassCCID + * \defgroup Group_USBClassCCIDCommon Common Class Definitions + * + * \section Sec_USBClassCCIDCommon_ModDescription Module Description + * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB + * CCID Class. + * + * @{ + */ + +#ifndef _CCID_CLASS_COMMON_H_ +#define _CCID_CLASS_COMMON_H_ + + /* Includes: */ + #include "../../Core/StdDescriptors.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_CCID_DRIVER) + #error Do not include this file directly. Include LUFA/Drivers/USB.h instead. + #endif + + /* Macros: */ + #define CCID_CURRENT_SPEC_RELEASE_NUMBER 0x0110 + #define CCID_VOLTAGESUPPORT_5V 0 + #define CCID_VOLTAGESUPPORT_3V (1 << 0) + #define CCID_VOLTAGESUPPORT_1V8 (1 << 1) + + #define CCID_PROTOCOLS_T0 (1 << 0) + #define CCID_PROTOCOLS_T1 (1 << 1) + + #define CCID_PROTOCOLNUM_T0 0 + #define CCID_PROTOCOLNUM_T1 (1 << 0) + + #define CCID_ICCSTATUS_PRESENTANDACTIVE 0 + #define CCID_ICCSTATUS_PRESENTANDINACTIVE (1 << 0) + #define CCID_ICCSTATUS_NOICCPRESENT (1 << 1) + + #define CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR 0 + #define CCID_COMMANDSTATUS_ERROR 1 + #define CCID_COMMANDSTATUS_FAILED (1 << 6) + #define CCID_COMMANDSTATUS_TIMEEXTENSIONREQUESTED (2 << 6) + #define CCID_COMMANDSTATUS_RFU (3 << 6) + + #define CCID_ERROR_RFU_START 0x80 + #define CCID_ERROR_NO_ERROR 0x80 + #define CCID_ERROR_NOT_SUPPORTED 0 + #define CCID_ERROR_CMD_ABORTED 0xFF + #define CCID_ERROR_CMD_NOT_ABORTED 0xFF + + #define CCID_ERROR_PARAMETERS_PROTOCOL_NOT_SUPPORTED 0x7 + + #define CCID_ERROR_SLOT_NOT_FOUND 5 + + #define CCID_DESCRIPTOR_CLOCK_KHZ(khz) (khz) + #define CCID_DESCRIPTOR_CLOCK_MHZ(mhz) ((mhz) * 1000) + + + /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CCID + * device class. + */ + enum CCID_Descriptor_ClassSubclassProtocol_t + { + CCID_CSCP_CCIDClass = 0x0b, /**< Descriptor Class value indicating that the device or interface + * belongs to the CCID class. + */ + CCID_CSCP_NoSpecificSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface + * belongs to no specific subclass of the CCID class. + */ + CCID_CSCP_NoSpecificProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface + * belongs to no specific protocol of the CCID class. + */ + }; + + /** Enum for possible bulk messages between PC and Reader */ + enum CCID_BulkOutMessages_t + { + CCID_PC_to_RDR_IccPowerOn = 0x62, + CCID_PC_to_RDR_IccPowerOff = 0x63, + CCID_PC_to_RDR_GetSlotStatus = 0x65, + CCID_PC_to_RDR_XfrBlock = 0x6f, + CCID_PC_to_RDR_GetParameters = 0x6c, + CCID_PC_to_RDR_ResetParameters = 0x6d, + CCID_PC_to_RDR_SetParameters = 0x61, + CCID_PC_to_RDR_Escape = 0x6b, + CCID_PC_to_RDR_IccClock = 0x6e, + CCID_PC_to_RDR_T0APDU = 0x6a, + CCID_PC_to_RDR_Secure = 0x69, + CCID_PC_to_RDR_Mechanical = 0x71, + CCID_PC_to_RDR_Abort = 0x72, + CCID_PC_to_RDR_SetDataRateAndClockFrequency = 0x73, + + CCID_RDR_to_PC_DataBlock = 0x80, + CCID_RDR_to_PC_SlotStatus = 0x81, + CCID_RDR_to_PC_Parameters = 0x82, + CCID_RDR_to_PC_Escape = 0x83, + CCID_RDR_to_PC_DataRateAndClockFrequency = 0x84, + }; + + /** Enum for the CCID class specific control requests that can be issued by the USB bus host. */ + enum CCID_ClassRequests_t + { + CCID_ABORT = 0x1, + CCID_GET_CLOCK_FREQUENCIES = 0x2, + CCID_GET_DATA_RATES = 0x3, + }; + + /** Enum for the CCID class specific descriptor types. */ + enum CCID_DescriptorTypes_t + { + CCID_DTYPE_Functional = 0x21, /**< CCID class specific Interface functional descriptor. */ + }; + + enum CCID_Features_Auto_t + { + CCID_Features_Auto_None = 0x0, + CCID_Features_Auto_ParameterConfiguration = 0x2, + CCID_Features_Auto_ICCActivation = 0x4, + CCID_Features_Auto_VoltageSelection = 0x8, + + CCID_Features_Auto_ICCClockFrequencyChange = 0x10, + CCID_Features_Auto_ICCBaudRateChange = 0x20, + CCID_Features_Auto_ParameterNegotiation = 0x40, + CCID_Features_Auto_PPS = 0x80, + }; + + enum CCID_Features_ExchangeLevel_t + { + CCID_Features_ExchangeLevel_TPDU = 0x00010000, + CCID_Features_ExchangeLevel_ShortAPDU = 0x00020000, + CCID_Features_ExchangeLevel_ShortExtendedAPDU = 0x00040000 + }; + + /* Type Defines: */ + typedef struct + { + USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ + + uint16_t CCID; + uint8_t MaxSlotIndex; + uint8_t VoltageSupport; + uint32_t Protocols; + uint32_t DefaultClock; + uint32_t MaximumClock; + uint8_t NumClockSupported; + uint32_t DataRate; + uint32_t MaxDataRate; + uint8_t NumDataRatesSupported; + uint32_t MaxIFSD; + uint32_t SynchProtocols; + uint32_t Mechanical; + uint32_t Features; + uint32_t MaxCCIDMessageLength; + uint8_t ClassGetResponse; + uint8_t ClassEnvelope; + uint16_t LcdLayout; + uint8_t PINSupport; + uint8_t MaxCCIDBusySlots; + } ATTR_PACKED USB_CCID_Descriptor_t; + + typedef struct + { + uint8_t FindexDindex; + uint8_t TCCKST0; + uint8_t GuardTimeT0; + uint8_t WaitingIntegerT0; + uint8_t ClockStop; + } ATTR_PACKED USB_CCID_ProtocolData_T0_t; + + typedef struct + { + uint8_t FindexDindex; + uint8_t TCCKST1; + uint8_t GuardTimeT1; + uint8_t WaitingIntegerT1; + uint8_t ClockStop; + uint8_t FSC; + uint8_t NadValue; + } ATTR_PACKED USB_CCID_ProtocolData_T1_t; + + + /** Enum for a common bulk message header. */ + typedef struct + { + uint8_t MessageType; + uint32_t Length; + uint8_t Slot; + uint8_t Seq; + } ATTR_PACKED USB_CCID_BulkMessage_Header_t; + + typedef struct + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + uint8_t Status; + uint8_t Error; + uint8_t ChainParam; + uint8_t Data[0]; + } ATTR_PACKED USB_CCID_RDR_to_PC_DataBlock_t; + + typedef struct + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + uint8_t Status; + uint8_t Error; + uint8_t ClockStatus; + } ATTR_PACKED USB_CCID_RDR_to_PC_SlotStatus_t; + + typedef struct + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + uint8_t Status; + uint8_t Error; + uint8_t ProtocolNum; + union + { + USB_CCID_ProtocolData_T0_t T0; + USB_CCID_ProtocolData_T1_t T1; + } ProtocolData; + } ATTR_PACKED USB_CCID_RDR_to_PC_Parameters_t; + + typedef struct + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + uint8_t Status; + uint8_t Error; + uint8_t RFU; + uint8_t Data[0]; + } ATTR_PACKED USB_CCID_RDR_to_PC_Escape_t; + + typedef struct + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + uint8_t Status; + uint8_t Error; + uint8_t RFU; + uint32_t ClockFrequency; + uint32_t DataRate; + } ATTR_PACKED USB_CCID_RDR_to_PC_DataRateAndClockFrequency_t; + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h b/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h index 1ad49eca1..c107a36a0 100644 --- a/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -112,21 +112,6 @@ #define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6) //@} - /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a - * uniform structure but variable sized data payloads, thus cannot be represented accurately by - * a single \c typedef \c struct. A macro is used instead so that functional descriptors can be created - * easily by specifying the size of the payload. This allows \c sizeof() to work correctly. - * - * \param[in] DataSize Size in bytes of the CDC functional descriptor's data payload. - */ - #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \ - struct \ - { \ - USB_Descriptor_Header_t Header; \ - uint8_t SubType; \ - uint8_t Data[DataSize]; \ - } - /* Enums: */ /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CDC * device class. @@ -183,26 +168,33 @@ */ }; + /** Enum for the CDC class specific descriptor types. */ + enum CDC_DescriptorTypes_t + { + CDC_DTYPE_CSInterface = 0x24, /**< CDC class specific Interface functional descriptor. */ + CDC_DTYPE_CSEndpoint = 0x25, /**< CDC class specific Endpoint functional descriptor. */ + }; + /** Enum for the CDC class specific interface descriptor subtypes. */ enum CDC_DescriptorSubtypes_t { - CDC_DSUBTYPE_CSInterface_Header = 0x00, /**< CDC class-specific Header functional descriptor. */ - CDC_DSUBTYPE_CSInterface_CallManagement = 0x01, /**< CDC class-specific Call Management functional descriptor. */ - CDC_DSUBTYPE_CSInterface_ACM = 0x02, /**< CDC class-specific Abstract Control Model functional descriptor. */ - CDC_DSUBTYPE_CSInterface_DirectLine = 0x03, /**< CDC class-specific Direct Line functional descriptor. */ - CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04, /**< CDC class-specific Telephone Ringer functional descriptor. */ - CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05, /**< CDC class-specific Telephone Call functional descriptor. */ - CDC_DSUBTYPE_CSInterface_Union = 0x06, /**< CDC class-specific Union functional descriptor. */ - CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07, /**< CDC class-specific Country Selection functional descriptor. */ - CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, /**< CDC class-specific Telephone Operation Modes functional descriptor. */ - CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09, /**< CDC class-specific USB Terminal functional descriptor. */ - CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A, /**< CDC class-specific Network Channel functional descriptor. */ - CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B, /**< CDC class-specific Protocol Unit functional descriptor. */ - CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C, /**< CDC class-specific Extension Unit functional descriptor. */ - CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D, /**< CDC class-specific Multi-Channel Management functional descriptor. */ - CDC_DSUBTYPE_CSInterface_CAPI = 0x0E, /**< CDC class-specific Common ISDN API functional descriptor. */ - CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F, /**< CDC class-specific Ethernet functional descriptor. */ - CDC_DSUBTYPE_CSInterface_ATM = 0x10, /**< CDC class-specific Asynchronous Transfer Mode functional descriptor. */ + CDC_DSUBTYPE_CSInterface_Header = 0x00, /**< CDC class specific Header functional descriptor. */ + CDC_DSUBTYPE_CSInterface_CallManagement = 0x01, /**< CDC class specific Call Management functional descriptor. */ + CDC_DSUBTYPE_CSInterface_ACM = 0x02, /**< CDC class specific Abstract Control Model functional descriptor. */ + CDC_DSUBTYPE_CSInterface_DirectLine = 0x03, /**< CDC class specific Direct Line functional descriptor. */ + CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04, /**< CDC class specific Telephone Ringer functional descriptor. */ + CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05, /**< CDC class specific Telephone Call functional descriptor. */ + CDC_DSUBTYPE_CSInterface_Union = 0x06, /**< CDC class specific Union functional descriptor. */ + CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07, /**< CDC class specific Country Selection functional descriptor. */ + CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, /**< CDC class specific Telephone Operation Modes functional descriptor. */ + CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09, /**< CDC class specific USB Terminal functional descriptor. */ + CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A, /**< CDC class specific Network Channel functional descriptor. */ + CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B, /**< CDC class specific Protocol Unit functional descriptor. */ + CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C, /**< CDC class specific Extension Unit functional descriptor. */ + CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D, /**< CDC class specific Multi-Channel Management functional descriptor. */ + CDC_DSUBTYPE_CSInterface_CAPI = 0x0E, /**< CDC class specific Common ISDN API functional descriptor. */ + CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F, /**< CDC class specific Ethernet functional descriptor. */ + CDC_DSUBTYPE_CSInterface_ATM = 0x10, /**< CDC class specific Asynchronous Transfer Mode functional descriptor. */ }; /** Enum for the possible line encoding formats of a virtual serial port. */ diff --git a/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h b/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h index 6e700a9b1..c59e769d8 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -112,6 +112,7 @@ /** \name Keyboard Standard Report Key Scan-codes */ //@{ + #define HID_KEYBOARD_SC_RESERVED 0x00 #define HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01 #define HID_KEYBOARD_SC_POST_FAIL 0x02 #define HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03 diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index 62f10c4e2..18c345655 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -90,9 +90,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1]) return HID_PARSE_HIDStackOverflow; - memcpy((CurrStateTable + 1), + memmove((CurrStateTable + 1), CurrStateTable, - sizeof(HID_ReportItem_t)); + sizeof(HID_StateTable_t)); CurrStateTable++; break; @@ -105,9 +105,6 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, break; case HID_RI_USAGE_PAGE(0): - if ((HIDReportItem & HID_RI_DATA_SIZE_MASK) == HID_RI_DATA_BITS_32) - CurrStateTable->Attributes.Usage.Page = (ReportItemData >> 16); - CurrStateTable->Attributes.Usage.Page = ReportItemData; break; @@ -178,6 +175,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, if (UsageListSize == HID_USAGE_STACK_DEPTH) return HID_PARSE_UsageListOverflow; + if ((HIDReportItem & HID_RI_DATA_SIZE_MASK) == HID_RI_DATA_BITS_32) + CurrStateTable->Attributes.Usage.Page = (ReportItemData >> 16); + UsageList[UsageListSize++] = ReportItemData; break; @@ -386,4 +386,3 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, return 0; } - diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.h b/LUFA/Drivers/USB/Class/Common/HIDParser.h index 023316d7e..4b4b9a819 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/HIDReportData.h b/LUFA/Drivers/USB/Class/Common/HIDReportData.h index fe1c4df94..979fc46c3 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDReportData.h +++ b/LUFA/Drivers/USB/Class/Common/HIDReportData.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h b/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h index b6414bc06..d4976c796 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h b/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h index d2ea37a82..ddf2c9f12 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h b/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h index 2db830e04..64412993d 100644 --- a/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h b/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h index ade1af067..7bc94b703 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h b/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h index 7608b18cc..7a5b5ac03 100644 --- a/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c index 08cbeb706..f65287fec 100644 --- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -188,7 +188,7 @@ bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioIn return true; } -void Audio_Device_Event_Stub(void) +void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) { } diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h index ca63511b2..fee2c8566 100644 --- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -377,7 +377,7 @@ #if !defined(__DOXYGEN__) /* Function Prototypes: */ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) - void Audio_Device_Event_Stub(void) ATTR_CONST; + void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo); void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub); diff --git a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c new file mode 100644 index 000000000..02eb57c07 --- /dev/null +++ b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c @@ -0,0 +1,392 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2019. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Filipe Rodrigues (filipepazrodrigues [at] gmail [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. +*/ + +#define __INCLUDE_FROM_USB_DRIVER +#include "../../Core/USBMode.h" + +#if defined(USB_CAN_BE_DEVICE) + +#define __INCLUDE_FROM_CCID_DRIVER +#define __INCLUDE_FROM_CCID_DEVICE_C +#include "CCIDClassDevice.h" + + +bool CCID_CheckStatusNoError(uint8_t Status) +{ + return (Status & 0xC0) == 0x0; +} + +void CCID_Device_ProcessControlRequest(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) +{ + if (!(Endpoint_IsSETUPReceived())) + return; + + if (USB_ControlRequest.wIndex != CCIDInterfaceInfo->Config.InterfaceNumber) + return; + + switch (USB_ControlRequest.bRequest) + { + case CCID_ABORT: + { + // Initiates the abort process. + // The host should send 2 messages in the following order: + // - CCID_ABORT control request + // - CCID_PC_t_PCo_RDR_Abort command + // + // If the device is still processing a message, it should fail it until receiving a CCIRPC_to_RDR_Abort + // command. + // + // When the device receives the CCIRPC_to_RDR_Abort message, it replies with RDR_to_PC_SlotStatus + // and the abort process ends. + + // The wValue field contains the slot number (bSlot) in the low byte and the sequence number (bSeq) in + // the high byte + uint8_t Slot = USB_ControlRequest.wValue & 0xFF; + uint8_t Seq = USB_ControlRequest.wValue >> 8; + + if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE) && Slot == 0) + { + Endpoint_ClearSETUP(); + + CCIDInterfaceInfo->State.Aborted = true; + CCIDInterfaceInfo->State.AbortedSeq = Seq; + + Endpoint_ClearOUT(); + } + + break; + } + + case CCID_GET_CLOCK_FREQUENCIES: + { + if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) + { + + Endpoint_ClearSETUP(); + Endpoint_Write_8(0); // Not supported + Endpoint_ClearOUT(); + } + break; + } + + case CCID_GET_DATA_RATES: + { + if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) + { + + Endpoint_ClearSETUP(); + Endpoint_Write_8(0); // Not supported + Endpoint_ClearOUT(); + } + break; + } + } +} + +bool CCID_Device_ConfigureEndpoints(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) +{ + CCIDInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK; + CCIDInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK; + + if (!(Endpoint_ConfigureEndpointTable(&CCIDInterfaceInfo->Config.DataINEndpoint, 1))) + return false; + + if (!(Endpoint_ConfigureEndpointTable(&CCIDInterfaceInfo->Config.DataOUTEndpoint, 1))) + return false; + + return true; +} + +void CCID_Device_USBTask(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) +{ + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataOUTEndpoint.Address); + + uint8_t RequestBuffer[0x40 - sizeof(USB_CCID_BulkMessage_Header_t)]; + uint8_t ResponseBuffer[0x40]; + + CCIDInterfaceInfo->State.Aborted = false; + CCIDInterfaceInfo->State.AbortedSeq = -1; + + if (Endpoint_IsOUTReceived()) + { + USB_CCID_BulkMessage_Header_t CCIDHeader; + CCIDHeader.MessageType = Endpoint_Read_8(); + CCIDHeader.Length = Endpoint_Read_32_LE(); + CCIDHeader.Slot = Endpoint_Read_8(); + CCIDHeader.Seq = Endpoint_Read_8(); + + uint8_t Status; + uint8_t Error = CCID_ERROR_NO_ERROR; + + switch (CCIDHeader.MessageType) + { + case CCID_PC_to_RDR_IccPowerOn: + { + uint8_t AtrLength; + USB_CCID_RDR_to_PC_DataBlock_t* ResponseATR = (USB_CCID_RDR_to_PC_DataBlock_t*)&ResponseBuffer; + + ResponseATR->CCIDHeader.MessageType = CCID_RDR_to_PC_DataBlock; + ResponseATR->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseATR->CCIDHeader.Seq = CCIDHeader.Seq; + ResponseATR->ChainParam = 0; + + Status = CALLBACK_CCID_IccPowerOn(CCIDInterfaceInfo, ResponseATR->CCIDHeader.Slot, (uint8_t*)ResponseATR->Data, &AtrLength, &Error); + + if (CCID_CheckStatusNoError(Status) && !CCIDInterfaceInfo->State.Aborted) + { + ResponseATR->CCIDHeader.Length = AtrLength; + } + else if (CCIDInterfaceInfo->State.Aborted) + { + Status = CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_PRESENTANDACTIVE; + Error = CCID_ERROR_CMD_ABORTED; + AtrLength = 0; + } + else + { + AtrLength = 0; + } + + ResponseATR->Status = Status; + ResponseATR->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseATR, sizeof(USB_CCID_RDR_to_PC_DataBlock_t) + AtrLength, NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_IccPowerOff: + { + USB_CCID_RDR_to_PC_SlotStatus_t* ResponsePowerOff = (USB_CCID_RDR_to_PC_SlotStatus_t*)&ResponseBuffer; + ResponsePowerOff->CCIDHeader.MessageType = CCID_RDR_to_PC_SlotStatus; + ResponsePowerOff->CCIDHeader.Length = 0; + ResponsePowerOff->CCIDHeader.Slot = CCIDHeader.Slot; + ResponsePowerOff->CCIDHeader.Seq = CCIDHeader.Seq; + + ResponsePowerOff->ClockStatus = 0; + + Status = CALLBACK_CCID_IccPowerOff(CCIDInterfaceInfo, CCIDHeader.Slot, &Error); + + ResponsePowerOff->Status = Status; + ResponsePowerOff->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponsePowerOff, sizeof(USB_CCID_RDR_to_PC_SlotStatus_t), NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_GetSlotStatus: + { + USB_CCID_RDR_to_PC_SlotStatus_t* ResponseSlotStatus = (USB_CCID_RDR_to_PC_SlotStatus_t*)&ResponseBuffer; + ResponseSlotStatus->CCIDHeader.MessageType = CCID_RDR_to_PC_SlotStatus; + ResponseSlotStatus->CCIDHeader.Length = 0; + ResponseSlotStatus->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseSlotStatus->CCIDHeader.Seq = CCIDHeader.Seq; + + ResponseSlotStatus->ClockStatus = 0; + + Status = CALLBACK_CCID_GetSlotStatus(CCIDInterfaceInfo, CCIDHeader.Slot, &Error); + + ResponseSlotStatus->Status = Status; + ResponseSlotStatus->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseSlotStatus, sizeof(USB_CCID_RDR_to_PC_SlotStatus_t), NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_SetParameters: + { + uint8_t ProtocolNum = Endpoint_Read_8(); + uint8_t RFU = Endpoint_Read_16_LE(); + + (void)RFU; + + USB_CCID_RDR_to_PC_Parameters_t* ResponseParametersStatus = (USB_CCID_RDR_to_PC_Parameters_t*)&ResponseBuffer; + ResponseParametersStatus->CCIDHeader.MessageType = CCID_RDR_to_PC_Parameters; + ResponseParametersStatus->CCIDHeader.Length = 0; + ResponseParametersStatus->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseParametersStatus->CCIDHeader.Seq = CCIDHeader.Seq; + + if (ProtocolNum == CCID_PROTOCOLNUM_T0) + { + if (CCIDHeader.Length * sizeof(uint8_t) == sizeof(USB_CCID_ProtocolData_T0_t)) + { + + Endpoint_Read_Stream_LE(RequestBuffer, CCIDHeader.Length * sizeof(uint8_t), NULL); + Status = CALLBACK_CCID_SetParameters_T0(CCIDInterfaceInfo, CCIDHeader.Slot, &Error, (USB_CCID_ProtocolData_T0_t*) RequestBuffer); + if (CCID_CheckStatusNoError(Status)) + { + ResponseParametersStatus->CCIDHeader.Length = CCIDHeader.Length; + Status = CALLBACK_CCID_GetParameters_T0(CCIDInterfaceInfo, CCIDHeader.Slot, &Error, &ResponseParametersStatus->ProtocolNum, (USB_CCID_ProtocolData_T0_t*) &ResponseParametersStatus->ProtocolData); + } + } + else + { + // Unexpected length + Status = CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_PRESENTANDACTIVE; + } + } + else + { + ResponseParametersStatus->ProtocolNum = CCID_PROTOCOLNUM_T0; + + // For now, we don't support T=1 protocol + Error = CCID_ERROR_PARAMETERS_PROTOCOL_NOT_SUPPORTED; + Status = CCID_COMMANDSTATUS_ERROR | CCID_ICCSTATUS_PRESENTANDACTIVE; + } + + ResponseParametersStatus->Status = Status; + ResponseParametersStatus->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseParametersStatus, sizeof(USB_CCID_BulkMessage_Header_t) + 3 + ResponseParametersStatus->CCIDHeader.Length , NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_GetParameters: + { + USB_CCID_RDR_to_PC_Parameters_t* ResponseParametersStatus = (USB_CCID_RDR_to_PC_Parameters_t*)&ResponseBuffer; + ResponseParametersStatus->CCIDHeader.MessageType = CCID_RDR_to_PC_Parameters; + ResponseParametersStatus->CCIDHeader.Length = sizeof(USB_CCID_ProtocolData_T0_t); + ResponseParametersStatus->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseParametersStatus->CCIDHeader.Seq = CCIDHeader.Seq; + + Status = CALLBACK_CCID_GetParameters_T0(CCIDInterfaceInfo, CCIDHeader.Slot, &Error, &ResponseParametersStatus->ProtocolNum, (USB_CCID_ProtocolData_T0_t*) &ResponseParametersStatus->ProtocolData); + + ResponseParametersStatus->Status = Status; + ResponseParametersStatus->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseParametersStatus, sizeof(USB_CCID_BulkMessage_Header_t) + 3 + ResponseParametersStatus->CCIDHeader.Length , NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_XfrBlock: + { + uint8_t Bwi = Endpoint_Read_8(); + uint16_t LevelParameter = Endpoint_Read_16_LE(); + uint8_t ReceivedBuffer[0x4]; + + (void)Bwi; + (void)LevelParameter; + + Endpoint_Read_Stream_LE(ReceivedBuffer, sizeof(ReceivedBuffer), NULL); + + uint8_t ResponseDataLength = 0; + + USB_CCID_RDR_to_PC_DataBlock_t* ResponseBlock = (USB_CCID_RDR_to_PC_DataBlock_t*)&ResponseBuffer; + ResponseBlock->CCIDHeader.MessageType = CCID_RDR_to_PC_DataBlock; + ResponseBlock->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseBlock->CCIDHeader.Seq = CCIDHeader.Seq; + + ResponseBlock->ChainParam = 0; + + Status = CALLBACK_CCID_XfrBlock(CCIDInterfaceInfo, CCIDHeader.Slot, RequestBuffer, CCIDHeader.Length, (uint8_t*) &ResponseBlock->Data, &ResponseDataLength, &Error); + + if (CCID_CheckStatusNoError(Status) && !CCIDInterfaceInfo->State.Aborted) + { + ResponseBlock->CCIDHeader.Length = ResponseDataLength; + } + else if (CCIDInterfaceInfo->State.Aborted) + { + Status = CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_PRESENTANDACTIVE; + Error = CCID_ERROR_CMD_ABORTED; + ResponseDataLength = 0; + } + else + { + ResponseDataLength = 0; + } + + ResponseBlock->Status = Status; + ResponseBlock->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseBlock, sizeof(USB_CCID_RDR_to_PC_DataBlock_t) + ResponseDataLength, NULL); + Endpoint_ClearIN(); + break; + } + + case CCID_PC_to_RDR_Abort: + { + USB_CCID_RDR_to_PC_SlotStatus_t* ResponseAbort = (USB_CCID_RDR_to_PC_SlotStatus_t*)&ResponseBuffer; + ResponseAbort->CCIDHeader.MessageType = CCID_RDR_to_PC_SlotStatus; + ResponseAbort->CCIDHeader.Length = 0; + ResponseAbort->CCIDHeader.Slot = CCIDHeader.Slot; + ResponseAbort->CCIDHeader.Seq = CCIDHeader.Seq; + + ResponseAbort->ClockStatus = 0; + + Status = CALLBACK_CCID_Abort(CCIDInterfaceInfo, CCIDHeader.Slot, CCIDHeader.Seq, &Error); + + ResponseAbort->Status = Status; + ResponseAbort->Error = Error; + + Endpoint_ClearOUT(); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseAbort, sizeof(USB_CCID_RDR_to_PC_SlotStatus_t), NULL); + Endpoint_ClearIN(); + break; + } + + default: + { + memset(ResponseBuffer, 0x00, sizeof(ResponseBuffer)); + + Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address); + Endpoint_Write_Stream_LE(ResponseBuffer, sizeof(ResponseBuffer), NULL); + Endpoint_ClearIN(); + break; + } + } + } +} + +#endif diff --git a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h new file mode 100644 index 000000000..44d6fb026 --- /dev/null +++ b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h @@ -0,0 +1,233 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2019. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Filipe Rodrigues (filipepazrodrigues [at] gmail [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 Device mode driver for the library USB CCID Class driver. + * + * Device mode driver for the library USB CCID Class driver. + * + * \note This file should not be included directly. It is automatically included as needed by the USB module driver + * dispatch header located in LUFA/Drivers/USB.h. + */ + +/** \ingroup Group_USBClassCCID + * \defgroup Group_USBClassCCIDDevice CCID Class Device Mode Driver + * + * \section Sec_USBClassCCIDDevice_Dependencies Module Source Dependencies + * The following files must be built with any user project that uses this module: + * - LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c <i>(Makefile source module name: LUFA_SRC_USBCLASS)</i> + * + * \section Sec_USBClassCCIDDevice_ModDescription Module Description + * Device Mode USB Class driver framework interface, for the CCID USB Class driver. + * + * @{ + */ + +#ifndef _CCID_CLASS_DEVICE_H_ +#define _CCID_CLASS_DEVICE_H_ + + /* Includes: */ + #include "../../USB.h" + #include "../Common/CCIDClassCommon.h" + + /* Public Interface - May be used in end-application: */ + /* Type Defines: */ + /** \brief CCID Class Device Mode Configuration and State Structure. + * + * Class state structure. An instance of this structure should be made for each CCID interface + * within the user application, and passed to each of the CCID class driver functions as the + * CCIDInterfaceInfo parameter. This stores each CCID interface's configuration and state information. + */ + typedef struct + { + struct + { + uint8_t InterfaceNumber; /**< Interface number of the CCID interface within the device. */ + uint8_t TotalSlots; /**< Total of slots no this device. */ + USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */ + USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */ + } Config; /**< Config data for the USB class interface within the device. All elements in this section + * <b>must</b> be set or the interface will fail to enumerate and operate correctly. + */ + struct + { + bool Aborted; //< Set if host has started an abort process + uint8_t AbortedSeq; //< Sequence number for the current abort process + } State; /**< State data for the USB class interface within the device. All elements in this section + * are reset to their defaults when the interface is enumerated. + */ + USB_CCID_ProtocolData_T0_t ProtocolData; + } USB_ClassInfo_CCID_Device_t; + + /* Function Prototypes: */ + /** Configures the endpoints of a given CCID interface, ready for use. This should be linked to the library + * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing + * the given CCID interface is selected. + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration. + * + * \return Boolean \c true if the endpoints were successfully configured, \c false otherwise. + */ + bool CCID_Device_ConfigureEndpoints(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); + + /** Processes incoming control requests from the host, that are directed to the given CCID class interface. This should be + * linked to the library \ref EVENT_USB_Device_ControlRequest() event. + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + */ + void CCID_Device_ProcessControlRequest(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); + + /** General management task for a given CCID class interface, required for the correct operation of the interface. This should + * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask(). + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + */ + void CCID_Device_USBTask(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for PC_TO_RDR_IccPowerOn CCID message + * When the ICC is inserted into a slot of a CCID, the CCID can activate the ICC, and the ICC will respond with an ATR + * (answer to reset) + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + * \param[in] Slot The slot ID currently being powered on. + * \param[in,out] Atr Pointer to an array containing the Power On ATR being sent to the device. + * \param[out] AtrSize The size of the ATR being sent (up to 15 bytes maximum). + * \param[out] Error The result of the operation, or error. + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + uint8_t* const Atr, + uint8_t* const AtrSize, + uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for PC_TO_RDR_IccPowerOff CCID message + * Turns off the ICC + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + * \param[in] Slot The slot ID currently being powered off. + * \param[out] Error The result of the operation, or error. + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for PC_TO_RDR_GetSlotStatus CCID message + * Retrieves the current status of a given slot + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + * \param[in] Slot The slot ID from which we want to retrieve the status. + * \param[out] Error The result of the operation, or error. + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1); + + + /** CCID class driver callback for PC_TO_RDR_SetParameters CCID message for T=0 + * Sets the current parameters of a given slot + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration, state and protocol data. + * \param[in] Slot The slot ID from which we want to retrieve the status. + * \param[out] Error The result of the operation, or error. + * \param[out] T0 Pointer to a buffer containing the new parameters + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_SetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + uint8_t* const Error, + USB_CCID_ProtocolData_T0_t* const T0) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for PC_TO_RDR_SetParameters CCID message for T=0 + * Retrieves the current parameters of a given slot + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration, state and protocol data. + * \param[in] Slot The slot ID from which we want to retrieve the status. + * \param[out] Error The result of the operation, or error. + * \param[out] ProtocolNum The CCID protocol ID of the parameter being retrieved. + * \param[out] T0 Pointer to a buffer where the parameters will be returned + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_GetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + uint8_t* const Error, + uint8_t* const ProtocolNum, + USB_CCID_ProtocolData_T0_t* const T0) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for PC_TO_RDR_XfrBlock CCID message + * Send a block of bytes from the host to a slot in the device + * and also received a block of bytes as a response + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + * \param[in] Slot The slot ID from which we want to retrieve the status. + * \param[in] ReceivedBuffer Pointer to an array holding the received block of bytes + * \param[in] ReceivedBufferSize The size of the received block of bytes + * \param[out] SendBuffer Pointer to a buffer which will hold the bytes being sent back to the host + * \param[out] SentBufferSize The size of the block of bytes being sent back to the host + * \param[out] Error The result of the operation, or error. + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + const uint8_t* ReceivedBuffer, + const uint8_t ReceivedBufferSize, + uint8_t* const SendBuffer, + uint8_t* const SentBufferSize, + uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1); + + /** CCID class driver callback for CCID_PC_to_RDR_Abort CCID message + * Aborts a BULK out message previously sent to a slot + * + * \param[in,out] CCIDInterfaceInfo Pointer to a structure containing a CCID Class configuration and state. + * \param[in] Slot The slot ID to where the message being aborted was sent to. + * \param[in] Seq The current sequence number for this message. Must be checked against + * the current abort message being sent at the control pipe. + * \param[out] Error The result of the operation, or error. + * + * \return The command result code. + */ + uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, + const uint8_t Slot, + const uint8_t Seq, + uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1); + + +#endif + +/** @} */ diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index 867548c00..0d4e5c3b2 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -155,16 +155,6 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo return Endpoint_Write_Stream_LE(String, strlen(String), NULL); } -uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const char* const String) -{ - if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) - return ENDPOINT_RWSTREAM_DeviceDisconnected; - - Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); - return Endpoint_Write_PStream_LE(String, strlen_P(String), NULL); -} - uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const void* const Buffer, const uint16_t Length) @@ -176,16 +166,28 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, return Endpoint_Write_Stream_LE(Buffer, Length, NULL); } -uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) -{ - if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) - return ENDPOINT_RWSTREAM_DeviceDisconnected; +#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) + { + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; - Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); - return Endpoint_Write_PStream_LE(Buffer, Length, NULL); -} + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(String, strlen_P(String), NULL); + } + + uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) + { + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(Buffer, Length, NULL); + } +#endif uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data) @@ -306,57 +308,62 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC } #if defined(FDEV_SETUP_STREAM) -void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - FILE* const Stream) -{ - *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar, _FDEV_SETUP_RW); - fdev_set_udata(Stream, CDCInterfaceInfo); -} - -void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - FILE* const Stream) -{ - *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar_Blocking, _FDEV_SETUP_RW); - fdev_set_udata(Stream, CDCInterfaceInfo); -} + void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + FILE* const Stream) + { + *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar, _FDEV_SETUP_RW); + fdev_set_udata(Stream, CDCInterfaceInfo); + } -static int CDC_Device_putchar(char c, - FILE* Stream) -{ - return CDC_Device_SendByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : 0; -} + void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + FILE* const Stream) + { + *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar_Blocking, _FDEV_SETUP_RW); + fdev_set_udata(Stream, CDCInterfaceInfo); + } -static int CDC_Device_getchar(FILE* Stream) -{ - int16_t ReceivedByte = CDC_Device_ReceiveByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream)); + static int CDC_Device_putchar(char c, + FILE* Stream) + { + return CDC_Device_SendByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : c; + } - if (ReceivedByte < 0) - return _FDEV_EOF; + static int CDC_Device_getchar(FILE* Stream) + { + int16_t ReceivedByte = CDC_Device_ReceiveByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream)); - return ReceivedByte; -} + if (ReceivedByte < 0) + return _FDEV_EOF; -static int CDC_Device_getchar_Blocking(FILE* Stream) -{ - int16_t ReceivedByte; + return ReceivedByte; + } - while ((ReceivedByte = CDC_Device_ReceiveByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream))) < 0) + static int CDC_Device_getchar_Blocking(FILE* Stream) { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return _FDEV_EOF; + int16_t ReceivedByte; - CDC_Device_USBTask((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream)); - USB_USBTask(); - } + while ((ReceivedByte = CDC_Device_ReceiveByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream))) < 0) + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + return _FDEV_EOF; - return ReceivedByte; -} + CDC_Device_USBTask((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream)); + USB_USBTask(); + } + + return ReceivedByte; + } #endif -void CDC_Device_Event_Stub(void) +void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) { } +void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1) +{ + CDC_Device_Event_Stub(CDCInterfaceInfo); +} + #endif diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h index 9d5c4e5a0..1a9b211d9 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -182,42 +182,6 @@ void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1); - /** Sends a given data buffer to the attached USB host, if connected. If a host is not connected when the function is - * called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint bank - * becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows - * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. - * - * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or - * the call will fail. - * - * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. - * \param[in] Buffer Pointer to a buffer containing the data to send to the device. - * \param[in] Length Length of the data to send to the host. - * - * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. - */ - uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); - - /** Sends a given data buffer from PROGMEM space to the attached USB host, if connected. If a host is not connected when the - * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint - * bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows - * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. - * - * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or - * the call will fail. - * - * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. - * \param[in] Buffer Pointer to a buffer containing the data to send to the device. - * \param[in] Length Length of the data to send to the host. - * - * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. - */ - uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); - /** Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when * the function is called, the string is discarded. Bytes will be queued for transmission to the host until either * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to @@ -234,21 +198,65 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); - /** Sends a given null terminated string from PROGMEM space to the attached USB host, if connected. If a host is not connected - * when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either - * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to - * the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + /** Sends a given data buffer to the attached USB host, if connected. If a host is not connected when the function is + * called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint bank + * becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows + * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. * * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or * the call will fail. * * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. - * \param[in] String Pointer to the null terminated string to send to the host. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. * * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. */ - uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + + #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + /** Sends a given null terminated string from PROGMEM space to the attached USB host, if connected. If a host is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either + * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to + * the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \note This function does not exist on architectures that do not have a separate flash memory space. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + #endif + + #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + /** Sends a given data buffer from PROGMEM space to the attached USB host, if connected. If a host is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint + * bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows + * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \note This function does not exist on architectures that do not have a separate flash memory space. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + #endif /** Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the @@ -362,7 +370,8 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Device_Event_Stub(void) ATTR_CONST; + void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); + void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1); void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); @@ -370,7 +379,7 @@ ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) - ATTR_ALIAS(CDC_Device_Event_Stub); + ATTR_ALIAS(CDC_Device_Event_Stub_2); #endif #endif diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c index a8a6e8b50..9c6a49236 100644 --- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h index ae628c87d..1f6163027 100644 --- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c index a35c4082b..59dfb1284 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h index ee2efd7c1..8a1fee1b1 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c index 1ea30f7cb..c7dcab5c7 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h index 12b54f8df..29a8bc831 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c b/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c index 7209c452d..de5e49ec6 100644 --- a/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -305,7 +305,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) } #endif -void PRNT_Device_Event_Stub(void) +void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) { } diff --git a/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h b/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h index 802c5912d..020043d6d 100644 --- a/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -273,7 +273,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void PRNT_Device_Event_Stub(void) ATTR_CONST; + void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo); void EVENT_PRNT_Device_SoftReset(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(PRNT_Device_Event_Stub); diff --git a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c index 45293b12f..6ee8d495d 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h index 761bc2790..ad271bda4 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/HIDClass.h b/LUFA/Drivers/USB/Class/HIDClass.h index 158eb256b..a7cd55b15 100644 --- a/LUFA/Drivers/USB/Class/HIDClass.h +++ b/LUFA/Drivers/USB/Class/HIDClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c index ea8903366..eb002b5cf 100644 --- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h index f4f04e445..f9a0b5a0c 100644 --- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c index 9f1a6dc2c..5ecda592f 100644 --- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h index f1f4207f1..030099ca0 100644 --- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c index af9ed96e2..9b55b549d 100644 --- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -276,9 +276,8 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, return USB_Host_SendControlRequest(NULL); } -uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) +uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) { if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) return PIPE_READYWAIT_DeviceDisconnected; @@ -288,13 +287,13 @@ uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); Pipe_Unfreeze(); - ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NULL); + ErrorCode = Pipe_Write_Stream_LE(String, strlen(String), NULL); Pipe_Freeze(); return ErrorCode; } -uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, +uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const void* const Buffer, const uint16_t Length) { @@ -306,45 +305,48 @@ uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); Pipe_Unfreeze(); - ErrorCode = Pipe_Write_PStream_LE(Buffer, Length, NULL); + ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NULL); Pipe_Freeze(); return ErrorCode; } -uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const char* const String) -{ - if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) - return PIPE_READYWAIT_DeviceDisconnected; +#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) + { + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; - uint8_t ErrorCode; + uint8_t ErrorCode; - Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); - Pipe_Unfreeze(); - ErrorCode = Pipe_Write_Stream_LE(String, strlen(String), NULL); - Pipe_Freeze(); + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(String, strlen_P(String), NULL); + Pipe_Freeze(); - return ErrorCode; -} + return ErrorCode; + } -uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const char* const String) -{ - if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) - return PIPE_READYWAIT_DeviceDisconnected; + uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) + { + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; - uint8_t ErrorCode; + uint8_t ErrorCode; - Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); - Pipe_Unfreeze(); - ErrorCode = Pipe_Write_PStream_LE(String, strlen_P(String), NULL); - Pipe_Freeze(); + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(Buffer, Length, NULL); + Pipe_Freeze(); - return ErrorCode; -} + return ErrorCode; + } +#endif uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) @@ -456,54 +458,54 @@ uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) } #if defined(FDEV_SETUP_STREAM) -void CDC_Host_CreateStream(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - FILE* const Stream) -{ - *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Host_putchar, CDC_Host_getchar, _FDEV_SETUP_RW); - fdev_set_udata(Stream, CDCInterfaceInfo); -} - -void CDC_Host_CreateBlockingStream(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - FILE* const Stream) -{ - *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Host_putchar, CDC_Host_getchar_Blocking, _FDEV_SETUP_RW); - fdev_set_udata(Stream, CDCInterfaceInfo); -} + void CDC_Host_CreateStream(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + FILE* const Stream) + { + *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Host_putchar, CDC_Host_getchar, _FDEV_SETUP_RW); + fdev_set_udata(Stream, CDCInterfaceInfo); + } -static int CDC_Host_putchar(char c, - FILE* Stream) -{ - return CDC_Host_SendByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : 0; -} + void CDC_Host_CreateBlockingStream(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + FILE* const Stream) + { + *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Host_putchar, CDC_Host_getchar_Blocking, _FDEV_SETUP_RW); + fdev_set_udata(Stream, CDCInterfaceInfo); + } -static int CDC_Host_getchar(FILE* Stream) -{ - int16_t ReceivedByte = CDC_Host_ReceiveByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream)); + static int CDC_Host_putchar(char c, + FILE* Stream) + { + return CDC_Host_SendByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : 0; + } - if (ReceivedByte < 0) - return _FDEV_EOF; + static int CDC_Host_getchar(FILE* Stream) + { + int16_t ReceivedByte = CDC_Host_ReceiveByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream)); - return ReceivedByte; -} + if (ReceivedByte < 0) + return _FDEV_EOF; -static int CDC_Host_getchar_Blocking(FILE* Stream) -{ - int16_t ReceivedByte; + return ReceivedByte; + } - while ((ReceivedByte = CDC_Host_ReceiveByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream))) < 0) + static int CDC_Host_getchar_Blocking(FILE* Stream) { - if (USB_HostState == HOST_STATE_Unattached) - return _FDEV_EOF; + int16_t ReceivedByte; - CDC_Host_USBTask((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream)); - USB_USBTask(); - } + while ((ReceivedByte = CDC_Host_ReceiveByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream))) < 0) + { + if (USB_HostState == HOST_STATE_Unattached) + return _FDEV_EOF; - return ReceivedByte; -} + CDC_Host_USBTask((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream)); + USB_USBTask(); + } + + return ReceivedByte; + } #endif -void CDC_Host_Event_Stub(void) +void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) { } diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h index 86ce6def3..1ea377982 100644 --- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -183,42 +183,6 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1); - /** Sends a given data buffer to the attached USB device, if connected. If a device is not connected when the function is - * called, the data will be discarded. Bytes will be queued for transmission to the device until either the pipe bank - * becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows for - * multiple bytes to be packed into a single pipe packet, increasing data throughput. - * - * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the - * call will fail. - * - * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. - * \param[in] Buffer Pointer to a buffer containing the data to send to the device. - * \param[in] Length Length of the data to send to the device. - * - * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. - */ - uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); - - /** Sends a given data buffer from PROGMEM space to the attached USB device, if connected. If a device is not connected when the - * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the pipe - * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows - * for multiple bytes to be packed into a single pipe packet, increasing data throughput. - * - * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or - * the call will fail. - * - * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. - * \param[in] Buffer Pointer to a buffer containing the data to send to the device. - * \param[in] Length Length of the data to send to the host. - * - * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. - */ - uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const void* const Buffer, - const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); - /** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the * function is called, the string is discarded. Bytes will be queued for transmission to the device until either the pipe * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows @@ -235,21 +199,65 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); - /** Sends a given null terminated string from PROGMEM space to the attached USB device, if connected. If a device is not connected - * when the function is called, the string is discarded. Bytes will be queued for transmission to the device until either - * the pipe bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to - * the device. This allows for multiple bytes to be packed into a single pipe packet, increasing data throughput. + /** Sends a given data buffer to the attached USB device, if connected. If a device is not connected when the function is + * called, the data will be discarded. Bytes will be queued for transmission to the device until either the pipe bank + * becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows for + * multiple bytes to be packed into a single pipe packet, increasing data throughput. * - * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or - * the call will fail. + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the + * call will fail. * * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. - * \param[in] String Pointer to the null terminated string to send to the host. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the device. * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. */ - uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, - const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + + #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + /** Sends a given null terminated string from PROGMEM space to the attached USB device, if connected. If a device is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the device until either + * the pipe bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to + * the device. This allows for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \note This function does not exist on architectures that do not have a separate flash memory space. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + #endif + + #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) + /** Sends a given data buffer from PROGMEM space to the attached USB device, if connected. If a device is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the pipe + * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows + * for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \note This function does not exist on architectures that do not have a separate flash memory space. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + #endif /** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the @@ -360,7 +368,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Host_Event_Stub(void) ATTR_CONST; + void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo); void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub); diff --git a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c index 32591ffd7..b46624a94 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -113,6 +113,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber; HIDInterfaceInfo->State.HIDReportSize = LE16_TO_CPU(HIDDescriptor->HIDReportLength); + HIDInterfaceInfo->State.DeviceUsesOUTPipe = DataOUTEndpoint; HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_CSCP_NonBootProtocol); HIDInterfaceInfo->State.LargestReportSize = 8; HIDInterfaceInfo->State.IsActive = true; diff --git a/LUFA/Drivers/USB/Class/Host/HIDClassHost.h b/LUFA/Drivers/USB/Class/Host/HIDClassHost.h index 73b5abb1b..27efdecb7 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/HIDClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c index 635148f5e..628427ae3 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h index 9cae21a1b..dd39e5ef0 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c index f7c5a6a73..df8a31f23 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h index 348050f8f..2680de938 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c index 8a04d0ab8..5d40168a5 100644 --- a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h index 511dab4b4..49214c414 100644 --- a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c index 6fb09fdab..3ce2ac7aa 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h index bddbc247a..15f902526 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c index ef33d9be4..04908e512 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h index ababdb09a..fd72424c8 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/MIDIClass.h b/LUFA/Drivers/USB/Class/MIDIClass.h index a35ae13aa..6099055ea 100644 --- a/LUFA/Drivers/USB/Class/MIDIClass.h +++ b/LUFA/Drivers/USB/Class/MIDIClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/MassStorageClass.h b/LUFA/Drivers/USB/Class/MassStorageClass.h index fa41fbf81..4347c8547 100644 --- a/LUFA/Drivers/USB/Class/MassStorageClass.h +++ b/LUFA/Drivers/USB/Class/MassStorageClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/PrinterClass.h b/LUFA/Drivers/USB/Class/PrinterClass.h index 78ad52068..4001dbd2b 100644 --- a/LUFA/Drivers/USB/Class/PrinterClass.h +++ b/LUFA/Drivers/USB/Class/PrinterClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/RNDISClass.h b/LUFA/Drivers/USB/Class/RNDISClass.h index 07b4f5627..94edae6ba 100644 --- a/LUFA/Drivers/USB/Class/RNDISClass.h +++ b/LUFA/Drivers/USB/Class/RNDISClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 diff --git a/LUFA/Drivers/USB/Class/StillImageClass.h b/LUFA/Drivers/USB/Class/StillImageClass.h index 7cb8b4fcf..1de47a662 100644 --- a/LUFA/Drivers/USB/Class/StillImageClass.h +++ b/LUFA/Drivers/USB/Class/StillImageClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 |