usb/microsoft: Implemented more of the descriptor structures
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
5ba3293da2
commit
08293b8e0c
@@ -41,6 +41,8 @@ LGPL License Terms @ref lgpl_license
|
|||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
#include <libopencm3/usb/bos.h>
|
#include <libopencm3/usb/bos.h>
|
||||||
|
|
||||||
|
BEGIN_DECLS
|
||||||
|
|
||||||
enum microsoft_req {
|
enum microsoft_req {
|
||||||
MICROSOFT_GET_DESCRIPTOR_SET = 7,
|
MICROSOFT_GET_DESCRIPTOR_SET = 7,
|
||||||
MICROSOFT_SET_ALTERNATE_ENUM = 8,
|
MICROSOFT_SET_ALTERNATE_ENUM = 8,
|
||||||
@@ -88,11 +90,41 @@ typedef struct __attribute__((packed)) microsoft_os_descriptor_set_information {
|
|||||||
|
|
||||||
#define MICROSOFT_OS_DESCRIPTOR_SET_INFORMATION_SIZE sizeof(microsoft_os_descriptor_set_information)
|
#define MICROSOFT_OS_DESCRIPTOR_SET_INFORMATION_SIZE sizeof(microsoft_os_descriptor_set_information)
|
||||||
|
|
||||||
typedef struct __attribute__((packed)) microsoft_os_descriptor_set_header {
|
typedef struct microsoft_os_descriptor_function_subset_header {
|
||||||
|
uint16_t wLength;
|
||||||
|
uint16_t wDescriptorType;
|
||||||
|
uint8_t bFirstInterface;
|
||||||
|
uint8_t bReserved;
|
||||||
|
uint16_t wTotalLength;
|
||||||
|
} microsoft_os_descriptor_function_subset_header;
|
||||||
|
|
||||||
|
#define MICROSOFT_OS_DESCRIPTOR_FUNCTION_SUBSET_HEADER_SIZE 8U
|
||||||
|
|
||||||
|
typedef struct microsoft_os_descriptor_config_subset_header {
|
||||||
|
uint16_t wLength;
|
||||||
|
uint16_t wDescriptorType;
|
||||||
|
uint8_t bConfigurationValue;
|
||||||
|
uint8_t bReserved;
|
||||||
|
uint16_t wTotalLength;
|
||||||
|
|
||||||
|
/* Descriptor ends here. The following are used internally: */
|
||||||
|
const microsoft_os_descriptor_function_subset_header *function_subset_headers;
|
||||||
|
uint8_t num_function_subset_headers;
|
||||||
|
} microsoft_os_descriptor_config_subset_header;
|
||||||
|
|
||||||
|
#define MICROSOFT_OS_DESCRIPTOR_CONFIG_SUBSET_HEADER_SIZE 8U
|
||||||
|
|
||||||
|
typedef struct microsoft_os_descriptor_set_header {
|
||||||
uint16_t wLength;
|
uint16_t wLength;
|
||||||
uint16_t wDescriptorType;
|
uint16_t wDescriptorType;
|
||||||
uint32_t dwWindowsVersion;
|
uint32_t dwWindowsVersion;
|
||||||
uint16_t wTotalLength;
|
uint16_t wTotalLength;
|
||||||
|
|
||||||
|
/* Descriptor ends here. The following are used internally: */
|
||||||
|
uint8_t vendor_code;
|
||||||
|
uint8_t num_config_subset_headers;
|
||||||
|
const microsoft_os_descriptor_config_subset_header *config_subset_headers;
|
||||||
|
|
||||||
} microsoft_os_descriptor_set_header;
|
} microsoft_os_descriptor_set_header;
|
||||||
|
|
||||||
#define MICROSOFT_OS_DESCRIPTOR_SET_HEADER_SIZE 10U
|
#define MICROSOFT_OS_DESCRIPTOR_SET_HEADER_SIZE 10U
|
||||||
@@ -100,6 +132,8 @@ typedef struct __attribute__((packed)) microsoft_os_descriptor_set_header {
|
|||||||
extern void microsoft_os_register_descriptor_sets(usbd_device *dev,
|
extern void microsoft_os_register_descriptor_sets(usbd_device *dev,
|
||||||
const microsoft_os_descriptor_set_header *sets, uint8_t num_sets);
|
const microsoft_os_descriptor_set_header *sets, uint8_t num_sets);
|
||||||
|
|
||||||
|
END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user