60 #define U32_LE(v) (uint32_t)(__rev(v))
61 #define U16_LE(v) (uint16_t)(__rev(v) >> 16)
62 #define U32_BE(v) (uint32_t)(v)
63 #define U16_BE(v) (uint16_t)(v)
65 #define U32_BE(v) (uint32_t)(__rev(v))
66 #define U16_BE(v) (uint16_t)(__rev(v) >> 16)
67 #define U32_LE(v) (uint32_t)(v)
68 #define U16_LE(v) (uint16_t)(v)
82 #define USBD_MSC_MEDIA_READY (1U)
83 #define USBD_MSC_MEDIA_PROTECTED (1U<<1)
93 typedef struct _usbd_msc_data_t {
114 typedef struct _usbd_msc_t {
121 uint32_t bulk_buf_sz;
122 uint16_t max_packet_size[2];
123 uint8_t *inquiry_data;
137 uint8_t bEndpointAddress;
138 uint8_t bmAttributes;
139 uint16_t wMaxPacketSize;
141 uint32_t transferred;
155 uint8_t configured : 1;
156 uint8_t initialized : 1;
158 uint8_t max_packet_size;
162 uint8_t class_custom;
163 uint8_t class_instance;
164 uint8_t class_driver;
165 uint8_t dev_desc_len;
166 uint8_t cfg_desc_len;
167 osThreadId recovery_thread_id;
176 extern const uint8_t usbh_cls_num;
473 bool USBD_HIDn_SetReport (uint8_t rtype, uint8_t req, uint8_t rid,
const uint8_t *buf, int32_t len);
640 extern usbStatus
USBD_EndpointRead (uint8_t device, uint8_t ep_addr, uint8_t *buf, uint32_t len);
658 extern usbStatus
USBD_EndpointWrite (uint8_t device, uint8_t ep_addr,
const uint8_t *buf, uint32_t len);
717 extern usbStatus
USBH_MSC_Read (uint8_t instance, uint32_t lba, uint32_t cnt, uint8_t *buf);
725 extern usbStatus
USBH_MSC_Write (uint8_t instance, uint32_t lba, uint32_t cnt,
const uint8_t *buf);
732 extern usbStatus
USBH_MSC_ReadCapacity (uint8_t instance, uint32_t *block_count, uint32_t *block_size);
749 extern int32_t
USBH_HID_Read (uint8_t instance, uint8_t *buf, int32_t len);
758 extern int32_t
USBH_HID_Write (uint8_t instance,
const uint8_t *buf, int32_t len);
768 typedef struct _usbHID_MouseState {
805 extern usbStatus
USBH_CDC_ACM_Send (uint8_t instance,
const uint8_t *data, uint32_t num);
872 extern usbStatus USBH_CustomClass_GetDeviceStatus (uint8_t instance);
916 extern USBH_PIPE *
USBH_PipeCreate (uint8_t ctrl, uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_max_packet_size, uint8_t ep_interval);
927 extern usbStatus
USBH_PipeModify (uint8_t ctrl,
USBH_PIPE *ptr_pipe, uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint16_t ep_max_packet_size);
1057 extern usbStatus
USBH_DeviceRequest_GetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length);
1068 extern usbStatus
USBH_DeviceRequest_SetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length);