descriptors.h (2736B)
1 /* 2 MNT Reform 2.0 Keyboard Firmware 3 See keyboard.c for Copyright 4 SPDX-License-Identifier: MIT 5 */ 6 7 /** \file 8 * 9 * Header file for Descriptors.c. 10 */ 11 12 #ifndef _DESCRIPTORS_H_ 13 #define _DESCRIPTORS_H_ 14 15 /* Includes: */ 16 #include <avr/pgmspace.h> 17 18 #include <LUFA/Drivers/USB/USB.h> 19 20 /* Type Defines: */ 21 /** Type define for the device configuration descriptor structure. This must be defined in the 22 * application code, as the configuration descriptor contains several sub-descriptors which 23 * vary between devices, and which describe the device's usage to the host. 24 */ 25 typedef struct 26 { 27 USB_Descriptor_Configuration_Header_t Config; 28 29 // Keyboard HID Interface 30 USB_Descriptor_Interface_t HID1_KeyboardInterface; 31 USB_HID_Descriptor_HID_t HID1_KeyboardHID; 32 USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; 33 // Media Control HID Interface 34 USB_Descriptor_Interface_t HID2_MediaControlInterface; 35 USB_HID_Descriptor_HID_t HID2_MediaControlHID; 36 USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; 37 } USB_Descriptor_Configuration_t; 38 39 /** Enum for the device interface descriptor IDs within the device. Each interface descriptor 40 * should have a unique ID index associated with it, which can be used to refer to the 41 * interface from other descriptors. 42 */ 43 enum InterfaceDescriptors_t 44 { 45 INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */ 46 INTERFACE_ID_MediaControl = 1, /**< Media Control interface descriptor ID */ 47 }; 48 49 /** Enum for the device string descriptor IDs within the device. Each string descriptor should 50 * have a unique ID index associated with it, which can be used to refer to the string from 51 * other descriptors. 52 */ 53 enum StringDescriptors_t 54 { 55 STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ 56 STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ 57 STRING_ID_Product = 2, /**< Product string ID */ 58 }; 59 60 /* Macros: */ 61 /** Endpoint address of the Keyboard HID reporting IN endpoint. */ 62 #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) 63 64 /** Endpoint address of the Media Control HID reporting IN endpoint. */ 65 #define MEDIACONTROL_EPADDR (ENDPOINT_DIR_IN | 3) 66 67 /** Size in bytes of HID reporting IN endpoints. */ 68 #define HID_EPSIZE 8 69 70 /* Function Prototypes: */ 71 //uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, 72 // const uint16_t wIndex, 73 // const void** const DescriptorAddress) 74 // ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); 75 76 #endif