USB Component  Version 6.13.7
MDK Middleware for USB Device and Host Communication
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
rl_usb.h
1 /*------------------------------------------------------------------------------
2  * MDK Middleware - Component ::USB
3  * Copyright (c) 2004-2019 Arm Limited (or its affiliates). All rights reserved.
4  *------------------------------------------------------------------------------
5  * Name: rl_usb.h
6  * Purpose: USB User API
7  *----------------------------------------------------------------------------*/
8 
9 #ifndef __RL_USB_H__
10 #define __RL_USB_H__
11 
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 #include <stdbool.h>
19 
20 #include "usb_os.h"
21 #include "usb_compiler.h"
22 #include "usb_def.h"
23 #include "usb_cdc.h"
24 #include "usb_cdc_acm_rndis.h"
25 #include "usb_hid.h"
26 #include "usb_msc.h"
27 #include "usb_ms.h"
28 
29 
31 
33 typedef enum {
34  usbOK = 0U,
35 
38 
39  usbThreadError = 0x10U,
43 
56 
57  usbTransferStall = 0x40U,
59 
60  usbUnknownError = 0xFFU
61 } usbStatus;
62 
64 #ifdef __BIG_ENDIAN
65  #define U32_LE(v) (uint32_t)(__REV(v))
66  #define U16_LE(v) (uint16_t)(__REV(v) >> 16)
67  #define U32_BE(v) (uint32_t)(v)
68  #define U16_BE(v) (uint16_t)(v)
69 #else
70  #define U32_BE(v) (uint32_t)(__REV(v))
71  #define U16_BE(v) (uint16_t)(__REV(v) >> 16)
72  #define U32_LE(v) (uint32_t)(v)
73  #define U16_LE(v) (uint16_t)(v)
74 #endif
75 
76 // ==== USB Device Constants and Defines ====
77 
79 typedef enum {
85 
87 #define USBD_MSC_MEDIA_READY (1UL)
88 #define USBD_MSC_MEDIA_PROTECTED (1UL<<1)
89 
90 typedef enum {
96 
98 typedef enum {
99  usbdThreadCore = 0U,
100  usbdThreadCC,
101  usbdThreadADC,
102  usbdThreadCDC_Int,
103  usbdThreadCDC_Bulk,
104  usbdThreadHID,
105  usbdThreadMSC
106 } usbdThread_t;
107 
109 typedef enum {
110  usbdSemaphoreCore = 0U,
111  usbdSemaphoreEndpoint,
112  usbdSemaphoreHID
113 } usbdSemaphore_t;
114 
115 /* USB Device State structure */
117 typedef struct {
118  uint32_t vbus : 1;
119  uint32_t speed : 2;
120  uint32_t active : 1;
121  uint32_t reserved : 28;
122 } USBD_STATE;
124 
125 /* USB Host Constants and Defines */
126 
128 typedef enum {
129  USBH_NOTIFY_CONNECT = 0U,
130  USBH_NOTIFY_DISCONNECT,
131  USBH_NOTIFY_OVERCURRENT,
132  USBH_NOTIFY_REMOTE_WAKEUP,
133  USBH_NOTIFY_READY,
134  USBH_NOTIFY_UNKNOWN_DEVICE,
135  USBH_NOTIFY_INSUFFICIENT_POWER,
136  USBH_NOTIFY_CONFIGURATION_FAILED,
137  USBH_NOTIFY_INITIALIZATION_FAILED
138 } USBH_NOTIFY;
139 
140 /* USB Host Pipe handle type */
141 typedef uint32_t USBH_PIPE_HANDLE;
142 
144 typedef enum {
145  usbhThreadCore = 0U,
146  usbhThreadCDC,
147  usbhThreadHID
148 } usbhThread_t;
149 
151 typedef enum {
152  usbhMutexCore = 0U
153 } usbhMutex_t;
154 
156 typedef enum {
157  usbhSemaphoreCore = 0U
158 } usbhSemaphore_t;
159 
161 typedef struct {
162  uint8_t reserved;
163  uint8_t button;
164  int16_t x;
165  int16_t y;
167 
168 
169 // ==== USB Device Functions ====
170 
173 extern uint32_t USBD_GetVersion (void);
174 
178 extern usbStatus USBD_Initialize (uint8_t device);
179 
183 extern usbStatus USBD_Uninitialize (uint8_t device);
184 
188 extern usbStatus USBD_Connect (uint8_t device);
189 
193 extern usbStatus USBD_Disconnect (uint8_t device);
194 
200 extern bool USBD_Configured (uint8_t device);
201 
205 extern USBD_STATE USBD_GetState (uint8_t device);
206 
211 extern usbStatus USBD_SetSerialNumber (uint8_t device, const char *string);
212 
213 #ifdef __DOXYGEN__
214 
215 // following functions are available for each instance of a Device.
216 // generic prefix USBD_Devicen is USBD_Device0 for Device instance 0.
217 
220 void USBD_Devicen_Initialize (void);
221 
224 void USBD_Devicen_Uninitialize (void);
225 
231 void USBD_Devicen_VbusChanged (bool level);
232 
235 void USBD_Devicen_Reset (void);
236 
240 
243 void USBD_Devicen_Suspended (void);
244 
247 void USBD_Devicen_Resumed (void);
248 
254 void USBD_Devicen_ConfigurationChanged (uint8_t val);
255 
259 
263 
272 usbdRequestStatus USBD_Devicen_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
273 
278 
286 usbdRequestStatus USBD_Devicen_Endpoint0_OutDataReceived (uint32_t len);
287 
295 usbdRequestStatus USBD_Devicen_Endpoint0_InDataSent (uint32_t len);
296 
297 #endif // __DOXYGEN
298 
299 // ==== USB Device Audio Device Functions ====
300 
301 #ifdef __DOXYGEN__
302 
303 // following functions are available for each instance of a ADC class.
304 // generic prefix USBD_ADCn is USBD_ADC0 for ADC class instance 0.
305 
308 void USBD_ADCn_Initialize (void);
309 
312 void USBD_ADCn_Uninitialize (void);
313 
316 void USBD_ADCn_PlayStart (void);
317 
320 void USBD_ADCn_PlayStop (void);
321 
331 void USBD_ADCn_SetSpeakerMute (uint8_t ch, bool on);
332 
340 void USBD_ADCn_SetSpeakerVolume (uint8_t ch, uint16_t vol);
341 
344 void USBD_ADCn_RecordStart (void);
345 
348 void USBD_ADCn_RecordStop (void);
349 
359 void USBD_ADCn_SetMicrophoneMute (uint8_t ch, bool on);
360 
368 void USBD_ADCn_SetMicrophoneVolume (uint8_t ch, uint16_t vol);
369 
372 void USBD_ADCn_ReceivedSamples (void);
373 
374 #endif // __DOXYGEN
375 
376 // Rename deprecated functions
377 #define USBD_ADC_SpeakerSetVolumeRange USBD_ADC_SetSpeakerVolumeRange
378 #define USBD_ADC_MicrophoneSetVolumeRange USBD_ADC_SetMicrophoneVolumeRange
379 
391 extern usbStatus USBD_ADC_SetSpeakerVolumeRange (uint8_t instance, uint8_t ch, uint16_t min, uint16_t max, uint16_t res, uint16_t cur);
392 
404 extern usbStatus USBD_ADC_SetMicrophoneVolumeRange (uint8_t instance, uint8_t ch, uint16_t min, uint16_t max, uint16_t res, uint16_t cur);
405 
409 extern uint32_t USBD_ADC_ReceivedSamplesAvailable (uint8_t instance);
410 
414 extern uint32_t USBD_ADC_WrittenSamplesPending (uint8_t instance);
415 
423 extern int32_t USBD_ADC_ReadSamples (uint8_t instance, void *buf, int32_t num);
424 
432 extern int32_t USBD_ADC_WriteSamples (uint8_t instance, const void *buf, int32_t num);
433 
434 
435 // ==== USB Device Communication Device (Abstract Control Model) Functions ====
436 
437 #ifdef __DOXYGEN__
438 
439 // following functions are available for each instance of a CDC class.
440 // generic prefix USBD_CDCn is USBD_CDC0 for CDC class instance 0.
441 
444 void USBD_CDCn_ACM_Initialize (void);
445 
448 void USBD_CDCn_ACM_Uninitialize (void);
449 
452 void USBD_CDCn_ACM_Reset (void);
453 
460 bool USBD_CDCn_ACM_SendEncapsulatedCommand (const uint8_t *buf, uint16_t len);
461 
469 bool USBD_CDCn_ACM_GetEncapsulatedResponse (uint16_t max_len, uint8_t **buf, uint16_t *len);
470 
476 bool USBD_CDCn_ACM_SetLineCoding (const CDC_LINE_CODING *line_coding);
477 
483 bool USBD_CDCn_ACM_GetLineCoding (CDC_LINE_CODING *line_coding);
484 
492 bool USBD_CDCn_ACM_SetControlLineState (uint16_t state);
493 
497 void USBD_CDCn_ACM_DataReceived (uint32_t len);
498 
501 void USBD_CDCn_ACM_DataSent (void);
502 
505 void USBD_CDCn_NCM_Initialize (void);
506 
509 void USBD_CDCn_NCM_Uninitialize (void);
510 
513 void USBD_CDCn_NCM_Reset (void);
514 
517 void USBD_CDCn_NCM_Start (void);
518 
521 void USBD_CDCn_NCM_Stop (void);
522 
529 bool USBD_CDCn_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
530 
538 bool USBD_CDCn_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
539 
546 bool USBD_CDCn_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
547 
553 bool USBD_CDCn_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
554 
561 bool USBD_CDCn_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
562 
568 bool USBD_CDCn_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
569 
575 bool USBD_CDCn_NCM_GetNetAddress (uint8_t *net_addr);
576 
582 bool USBD_CDCn_NCM_SetNetAddress (const uint8_t *net_addr);
583 
589 bool USBD_CDCn_NCM_GetNtbFormat (uint16_t *ntb_format);
590 
598 bool USBD_CDCn_NCM_SetNtbFormat (uint16_t ntb_format);
599 
605 bool USBD_CDCn_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
606 
612 bool USBD_CDCn_NCM_SetNtbInputSize (uint32_t ntb_input_size);
613 
619 bool USBD_CDCn_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
620 
626 bool USBD_CDCn_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
627 
633 bool USBD_CDCn_NCM_GetCrcMode (uint16_t *crc_mode);
634 
642 bool USBD_CDCn_NCM_SetCrcMode (uint16_t crc_mode);
643 
646 void USBD_CDCn_NCM_NTB_IN_Sent (void);
647 
651 
652 #endif // __DOXYGEN
653 
654 // Rename deprecated functions
655 #define USBD_CDC_ACM_Notify USBD_CDC_ACM_Notify_SerialState
656 
662 extern int USBD_CDC_ACM_GetChar (uint8_t instance);
663 
670 extern int USBD_CDC_ACM_PutChar (uint8_t instance, int ch);
671 
679 extern int32_t USBD_CDC_ACM_ReadData (uint8_t instance, uint8_t *buf, int32_t len);
680 
688 extern int32_t USBD_CDC_ACM_WriteData (uint8_t instance, const uint8_t *buf, int32_t len);
689 
694 extern int32_t USBD_CDC_ACM_DataAvailable (uint8_t instance);
695 
707 extern usbStatus USBD_CDC_ACM_Notify_SerialState (uint8_t instance, uint16_t state);
708 
712 extern usbStatus USBD_CDC_ACM_Notify_ResponseAvailable (uint8_t instance);
713 
719 extern int32_t USBD_CDC_NCM_NTB_IN_Initialize (uint8_t instance);
720 
727 extern int32_t USBD_CDC_NCM_NTB_IN_CreateNDP (uint8_t instance, uint8_t num_datagrams);
728 
736 extern int32_t USBD_CDC_NCM_NTB_IN_WriteDatagram (uint8_t instance, const uint8_t *buf, uint32_t len);
737 
743 extern int32_t USBD_CDC_NCM_NTB_IN_Send (uint8_t instance);
744 
751 extern int32_t USBD_CDC_NCM_NTB_IN_IsSent (uint8_t instance);
752 
759 extern int32_t USBD_CDC_NCM_NTB_OUT_IsReceived (uint8_t instance);
760 
766 extern int32_t USBD_CDC_NCM_NTB_OUT_Release (uint8_t instance);
767 
773 extern int32_t USBD_CDC_NCM_NTB_OUT_ProcessNDP (uint8_t instance);
774 
778 extern uint32_t USBD_CDC_NCM_NTB_OUT_GetDatagramSize (uint8_t instance);
779 
787 extern int32_t USBD_CDC_NCM_NTB_OUT_ReadDatagram (uint8_t instance, uint8_t *buf, uint32_t max_len);
788 
796 extern int32_t USBD_CDC_NCM_NTB_IN_RawSend (uint8_t instance, const uint8_t *buf, uint32_t len);
797 
801 extern uint32_t USBD_CDC_NCM_NTB_OUT_RawGetSize (uint8_t instance);
802 
810 extern int32_t USBD_CDC_NCM_NTB_OUT_RawReceive (uint8_t instance, uint8_t *buf, uint32_t max_len);
811 
820 extern int32_t USBD_CDC_NCM_Notify_NetworkConnection (uint8_t instance, uint16_t status);
821 
829 extern int32_t USBD_CDC_NCM_Notify_ConnectionSpeedChange (uint8_t instance, uint32_t us_bitrate, uint32_t ds_bitrate);
830 
831 // ==== USB Device Human Interface Device Functions ====
832 
833 #ifdef __DOXYGEN__
834 
835 // following functions are available for each instance of a HID class.
836 // generic prefix USBD_HIDn is USBD_HID0 for HID class instance 0.
837 
840 void USBD_HIDn_Initialize (void);
841 
844 void USBD_HIDn_Uninitialize (void);
845 
859 int32_t USBD_HIDn_GetReport (uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf);
860 
874 bool USBD_HIDn_SetReport (uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len);
875 
876 #endif // __DOXYGEN
877 
884 extern usbStatus USBD_HID_GetReportTrigger (uint8_t instance, uint8_t rid, const uint8_t *buf, uint32_t len);
885 
886 
887 #ifdef __DOXYGEN__
888 
889 // ==== USB Device Mass Storage Device Functions ====
890 
891 // following functions are available for each instance of a MSC class.
892 // generic prefix USBD_MSCn is USBD_MSC0 for MSC class instance 0.
893 
896 void USBD_MSCn_Initialize (void);
897 
900 void USBD_MSCn_Uninitialize (void);
901 
908 bool USBD_MSCn_GetCacheInfo (uint32_t *buffer, uint32_t *size);
909 
916 bool USBD_MSCn_GetMediaCapacity (uint32_t *block_count, uint32_t *block_size);
917 
925 bool USBD_MSCn_Read (uint32_t lba, uint32_t cnt, uint8_t *buf);
926 
934 bool USBD_MSCn_Write (uint32_t lba, uint32_t cnt, const uint8_t *buf);
935 
944 uint32_t USBD_MSCn_CheckMedia (void);
945 
950 uint8_t USBD_MSCn_GetMaxLUN (void);
951 
959 bool USBD_MSCn_LUN_GetMediaCapacity (uint8_t lun, uint32_t *block_count, uint32_t *block_size);
960 
969 bool USBD_MSCn_LUN_Read (uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf);
970 
979 bool USBD_MSCn_LUN_Write (uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf);
980 
990 uint32_t USBD_MSCn_LUN_CheckMedia (uint8_t lun);
991 
992 #endif // __DOXYGEN
993 
994 
995 // ==== USB Device Custom Class Functions ====
996 
997 #ifdef __DOXYGEN__
998 
999 // following functions are available for each instance of a Custom class.
1000 // generic prefix USBD_CustomClassn is USBD_CustomClass0 for Custom class instance 0.
1001 
1004 void USBD_CustomClassn_Initialize (void);
1005 
1008 void USBD_CustomClassn_Uninitialize (void);
1009 
1012 void USBD_CustomClassn_Reset (void);
1013 
1019 void USBD_CustomClassn_EndpointStart (uint8_t ep_addr);
1020 
1026 void USBD_CustomClassn_EndpointStop (uint8_t ep_addr);
1027 
1036 usbdRequestStatus USBD_CustomClassn_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
1037 
1042 
1050 usbdRequestStatus USBD_CustomClassn_Endpoint0_OutDataReceived (uint32_t len);
1051 
1059 usbdRequestStatus USBD_CustomClassn_Endpoint0_InDataSent (uint32_t len);
1060 
1066 void USBD_CustomClassn_Endpoint1_Event (uint32_t event);
1067 void USBD_CustomClassn_Endpoint2_Event (uint32_t event);
1068 void USBD_CustomClassn_Endpoint3_Event (uint32_t event);
1069 void USBD_CustomClassn_Endpoint4_Event (uint32_t event);
1070 void USBD_CustomClassn_Endpoint5_Event (uint32_t event);
1071 void USBD_CustomClassn_Endpoint6_Event (uint32_t event);
1072 void USBD_CustomClassn_Endpoint7_Event (uint32_t event);
1073 void USBD_CustomClassn_Endpoint8_Event (uint32_t event);
1074 void USBD_CustomClassn_Endpoint9_Event (uint32_t event);
1075 void USBD_CustomClassn_Endpoint10_Event (uint32_t event);
1076 void USBD_CustomClassn_Endpoint11_Event (uint32_t event);
1077 void USBD_CustomClassn_Endpoint12_Event (uint32_t event);
1078 void USBD_CustomClassn_Endpoint13_Event (uint32_t event);
1079 void USBD_CustomClassn_Endpoint14_Event (uint32_t event);
1080 void USBD_CustomClassn_Endpoint15_Event (uint32_t event);
1081 
1082 #endif // __DOXYGEN
1083 
1092 extern usbStatus USBD_EndpointRead (uint8_t device, uint8_t ep_addr, uint8_t *buf, uint32_t len);
1093 
1100 extern uint32_t USBD_EndpointReadGetResult (uint8_t device, uint8_t ep_addr);
1101 
1110 extern usbStatus USBD_EndpointWrite (uint8_t device, uint8_t ep_addr, const uint8_t *buf, uint32_t len);
1111 
1118 extern uint32_t USBD_EndpointWriteGetResult (uint8_t device, uint8_t ep_addr);
1119 
1129 extern usbStatus USBD_EndpointStall (uint8_t device, uint8_t ep_addr, bool stall);
1130 
1137 extern usbStatus USBD_EndpointAbort (uint8_t device, uint8_t ep_addr);
1138 
1139 
1140 // ==== USB Host Functions ====
1141 
1142 // Rename deprecated functions
1143 #define USBH_GetDeviceStatus USBH_Device_GetStatus
1144 
1147 extern uint32_t USBH_GetVersion (void);
1148 
1152 extern usbStatus USBH_Initialize (uint8_t ctrl);
1153 
1157 extern usbStatus USBH_Uninitialize (uint8_t ctrl);
1158 
1163 extern usbStatus USBH_Port_Suspend (uint8_t ctrl, uint8_t port);
1164 
1169 extern usbStatus USBH_Port_Resume (uint8_t ctrl, uint8_t port);
1170 
1176 extern uint8_t USBH_Device_GetController (uint8_t device);
1177 
1183 extern uint8_t USBH_Device_GetPort (uint8_t device);
1184 
1188 extern usbStatus USBH_Device_GetStatus (uint8_t device);
1189 
1196 extern int32_t USBH_Device_GetSpeed (uint8_t device);
1197 
1203 extern uint8_t USBH_Device_GetAddress (uint8_t device);
1204 
1208 extern uint16_t USBH_Device_GetVID (uint8_t device);
1209 
1213 extern uint16_t USBH_Device_GetPID (uint8_t device);
1214 
1222 extern usbStatus USBH_Device_GetStringDescriptor (uint8_t device, uint8_t index, uint16_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length);
1223 
1240 extern void USBH_Notify (uint8_t ctrl, uint8_t port, uint8_t device, USBH_NOTIFY notify);
1241 
1242 
1243 // ==== USB Host Mass Storage Functions ====
1244 
1245 // Rename deprecated functions
1246 #define USBH_MSC_GetDeviceStatus USBH_MSC_GetStatus
1247 
1251 extern void USBH_MSC_Initialize (uint8_t instance);
1252 
1256 extern void USBH_MSC_Uninitialize (uint8_t instance);
1257 
1263 extern uint8_t USBH_MSC_GetDevice (uint8_t instance);
1264 
1268 extern usbStatus USBH_MSC_GetStatus (uint8_t instance);
1269 
1276 extern usbStatus USBH_MSC_Read (uint8_t instance, uint32_t lba, uint32_t cnt, uint8_t *buf);
1277 
1284 extern usbStatus USBH_MSC_Write (uint8_t instance, uint32_t lba, uint32_t cnt, const uint8_t *buf);
1285 
1291 extern usbStatus USBH_MSC_ReadCapacity (uint8_t instance, uint32_t *block_count, uint32_t *block_size);
1292 
1293 
1294 // ==== USB Host Human Interface Device Functions ====
1295 
1296 // Rename deprecated functions
1297 #define USBH_HID_GetDeviceStatus USBH_HID_GetStatus
1298 
1302 extern void USBH_HID_Initialize (uint8_t instance);
1303 
1307 extern void USBH_HID_Uninitialize (uint8_t instance);
1308 
1314 extern uint8_t USBH_HID_GetDevice (uint8_t instance);
1315 
1319 extern usbStatus USBH_HID_GetStatus (uint8_t instance);
1320 
1328 extern int32_t USBH_HID_Read (uint8_t instance, uint8_t *buf, int32_t len);
1329 
1337 extern int32_t USBH_HID_Write (uint8_t instance, const uint8_t *buf, int32_t len);
1338 
1344 extern int USBH_HID_GetKeyboardKey (uint8_t instance);
1345 
1350 extern usbStatus USBH_HID_GetMouseState (uint8_t instance, usbHID_MouseState *state);
1351 
1357 extern void USBH_HID_ParseReportDescriptor (uint8_t instance, const uint8_t *ptr_hid_report_desc, uint32_t len);
1358 
1363 extern void USBH_HID_DataReceived (uint8_t instance, uint32_t len);
1364 
1365 
1366 // ==== USB Host Communication Device Class (Abstract Control Model) Functions ====
1367 
1368 // Rename deprecated functions
1369 #define USBH_CDC_ACM_GetDeviceStatus USBH_CDC_ACM_GetStatus
1370 
1374 extern void USBH_CDC_ACM_Initialize (uint8_t instance);
1375 
1379 extern void USBH_CDC_ACM_Uninitialize (uint8_t instance);
1380 
1386 extern uint8_t USBH_CDC_ACM_GetDevice (uint8_t instance);
1387 
1391 extern usbStatus USBH_CDC_ACM_GetStatus (uint8_t instance);
1392 
1398 extern usbStatus USBH_CDC_ACM_Send (uint8_t instance, const uint8_t *data, uint32_t num);
1399 
1403 extern uint32_t USBH_CDC_ACM_GetTxCount (uint8_t instance);
1404 
1410 extern usbStatus USBH_CDC_ACM_Receive (uint8_t instance, uint8_t *data, uint32_t num);
1411 
1415 extern uint32_t USBH_CDC_ACM_GetRxCount (uint8_t instance);
1416 
1421 extern usbStatus USBH_CDC_ACM_SetLineCoding (uint8_t instance, const CDC_LINE_CODING *line_coding);
1422 
1427 extern usbStatus USBH_CDC_ACM_GetLineCoding (uint8_t instance, CDC_LINE_CODING *line_coding);
1428 
1435 extern usbStatus USBH_CDC_ACM_SetControlLineState (uint8_t instance, uint16_t state);
1436 
1449 extern void USBH_CDC_ACM_Notify (uint8_t instance, uint16_t status);
1450 
1457 extern usbStatus USBH_CDC_ACM_SendBreak (uint8_t instance, uint16_t duration);
1458 
1459 
1460 // ==== USB Host Custom Class Functions ====
1461 
1462 // Rename deprecated functions
1463 #define USBH_CustomClass_GetDeviceStatus USBH_CustomClass_GetStatus
1464 
1470 extern uint8_t USBH_CustomClass_GetDevice (uint8_t instance);
1471 
1475 extern usbStatus USBH_CustomClass_GetStatus (uint8_t instance);
1476 
1485 extern uint8_t USBH_CustomClass_Configure (uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc);
1486 
1491 extern usbStatus USBH_CustomClass_Unconfigure (uint8_t instance);
1492 
1497 extern usbStatus USBH_CustomClass_Initialize (uint8_t instance);
1498 
1503 extern usbStatus USBH_CustomClass_Uninitialize (uint8_t instance);
1504 
1516 extern USBH_PIPE_HANDLE USBH_PipeCreate (uint8_t device, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_max_packet_size, uint8_t ep_interval);
1517 
1521 extern usbStatus USBH_PipeUpdate (USBH_PIPE_HANDLE pipe_hndl);
1522 
1526 extern usbStatus USBH_PipeDelete (USBH_PIPE_HANDLE pipe_hndl);
1527 
1531 extern usbStatus USBH_PipeReset (USBH_PIPE_HANDLE pipe_hndl);
1532 
1538 extern usbStatus USBH_PipeReceive (USBH_PIPE_HANDLE pipe_hndl, uint8_t *buf, uint32_t len);
1539 
1543 extern uint32_t USBH_PipeReceiveGetResult (USBH_PIPE_HANDLE pipe_hndl);
1544 
1550 extern usbStatus USBH_PipeSend (USBH_PIPE_HANDLE pipe_hndl, const uint8_t *buf, uint32_t len);
1551 
1555 extern uint32_t USBH_PipeSendGetResult (USBH_PIPE_HANDLE pipe_hndl);
1556 
1560 extern usbStatus USBH_PipeAbort (USBH_PIPE_HANDLE pipe_hndl);
1561 
1568 extern usbStatus USBH_ControlTransfer (uint8_t device, const USB_SETUP_PACKET *setup_packet, uint8_t *data, uint32_t len);
1569 
1576 extern usbStatus USBH_DeviceRequest_GetStatus (uint8_t device, uint8_t recipient, uint8_t index, uint8_t *ptr_stat_dat);
1577 
1584 extern usbStatus USBH_DeviceRequest_ClearFeature (uint8_t device, uint8_t recipient, uint8_t index, uint8_t feature_selector);
1585 
1592 extern usbStatus USBH_DeviceRequest_SetFeature (uint8_t device, uint8_t recipient, uint8_t index, uint8_t feature_selector);
1593 
1598 extern usbStatus USBH_DeviceRequest_SetAddress (uint8_t device, uint8_t device_address);
1599 
1609 extern usbStatus USBH_DeviceRequest_GetDescriptor (uint8_t device, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint16_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length);
1610 
1620 extern usbStatus USBH_DeviceRequest_SetDescriptor (uint8_t device, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint16_t language_id, const uint8_t *descriptor_data, uint16_t descriptor_length);
1621 
1626 extern usbStatus USBH_DeviceRequest_GetConfiguration (uint8_t device, uint8_t *ptr_configuration);
1627 
1632 extern usbStatus USBH_DeviceRequest_SetConfiguration (uint8_t device, uint8_t configuration);
1633 
1639 extern usbStatus USBH_DeviceRequest_GetInterface (uint8_t device, uint8_t index, uint8_t *ptr_alternate);
1640 
1646 extern usbStatus USBH_DeviceRequest_SetInterface (uint8_t device, uint8_t index, uint8_t alternate);
1647 
1653 extern usbStatus USBH_DeviceRequest_SynchFrame (uint8_t device, uint8_t index, uint8_t *ptr_frame_number);
1654 
1655 
1656 // USB Device OS abstraction functions
1657 extern void *USBD_ThreadCreate (usbdThread_t thread, uint8_t index);
1658 extern int32_t USBD_ThreadTerminate (void *thread_hndl);
1659 
1660 extern int32_t USBD_Delay (uint32_t millisec);
1661 
1662 extern void *USBD_TimerCreate (uint8_t instance);
1663 extern int32_t USBD_TimerStart (void *timer_hndl, uint32_t millisec);
1664 extern int32_t USBD_TimerStop (void *timer_hndl);
1665 extern int32_t USBD_TimerDelete (void *timer_hndl);
1666 
1667 extern uint32_t USBD_ThreadFlagsSet (void *thread_hndl, uint32_t flags);
1668 extern uint32_t USBD_ThreadFlagsWait (uint32_t millisec);
1669 
1670 extern void *USBD_SemaphoreCreate (usbdSemaphore_t semaphore, uint8_t index1, uint8_t index2);
1671 extern int32_t USBD_SemaphoreAcquire (void *semaphore_hndl, uint32_t millisec);
1672 extern int32_t USBD_SemaphoreRelease (void *semaphore_hndl);
1673 extern int32_t USBD_SemaphoreDelete (void *semaphore_hndl);
1674 
1675 
1676 // USB Device user callback function prototypes
1677 extern void USBD_Device0_Initialize (void);
1678 extern void USBD_Device0_Uninitialize (void);
1679 extern void USBD_Device0_VbusChanged (bool level);
1680 extern void USBD_Device0_Reset (void);
1681 extern void USBD_Device0_HighSpeedActivated (void);
1682 extern void USBD_Device0_Suspended (void);
1683 extern void USBD_Device0_Resumed (void);
1684 extern void USBD_Device0_ConfigurationChanged (uint8_t val);
1685 extern void USBD_Device0_EnableRemoteWakeup (void);
1686 extern void USBD_Device0_DisableRemoteWakeup (void);
1687 extern usbdRequestStatus USBD_Device0_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
1688 extern void USBD_Device0_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
1689 extern usbdRequestStatus USBD_Device0_Endpoint0_OutDataReceived (uint32_t len);
1690 extern usbdRequestStatus USBD_Device0_Endpoint0_InDataSent (uint32_t len);
1691 
1692 extern void USBD_Device1_Initialize (void);
1693 extern void USBD_Device1_Uninitialize (void);
1694 extern void USBD_Device1_VbusChanged (bool level);
1695 extern void USBD_Device1_Reset (void);
1696 extern void USBD_Device1_HighSpeedActivated (void);
1697 extern void USBD_Device1_Suspended (void);
1698 extern void USBD_Device1_Resumed (void);
1699 extern void USBD_Device1_ConfigurationChanged (uint8_t val);
1700 extern void USBD_Device1_EnableRemoteWakeup (void);
1701 extern void USBD_Device1_DisableRemoteWakeup (void);
1702 extern usbdRequestStatus USBD_Device1_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
1703 extern void USBD_Device1_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
1704 extern usbdRequestStatus USBD_Device1_Endpoint0_OutDataReceived (uint32_t len);
1705 extern usbdRequestStatus USBD_Device1_Endpoint0_InDataSent (uint32_t len);
1706 
1707 extern void USBD_Device2_Initialize (void);
1708 extern void USBD_Device2_Uninitialize (void);
1709 extern void USBD_Device2_VbusChanged (bool level);
1710 extern void USBD_Device2_Reset (void);
1711 extern void USBD_Device2_HighSpeedActivated (void);
1712 extern void USBD_Device2_Suspended (void);
1713 extern void USBD_Device2_Resumed (void);
1714 extern void USBD_Device2_ConfigurationChanged (uint8_t val);
1715 extern void USBD_Device2_EnableRemoteWakeup (void);
1716 extern void USBD_Device2_DisableRemoteWakeup (void);
1717 extern usbdRequestStatus USBD_Device2_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
1718 extern void USBD_Device2_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
1719 extern usbdRequestStatus USBD_Device2_Endpoint0_OutDataReceived (uint32_t len);
1720 extern usbdRequestStatus USBD_Device2_Endpoint0_InDataSent (uint32_t len);
1721 
1722 extern void USBD_Device3_Initialize (void);
1723 extern void USBD_Device3_Uninitialize (void);
1724 extern void USBD_Device3_VbusChanged (bool level);
1725 extern void USBD_Device3_Reset (void);
1726 extern void USBD_Device3_HighSpeedActivated (void);
1727 extern void USBD_Device3_Suspended (void);
1728 extern void USBD_Device3_Resumed (void);
1729 extern void USBD_Device3_ConfigurationChanged (uint8_t val);
1730 extern void USBD_Device3_EnableRemoteWakeup (void);
1731 extern void USBD_Device3_DisableRemoteWakeup (void);
1732 extern usbdRequestStatus USBD_Device3_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
1733 extern void USBD_Device3_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
1734 extern usbdRequestStatus USBD_Device3_Endpoint0_OutDataReceived (uint32_t len);
1735 extern usbdRequestStatus USBD_Device3_Endpoint0_InDataSent (uint32_t len);
1736 
1737 extern void USBD_ADC0_Initialize (void);
1738 extern void USBD_ADC0_Uninitialize (void);
1739 extern void USBD_ADC0_PlayStart (void);
1740 extern void USBD_ADC0_PlayStop (void);
1741 extern void USBD_ADC0_SetSpeakerMute (uint8_t ch, bool on);
1742 extern void USBD_ADC0_SetSpeakerVolume (uint8_t ch, uint16_t vol);
1743 extern void USBD_ADC0_RecordStart (void);
1744 extern void USBD_ADC0_RecordStop (void);
1745 extern void USBD_ADC0_SetMicrophoneMute (uint8_t ch, bool on);
1746 extern void USBD_ADC0_SetMicrophoneVolume (uint8_t ch, uint16_t vol);
1747 extern void USBD_ADC0_ReceivedSamples (void);
1748 
1749 extern void USBD_ADC1_Initialize (void);
1750 extern void USBD_ADC1_Uninitialize (void);
1751 extern void USBD_ADC1_PlayStart (void);
1752 extern void USBD_ADC1_PlayStop (void);
1753 extern void USBD_ADC1_SetSpeakerMute (uint8_t ch, bool on);
1754 extern void USBD_ADC1_SetSpeakerVolume (uint8_t ch, uint16_t vol);
1755 extern void USBD_ADC1_RecordStart (void);
1756 extern void USBD_ADC1_RecordStop (void);
1757 extern void USBD_ADC1_SetMicrophoneMute (uint8_t ch, bool on);
1758 extern void USBD_ADC1_SetMicrophoneVolume (uint8_t ch, uint16_t vol);
1759 extern void USBD_ADC1_ReceivedSamples (void);
1760 
1761 extern void USBD_ADC2_Initialize (void);
1762 extern void USBD_ADC2_Uninitialize (void);
1763 extern void USBD_ADC2_PlayStart (void);
1764 extern void USBD_ADC2_PlayStop (void);
1765 extern void USBD_ADC2_SetSpeakerMute (uint8_t ch, bool on);
1766 extern void USBD_ADC2_SetSpeakerVolume (uint8_t ch, uint16_t vol);
1767 extern void USBD_ADC2_RecordStart (void);
1768 extern void USBD_ADC2_RecordStop (void);
1769 extern void USBD_ADC2_SetMicrophoneMute (uint8_t ch, bool on);
1770 extern void USBD_ADC2_SetMicrophoneVolume (uint8_t ch, uint16_t vol);
1771 extern void USBD_ADC2_ReceivedSamples (void);
1772 
1773 extern void USBD_ADC3_Initialize (void);
1774 extern void USBD_ADC3_Uninitialize (void);
1775 extern void USBD_ADC3_PlayStart (void);
1776 extern void USBD_ADC3_PlayStop (void);
1777 extern void USBD_ADC3_SetSpeakerMute (uint8_t ch, bool on);
1778 extern void USBD_ADC3_SetSpeakerVolume (uint8_t ch, uint16_t vol);
1779 extern void USBD_ADC3_RecordStart (void);
1780 extern void USBD_ADC3_RecordStop (void);
1781 extern void USBD_ADC3_SetMicrophoneMute (uint8_t ch, bool on);
1782 extern void USBD_ADC3_SetMicrophoneVolume (uint8_t ch, uint16_t vol);
1783 extern void USBD_ADC3_ReceivedSamples (void);
1784 
1785 extern void USBD_CDC0_ACM_Initialize (void);
1786 extern void USBD_CDC0_ACM_Uninitialize (void);
1787 extern void USBD_CDC0_ACM_Reset (void);
1788 extern bool USBD_CDC0_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1789 extern bool USBD_CDC0_ACM_SetControlLineState (uint16_t state);
1790 extern void USBD_CDC0_ACM_DataReceived (uint32_t len);
1791 extern void USBD_CDC0_ACM_DataSent (void);
1792 extern void USBD_CDC0_NCM_Initialize (void);
1793 extern void USBD_CDC0_NCM_Uninitialize (void);
1794 extern void USBD_CDC0_NCM_Reset (void);
1795 extern void USBD_CDC0_NCM_Start (void);
1796 extern void USBD_CDC0_NCM_Stop (void);
1797 extern bool USBD_CDC0_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1798 extern bool USBD_CDC0_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1799 extern bool USBD_CDC0_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1800 extern bool USBD_CDC0_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1801 extern bool USBD_CDC0_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1802 extern bool USBD_CDC0_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1803 extern bool USBD_CDC0_NCM_GetNetAddress (uint8_t *net_addr);
1804 extern bool USBD_CDC0_NCM_SetNetAddress (const uint8_t *net_addr);
1805 extern bool USBD_CDC0_NCM_GetNtbFormat (uint16_t *ntb_format);
1806 extern bool USBD_CDC0_NCM_SetNtbFormat (uint16_t ntb_format);
1807 extern bool USBD_CDC0_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1808 extern bool USBD_CDC0_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1809 extern bool USBD_CDC0_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1810 extern bool USBD_CDC0_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1811 extern bool USBD_CDC0_NCM_GetCrcMode (uint16_t *crc_mode);
1812 extern bool USBD_CDC0_NCM_SetCrcMode (uint16_t crc_mode);
1813 extern void USBD_CDC0_NCM_NTB_IN_Sent (void);
1814 extern void USBD_CDC0_NCM_NTB_OUT_Received (void);
1815 
1816 extern void USBD_CDC1_ACM_Initialize (void);
1817 extern void USBD_CDC1_ACM_Uninitialize (void);
1818 extern void USBD_CDC1_ACM_Reset (void);
1819 extern bool USBD_CDC1_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1820 extern bool USBD_CDC1_ACM_SetControlLineState (uint16_t state);
1821 extern void USBD_CDC1_ACM_DataReceived (uint32_t len);
1822 extern void USBD_CDC1_ACM_DataSent (void);
1823 extern void USBD_CDC1_NCM_Initialize (void);
1824 extern void USBD_CDC1_NCM_Uninitialize (void);
1825 extern void USBD_CDC1_NCM_Reset (void);
1826 extern void USBD_CDC1_NCM_Start (void);
1827 extern void USBD_CDC1_NCM_Stop (void);
1828 extern bool USBD_CDC1_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1829 extern bool USBD_CDC1_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1830 extern bool USBD_CDC1_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1831 extern bool USBD_CDC1_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1832 extern bool USBD_CDC1_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1833 extern bool USBD_CDC1_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1834 extern bool USBD_CDC1_NCM_GetNetAddress (uint8_t *net_addr);
1835 extern bool USBD_CDC1_NCM_SetNetAddress (const uint8_t *net_addr);
1836 extern bool USBD_CDC1_NCM_GetNtbFormat (uint16_t *ntb_format);
1837 extern bool USBD_CDC1_NCM_SetNtbFormat (uint16_t ntb_format);
1838 extern bool USBD_CDC1_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1839 extern bool USBD_CDC1_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1840 extern bool USBD_CDC1_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1841 extern bool USBD_CDC1_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1842 extern bool USBD_CDC1_NCM_GetCrcMode (uint16_t *crc_mode);
1843 extern bool USBD_CDC1_NCM_SetCrcMode (uint16_t crc_mode);
1844 extern void USBD_CDC1_NCM_NTB_IN_Sent (void);
1845 extern void USBD_CDC1_NCM_NTB_OUT_Received (void);
1846 
1847 extern void USBD_CDC2_ACM_Initialize (void);
1848 extern void USBD_CDC2_ACM_Uninitialize (void);
1849 extern void USBD_CDC2_ACM_Reset (void);
1850 extern bool USBD_CDC2_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1851 extern bool USBD_CDC2_ACM_SetControlLineState (uint16_t state);
1852 extern void USBD_CDC2_ACM_DataReceived (uint32_t len);
1853 extern void USBD_CDC2_ACM_DataSent (void);
1854 extern void USBD_CDC2_NCM_Initialize (void);
1855 extern void USBD_CDC2_NCM_Uninitialize (void);
1856 extern void USBD_CDC2_NCM_Reset (void);
1857 extern void USBD_CDC2_NCM_Start (void);
1858 extern void USBD_CDC2_NCM_Stop (void);
1859 extern bool USBD_CDC2_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1860 extern bool USBD_CDC2_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1861 extern bool USBD_CDC2_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1862 extern bool USBD_CDC2_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1863 extern bool USBD_CDC2_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1864 extern bool USBD_CDC2_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1865 extern bool USBD_CDC2_NCM_GetNetAddress (uint8_t *net_addr);
1866 extern bool USBD_CDC2_NCM_SetNetAddress (const uint8_t *net_addr);
1867 extern bool USBD_CDC2_NCM_GetNtbFormat (uint16_t *ntb_format);
1868 extern bool USBD_CDC2_NCM_SetNtbFormat (uint16_t ntb_format);
1869 extern bool USBD_CDC2_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1870 extern bool USBD_CDC2_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1871 extern bool USBD_CDC2_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1872 extern bool USBD_CDC2_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1873 extern bool USBD_CDC2_NCM_GetCrcMode (uint16_t *crc_mode);
1874 extern bool USBD_CDC2_NCM_SetCrcMode (uint16_t crc_mode);
1875 extern void USBD_CDC2_NCM_NTB_IN_Sent (void);
1876 extern void USBD_CDC2_NCM_NTB_OUT_Received (void);
1877 
1878 extern void USBD_CDC3_ACM_Initialize (void);
1879 extern void USBD_CDC3_ACM_Uninitialize (void);
1880 extern void USBD_CDC3_ACM_Reset (void);
1881 extern bool USBD_CDC3_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1882 extern bool USBD_CDC3_ACM_SetControlLineState (uint16_t state);
1883 extern void USBD_CDC3_ACM_DataReceived (uint32_t len);
1884 extern void USBD_CDC3_ACM_DataSent (void);
1885 extern void USBD_CDC3_NCM_Initialize (void);
1886 extern void USBD_CDC3_NCM_Uninitialize (void);
1887 extern void USBD_CDC3_NCM_Reset (void);
1888 extern void USBD_CDC3_NCM_Start (void);
1889 extern void USBD_CDC3_NCM_Stop (void);
1890 extern bool USBD_CDC3_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1891 extern bool USBD_CDC3_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1892 extern bool USBD_CDC3_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1893 extern bool USBD_CDC3_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1894 extern bool USBD_CDC3_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1895 extern bool USBD_CDC3_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1896 extern bool USBD_CDC3_NCM_GetNetAddress (uint8_t *net_addr);
1897 extern bool USBD_CDC3_NCM_SetNetAddress (const uint8_t *net_addr);
1898 extern bool USBD_CDC3_NCM_GetNtbFormat (uint16_t *ntb_format);
1899 extern bool USBD_CDC3_NCM_SetNtbFormat (uint16_t ntb_format);
1900 extern bool USBD_CDC3_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1901 extern bool USBD_CDC3_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1902 extern bool USBD_CDC3_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1903 extern bool USBD_CDC3_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1904 extern bool USBD_CDC3_NCM_GetCrcMode (uint16_t *crc_mode);
1905 extern bool USBD_CDC3_NCM_SetCrcMode (uint16_t crc_mode);
1906 extern void USBD_CDC3_NCM_NTB_IN_Sent (void);
1907 extern void USBD_CDC3_NCM_NTB_OUT_Received (void);
1908 
1909 extern void USBD_CDC4_ACM_Initialize (void);
1910 extern void USBD_CDC4_ACM_Uninitialize (void);
1911 extern void USBD_CDC4_ACM_Reset (void);
1912 extern bool USBD_CDC4_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1913 extern bool USBD_CDC4_ACM_SetControlLineState (uint16_t state);
1914 extern void USBD_CDC4_ACM_DataReceived (uint32_t len);
1915 extern void USBD_CDC4_ACM_DataSent (void);
1916 extern void USBD_CDC4_NCM_Initialize (void);
1917 extern void USBD_CDC4_NCM_Uninitialize (void);
1918 extern void USBD_CDC4_NCM_Reset (void);
1919 extern void USBD_CDC4_NCM_Start (void);
1920 extern void USBD_CDC4_NCM_Stop (void);
1921 extern bool USBD_CDC4_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1922 extern bool USBD_CDC4_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1923 extern bool USBD_CDC4_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1924 extern bool USBD_CDC4_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1925 extern bool USBD_CDC4_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1926 extern bool USBD_CDC4_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1927 extern bool USBD_CDC4_NCM_GetNetAddress (uint8_t *net_addr);
1928 extern bool USBD_CDC4_NCM_SetNetAddress (const uint8_t *net_addr);
1929 extern bool USBD_CDC4_NCM_GetNtbFormat (uint16_t *ntb_format);
1930 extern bool USBD_CDC4_NCM_SetNtbFormat (uint16_t ntb_format);
1931 extern bool USBD_CDC4_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1932 extern bool USBD_CDC4_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1933 extern bool USBD_CDC4_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1934 extern bool USBD_CDC4_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1935 extern bool USBD_CDC4_NCM_GetCrcMode (uint16_t *crc_mode);
1936 extern bool USBD_CDC4_NCM_SetCrcMode (uint16_t crc_mode);
1937 extern void USBD_CDC4_NCM_NTB_IN_Sent (void);
1938 extern void USBD_CDC4_NCM_NTB_OUT_Received (void);
1939 
1940 extern void USBD_CDC5_ACM_Initialize (void);
1941 extern void USBD_CDC5_ACM_Uninitialize (void);
1942 extern void USBD_CDC5_ACM_Reset (void);
1943 extern bool USBD_CDC5_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1944 extern bool USBD_CDC5_ACM_SetControlLineState (uint16_t state);
1945 extern void USBD_CDC5_ACM_DataReceived (uint32_t len);
1946 extern void USBD_CDC5_ACM_DataSent (void);
1947 extern void USBD_CDC5_NCM_Initialize (void);
1948 extern void USBD_CDC5_NCM_Uninitialize (void);
1949 extern void USBD_CDC5_NCM_Reset (void);
1950 extern void USBD_CDC5_NCM_Start (void);
1951 extern void USBD_CDC5_NCM_Stop (void);
1952 extern bool USBD_CDC5_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1953 extern bool USBD_CDC5_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1954 extern bool USBD_CDC5_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1955 extern bool USBD_CDC5_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1956 extern bool USBD_CDC5_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1957 extern bool USBD_CDC5_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1958 extern bool USBD_CDC5_NCM_GetNetAddress (uint8_t *net_addr);
1959 extern bool USBD_CDC5_NCM_SetNetAddress (const uint8_t *net_addr);
1960 extern bool USBD_CDC5_NCM_GetNtbFormat (uint16_t *ntb_format);
1961 extern bool USBD_CDC5_NCM_SetNtbFormat (uint16_t ntb_format);
1962 extern bool USBD_CDC5_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1963 extern bool USBD_CDC5_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1964 extern bool USBD_CDC5_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1965 extern bool USBD_CDC5_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1966 extern bool USBD_CDC5_NCM_GetCrcMode (uint16_t *crc_mode);
1967 extern bool USBD_CDC5_NCM_SetCrcMode (uint16_t crc_mode);
1968 extern void USBD_CDC5_NCM_NTB_IN_Sent (void);
1969 extern void USBD_CDC5_NCM_NTB_OUT_Received (void);
1970 
1971 extern void USBD_CDC6_ACM_Initialize (void);
1972 extern void USBD_CDC6_ACM_Uninitialize (void);
1973 extern void USBD_CDC6_ACM_Reset (void);
1974 extern bool USBD_CDC6_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
1975 extern bool USBD_CDC6_ACM_SetControlLineState (uint16_t state);
1976 extern void USBD_CDC6_ACM_DataReceived (uint32_t len);
1977 extern void USBD_CDC6_ACM_DataSent (void);
1978 extern void USBD_CDC6_NCM_Initialize (void);
1979 extern void USBD_CDC6_NCM_Uninitialize (void);
1980 extern void USBD_CDC6_NCM_Reset (void);
1981 extern void USBD_CDC6_NCM_Start (void);
1982 extern void USBD_CDC6_NCM_Stop (void);
1983 extern bool USBD_CDC6_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
1984 extern bool USBD_CDC6_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
1985 extern bool USBD_CDC6_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
1986 extern bool USBD_CDC6_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
1987 extern bool USBD_CDC6_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
1988 extern bool USBD_CDC6_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
1989 extern bool USBD_CDC6_NCM_GetNetAddress (uint8_t *net_addr);
1990 extern bool USBD_CDC6_NCM_SetNetAddress (const uint8_t *net_addr);
1991 extern bool USBD_CDC6_NCM_GetNtbFormat (uint16_t *ntb_format);
1992 extern bool USBD_CDC6_NCM_SetNtbFormat (uint16_t ntb_format);
1993 extern bool USBD_CDC6_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
1994 extern bool USBD_CDC6_NCM_SetNtbInputSize (uint32_t ntb_input_size);
1995 extern bool USBD_CDC6_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
1996 extern bool USBD_CDC6_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
1997 extern bool USBD_CDC6_NCM_GetCrcMode (uint16_t *crc_mode);
1998 extern bool USBD_CDC6_NCM_SetCrcMode (uint16_t crc_mode);
1999 extern void USBD_CDC6_NCM_NTB_IN_Sent (void);
2000 extern void USBD_CDC6_NCM_NTB_OUT_Received (void);
2001 
2002 extern void USBD_CDC7_ACM_Initialize (void);
2003 extern void USBD_CDC7_ACM_Uninitialize (void);
2004 extern void USBD_CDC7_ACM_Reset (void);
2005 extern bool USBD_CDC7_ACM_GetLineCoding ( CDC_LINE_CODING *line_coding);
2006 extern bool USBD_CDC7_ACM_SetControlLineState (uint16_t state);
2007 extern void USBD_CDC7_ACM_DataReceived (uint32_t len);
2008 extern void USBD_CDC7_ACM_DataSent (void);
2009 extern void USBD_CDC7_NCM_Initialize (void);
2010 extern void USBD_CDC7_NCM_Uninitialize (void);
2011 extern void USBD_CDC7_NCM_Reset (void);
2012 extern void USBD_CDC7_NCM_Start (void);
2013 extern void USBD_CDC7_NCM_Stop (void);
2014 extern bool USBD_CDC7_NCM_SetEthernetMulticastFilters (const uint8_t *addr_list, uint16_t num_of_filters);
2015 extern bool USBD_CDC7_NCM_SetEthernetPowerManagementPatternFilter (uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size);
2016 extern bool USBD_CDC7_NCM_GetEthernetPowerManagementPatternFilter (uint16_t filter_number, uint16_t *pattern_active);
2017 extern bool USBD_CDC7_NCM_SetEthernetPacketFilter (uint16_t packet_filter_bitmap);
2018 extern bool USBD_CDC7_NCM_GetEthernetStatistic (uint16_t feature_selector, uint32_t *data);
2019 extern bool USBD_CDC7_NCM_GetNtbParameters (CDC_NCM_NTB_PARAM *ntb_params);
2020 extern bool USBD_CDC7_NCM_GetNetAddress (uint8_t *net_addr);
2021 extern bool USBD_CDC7_NCM_SetNetAddress (const uint8_t *net_addr);
2022 extern bool USBD_CDC7_NCM_GetNtbFormat (uint16_t *ntb_format);
2023 extern bool USBD_CDC7_NCM_SetNtbFormat (uint16_t ntb_format);
2024 extern bool USBD_CDC7_NCM_GetNtbInputSize (uint32_t *ntb_input_size);
2025 extern bool USBD_CDC7_NCM_SetNtbInputSize (uint32_t ntb_input_size);
2026 extern bool USBD_CDC7_NCM_GetMaxDatagramSize (uint16_t *max_datagram_size);
2027 extern bool USBD_CDC7_NCM_SetMaxDatagramSize (uint16_t max_datagram_size);
2028 extern bool USBD_CDC7_NCM_GetCrcMode (uint16_t *crc_mode);
2029 extern bool USBD_CDC7_NCM_SetCrcMode (uint16_t crc_mode);
2030 extern void USBD_CDC7_NCM_NTB_IN_Sent (void);
2031 extern void USBD_CDC7_NCM_NTB_OUT_Received (void);
2032 
2033 extern void USBD_HID0_Initialize (void);
2034 extern void USBD_HID0_Uninitialize (void);
2035 extern int32_t USBD_HID0_GetReport (uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf);
2036 extern bool USBD_HID0_SetReport (uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len);
2037 
2038 extern void USBD_HID1_Initialize (void);
2039 extern void USBD_HID1_Uninitialize (void);
2040 extern int32_t USBD_HID1_GetReport (uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf);
2041 extern bool USBD_HID1_SetReport (uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len);
2042 
2043 extern void USBD_HID2_Initialize (void);
2044 extern void USBD_HID2_Uninitialize (void);
2045 extern int32_t USBD_HID2_GetReport (uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf);
2046 extern bool USBD_HID2_SetReport (uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len);
2047 
2048 extern void USBD_HID3_Initialize (void);
2049 extern void USBD_HID3_Uninitialize (void);
2050 extern int32_t USBD_HID3_GetReport (uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf);
2051 extern bool USBD_HID3_SetReport (uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len);
2052 
2053 extern void USBD_MSC0_Initialize (void);
2054 extern void USBD_MSC0_Uninitialize (void);
2055 extern bool USBD_MSC0_GetCacheInfo (uint32_t *buffer, uint32_t *size);
2056 extern bool USBD_MSC0_GetMediaCapacity (uint32_t *block_count, uint32_t *block_size);
2057 extern bool USBD_MSC0_StartStop (bool start);
2058 extern uint32_t USBD_MSC0_CheckMedia (void);
2059 extern uint8_t USBD_MSC0_GetMaxLUN (void);
2060 extern bool USBD_MSC0_LUN_GetMediaCapacity (uint8_t lun, uint32_t *block_count, uint32_t *block_size);
2061 extern bool USBD_MSC0_LUN_Read (uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf);
2062 extern bool USBD_MSC0_LUN_Write (uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf);
2063 extern bool USBD_MSC0_LUN_StartStop (uint8_t lun, bool start);
2064 extern uint32_t USBD_MSC0_LUN_CheckMedia (uint8_t lun);
2065 
2066 extern void USBD_MSC1_Initialize (void);
2067 extern void USBD_MSC1_Uninitialize (void);
2068 extern bool USBD_MSC1_GetCacheInfo (uint32_t *buffer, uint32_t *size);
2069 extern bool USBD_MSC1_GetMediaCapacity (uint32_t *block_count, uint32_t *block_size);
2070 extern bool USBD_MSC1_StartStop (bool start);
2071 extern uint32_t USBD_MSC1_CheckMedia (void);
2072 extern uint8_t USBD_MSC1_GetMaxLUN (void);
2073 extern bool USBD_MSC1_LUN_GetMediaCapacity (uint8_t lun, uint32_t *block_count, uint32_t *block_size);
2074 extern bool USBD_MSC1_LUN_Read (uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf);
2075 extern bool USBD_MSC1_LUN_Write (uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf);
2076 extern bool USBD_MSC1_LUN_StartStop (uint8_t lun, bool start);
2077 extern uint32_t USBD_MSC1_LUN_CheckMedia (uint8_t lun);
2078 
2079 extern void USBD_MSC2_Initialize (void);
2080 extern void USBD_MSC2_Uninitialize (void);
2081 extern bool USBD_MSC2_GetCacheInfo (uint32_t *buffer, uint32_t *size);
2082 extern bool USBD_MSC2_GetMediaCapacity (uint32_t *block_count, uint32_t *block_size);
2083 extern bool USBD_MSC2_StartStop (bool start);
2084 extern uint32_t USBD_MSC2_CheckMedia (void);
2085 extern uint8_t USBD_MSC2_GetMaxLUN (void);
2086 extern bool USBD_MSC2_LUN_GetMediaCapacity (uint8_t lun, uint32_t *block_count, uint32_t *block_size);
2087 extern bool USBD_MSC2_LUN_Read (uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf);
2088 extern bool USBD_MSC2_LUN_Write (uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf);
2089 extern bool USBD_MSC2_LUN_StartStop (uint8_t lun, bool start);
2090 extern uint32_t USBD_MSC2_LUN_CheckMedia (uint8_t lun);
2091 
2092 extern void USBD_MSC3_Initialize (void);
2093 extern void USBD_MSC3_Uninitialize (void);
2094 extern bool USBD_MSC3_GetCacheInfo (uint32_t *buffer, uint32_t *size);
2095 extern bool USBD_MSC3_GetMediaCapacity (uint32_t *block_count, uint32_t *block_size);
2096 extern bool USBD_MSC3_StartStop (bool start);
2097 extern uint32_t USBD_MSC3_CheckMedia (void);
2098 extern uint8_t USBD_MSC3_GetMaxLUN (void);
2099 extern bool USBD_MSC3_LUN_GetMediaCapacity (uint8_t lun, uint32_t *block_count, uint32_t *block_size);
2100 extern bool USBD_MSC3_LUN_Read (uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf);
2101 extern bool USBD_MSC3_LUN_Write (uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf);
2102 extern bool USBD_MSC3_LUN_StartStop (uint8_t lun, bool start);
2103 extern uint32_t USBD_MSC3_LUN_CheckMedia (uint8_t lun);
2104 
2105 extern void USBD_CustomClass0_Initialize (void);
2106 extern void USBD_CustomClass0_Uninitialize (void);
2107 extern void USBD_CustomClass0_Reset (void);
2108 extern void USBD_CustomClass0_EndpointStart (uint8_t ep_addr);
2109 extern void USBD_CustomClass0_EndpointStop (uint8_t ep_addr);
2110 extern usbdRequestStatus USBD_CustomClass0_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
2111 extern void USBD_CustomClass0_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
2112 extern usbdRequestStatus USBD_CustomClass0_Endpoint0_OutDataReceived (uint32_t len);
2113 extern usbdRequestStatus USBD_CustomClass0_Endpoint0_InDataSent (uint32_t len);
2114 extern void USBD_CustomClass0_Endpoint1_Event (uint32_t event);
2115 extern void USBD_CustomClass0_Endpoint2_Event (uint32_t event);
2116 extern void USBD_CustomClass0_Endpoint3_Event (uint32_t event);
2117 extern void USBD_CustomClass0_Endpoint4_Event (uint32_t event);
2118 extern void USBD_CustomClass0_Endpoint5_Event (uint32_t event);
2119 extern void USBD_CustomClass0_Endpoint6_Event (uint32_t event);
2120 extern void USBD_CustomClass0_Endpoint7_Event (uint32_t event);
2121 extern void USBD_CustomClass0_Endpoint8_Event (uint32_t event);
2122 extern void USBD_CustomClass0_Endpoint9_Event (uint32_t event);
2123 extern void USBD_CustomClass0_Endpoint10_Event (uint32_t event);
2124 extern void USBD_CustomClass0_Endpoint11_Event (uint32_t event);
2125 extern void USBD_CustomClass0_Endpoint12_Event (uint32_t event);
2126 extern void USBD_CustomClass0_Endpoint13_Event (uint32_t event);
2127 extern void USBD_CustomClass0_Endpoint14_Event (uint32_t event);
2128 extern void USBD_CustomClass0_Endpoint15_Event (uint32_t event);
2129 
2130 extern void USBD_CustomClass1_Initialize (void);
2131 extern void USBD_CustomClass1_Uninitialize (void);
2132 extern void USBD_CustomClass1_Reset (void);
2133 extern void USBD_CustomClass1_EndpointStart (uint8_t ep_addr);
2134 extern void USBD_CustomClass1_EndpointStop (uint8_t ep_addr);
2135 extern usbdRequestStatus USBD_CustomClass1_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
2136 extern void USBD_CustomClass1_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
2137 extern usbdRequestStatus USBD_CustomClass1_Endpoint0_OutDataReceived (uint32_t len);
2138 extern usbdRequestStatus USBD_CustomClass1_Endpoint0_InDataSent (uint32_t len);
2139 extern void USBD_CustomClass1_Endpoint1_Event (uint32_t event);
2140 extern void USBD_CustomClass1_Endpoint2_Event (uint32_t event);
2141 extern void USBD_CustomClass1_Endpoint3_Event (uint32_t event);
2142 extern void USBD_CustomClass1_Endpoint4_Event (uint32_t event);
2143 extern void USBD_CustomClass1_Endpoint5_Event (uint32_t event);
2144 extern void USBD_CustomClass1_Endpoint6_Event (uint32_t event);
2145 extern void USBD_CustomClass1_Endpoint7_Event (uint32_t event);
2146 extern void USBD_CustomClass1_Endpoint8_Event (uint32_t event);
2147 extern void USBD_CustomClass1_Endpoint9_Event (uint32_t event);
2148 extern void USBD_CustomClass1_Endpoint10_Event (uint32_t event);
2149 extern void USBD_CustomClass1_Endpoint11_Event (uint32_t event);
2150 extern void USBD_CustomClass1_Endpoint12_Event (uint32_t event);
2151 extern void USBD_CustomClass1_Endpoint13_Event (uint32_t event);
2152 extern void USBD_CustomClass1_Endpoint14_Event (uint32_t event);
2153 extern void USBD_CustomClass1_Endpoint15_Event (uint32_t event);
2154 
2155 extern void USBD_CustomClass2_Initialize (void);
2156 extern void USBD_CustomClass2_Uninitialize (void);
2157 extern void USBD_CustomClass2_Reset (void);
2158 extern void USBD_CustomClass2_EndpointStart (uint8_t ep_addr);
2159 extern void USBD_CustomClass2_EndpointStop (uint8_t ep_addr);
2160 extern usbdRequestStatus USBD_CustomClass2_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
2161 extern void USBD_CustomClass2_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
2162 extern usbdRequestStatus USBD_CustomClass2_Endpoint0_OutDataReceived (uint32_t len);
2163 extern usbdRequestStatus USBD_CustomClass2_Endpoint0_InDataSent (uint32_t len);
2164 extern void USBD_CustomClass2_Endpoint1_Event (uint32_t event);
2165 extern void USBD_CustomClass2_Endpoint2_Event (uint32_t event);
2166 extern void USBD_CustomClass2_Endpoint3_Event (uint32_t event);
2167 extern void USBD_CustomClass2_Endpoint4_Event (uint32_t event);
2168 extern void USBD_CustomClass2_Endpoint5_Event (uint32_t event);
2169 extern void USBD_CustomClass2_Endpoint6_Event (uint32_t event);
2170 extern void USBD_CustomClass2_Endpoint7_Event (uint32_t event);
2171 extern void USBD_CustomClass2_Endpoint8_Event (uint32_t event);
2172 extern void USBD_CustomClass2_Endpoint9_Event (uint32_t event);
2173 extern void USBD_CustomClass2_Endpoint10_Event (uint32_t event);
2174 extern void USBD_CustomClass2_Endpoint11_Event (uint32_t event);
2175 extern void USBD_CustomClass2_Endpoint12_Event (uint32_t event);
2176 extern void USBD_CustomClass2_Endpoint13_Event (uint32_t event);
2177 extern void USBD_CustomClass2_Endpoint14_Event (uint32_t event);
2178 extern void USBD_CustomClass2_Endpoint15_Event (uint32_t event);
2179 
2180 extern void USBD_CustomClass3_Initialize (void);
2181 extern void USBD_CustomClass3_Uninitialize (void);
2182 extern void USBD_CustomClass3_Reset (void);
2183 extern void USBD_CustomClass3_EndpointStart (uint8_t ep_addr);
2184 extern void USBD_CustomClass3_EndpointStop (uint8_t ep_addr);
2185 extern usbdRequestStatus USBD_CustomClass3_Endpoint0_SetupPacketReceived (const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len);
2186 extern void USBD_CustomClass3_Endpoint0_SetupPacketProcessed (const USB_SETUP_PACKET *setup_packet);
2187 extern usbdRequestStatus USBD_CustomClass3_Endpoint0_OutDataReceived (uint32_t len);
2188 extern usbdRequestStatus USBD_CustomClass3_Endpoint0_InDataSent (uint32_t len);
2189 extern void USBD_CustomClass3_Endpoint1_Event (uint32_t event);
2190 extern void USBD_CustomClass3_Endpoint2_Event (uint32_t event);
2191 extern void USBD_CustomClass3_Endpoint3_Event (uint32_t event);
2192 extern void USBD_CustomClass3_Endpoint4_Event (uint32_t event);
2193 extern void USBD_CustomClass3_Endpoint5_Event (uint32_t event);
2194 extern void USBD_CustomClass3_Endpoint6_Event (uint32_t event);
2195 extern void USBD_CustomClass3_Endpoint7_Event (uint32_t event);
2196 extern void USBD_CustomClass3_Endpoint8_Event (uint32_t event);
2197 extern void USBD_CustomClass3_Endpoint9_Event (uint32_t event);
2198 extern void USBD_CustomClass3_Endpoint10_Event (uint32_t event);
2199 extern void USBD_CustomClass3_Endpoint11_Event (uint32_t event);
2200 extern void USBD_CustomClass3_Endpoint12_Event (uint32_t event);
2201 extern void USBD_CustomClass3_Endpoint13_Event (uint32_t event);
2202 extern void USBD_CustomClass3_Endpoint14_Event (uint32_t event);
2203 extern void USBD_CustomClass3_Endpoint15_Event (uint32_t event);
2204 
2205 
2206 // USB Device library function prototypes for configuration generation
2207 extern usbStatus USBD_CustomClass_Initialize (uint8_t instance);
2208 extern usbStatus USBD_CustomClass_Uninitialize (uint8_t instance);
2209 extern void USBD_CustomClass_Reset (uint8_t instance);
2210 extern void USBD_CustomClass_EndpointStart (uint8_t instance, uint8_t ep_addr);
2211 extern void USBD_CustomClass_EndpointStop (uint8_t instance, uint8_t ep_addr);
2212 
2213 extern usbStatus USBD_ADC_Initialize (uint8_t instance);
2214 extern usbStatus USBD_ADC_Uninitialize (uint8_t instance);
2215 extern void USBD_ADC_Reset (uint8_t instance);
2216 extern void USBD_ADC_EndpointStart (uint8_t instance, uint8_t ep_addr);
2217 extern void USBD_ADC_EndpointStop (uint8_t instance, uint8_t ep_addr);
2218 
2219 extern usbStatus USBD_CDC_Initialize (uint8_t instance);
2220 extern usbStatus USBD_CDC_Uninitialize (uint8_t instance);
2221 extern void USBD_CDC_Reset (uint8_t instance);
2222 extern void USBD_CDC_EndpointStart (uint8_t instance, uint8_t ep_addr);
2223 extern void USBD_CDC_EndpointStop (uint8_t instance, uint8_t ep_addr);
2224 
2225 extern usbStatus USBD_HID_Initialize (uint8_t instance);
2226 extern usbStatus USBD_HID_Uninitialize (uint8_t instance);
2227 extern void USBD_HID_Reset (uint8_t instance);
2228 extern void USBD_HID_SetConfiguration (uint8_t instance);
2229 extern void USBD_HID_EndpointStart (uint8_t instance, uint8_t ep_addr);
2230 extern void USBD_HID_Timer (void const *argument);
2231 
2232 
2233 extern usbStatus USBD_MSC_Initialize (uint8_t instance);
2234 extern usbStatus USBD_MSC_Uninitialize (uint8_t instance);
2235 extern void USBD_MSC_Reset (uint8_t instance);
2236 extern void USBD_MSC_EndpointStart (uint8_t instance, uint8_t ep_addr);
2237 
2238 
2239 // USB Device library configuration generated function prototypes
2240 extern void USBD_Debug_Initialize (uint8_t device);
2241 
2242 extern usbStatus USBD_ClassInitialize (uint8_t device);
2243 extern usbStatus USBD_ClassUninitialize (uint8_t device);
2244 extern void USBD_Reset (uint8_t device);
2245 extern void USBD_SetConfiguration (uint8_t device, uint8_t configuration);
2246 extern void USBD_EndpointStart (uint8_t device, uint8_t ep_addr);
2247 extern void USBD_EndpointStop (uint8_t device, uint8_t ep_addr);
2248 
2249 
2250 // USB Device thread function prototypes
2251 extern void USBD_Core_Thread (void *arg);
2252 extern void USBD0_Core_Thread (void const *arg);
2253 extern void USBD1_Core_Thread (void const *arg);
2254 extern void USBD2_Core_Thread (void const *arg);
2255 extern void USBD3_Core_Thread (void const *arg);
2256 
2257 extern void USBD_ADC_Thread (void *arg);
2258 extern void USBD_ADC0_Thread (void const *arg);
2259 extern void USBD_ADC1_Thread (void const *arg);
2260 extern void USBD_ADC2_Thread (void const *arg);
2261 extern void USBD_ADC3_Thread (void const *arg);
2262 
2263 extern void USBD_CDC_Int_Thread (void *arg);
2264 extern void USBD_CDC0_Int_Thread (void const *arg);
2265 extern void USBD_CDC1_Int_Thread (void const *arg);
2266 extern void USBD_CDC2_Int_Thread (void const *arg);
2267 extern void USBD_CDC3_Int_Thread (void const *arg);
2268 extern void USBD_CDC4_Int_Thread (void const *arg);
2269 extern void USBD_CDC5_Int_Thread (void const *arg);
2270 extern void USBD_CDC6_Int_Thread (void const *arg);
2271 extern void USBD_CDC7_Int_Thread (void const *arg);
2272 
2273 extern void USBD_CDC_Bulk_Thread (void *arg);
2274 extern void USBD_CDC0_Bulk_Thread (void const *arg);
2275 extern void USBD_CDC1_Bulk_Thread (void const *arg);
2276 extern void USBD_CDC2_Bulk_Thread (void const *arg);
2277 extern void USBD_CDC3_Bulk_Thread (void const *arg);
2278 extern void USBD_CDC4_Bulk_Thread (void const *arg);
2279 extern void USBD_CDC5_Bulk_Thread (void const *arg);
2280 extern void USBD_CDC6_Bulk_Thread (void const *arg);
2281 extern void USBD_CDC7_Bulk_Thread (void const *arg);
2282 
2283 extern void USBD_HID_Thread (void *arg);
2284 extern void USBD_HID0_Thread (void const *arg);
2285 extern void USBD_HID1_Thread (void const *arg);
2286 extern void USBD_HID2_Thread (void const *arg);
2287 extern void USBD_HID3_Thread (void const *arg);
2288 
2289 extern void USBD_MSC_Thread (void *arg);
2290 extern void USBD_MSC0_Thread (void const *arg);
2291 extern void USBD_MSC1_Thread (void const *arg);
2292 extern void USBD_MSC2_Thread (void const *arg);
2293 extern void USBD_MSC3_Thread (void const *arg);
2294 
2295 extern void USBD_CustomClass_EP_Thread (void *arg);
2296 
2297 // USB Host OS abstraction functions
2298 extern void *USBH_ThreadCreate (usbhThread_t thread, uint8_t index);
2299 extern void *USBH_ThreadGetHandle (void);
2300 extern int32_t USBH_ThreadTerminate (void *thread_hndl);
2301 
2302 extern int32_t USBH_Delay (uint32_t millisec);
2303 
2304 extern void *USBH_TimerCreate (uint8_t ctrl);
2305 extern int32_t USBH_TimerStart (void *timer_hndl, uint32_t millisec);
2306 extern int32_t USBH_TimerStop (void *timer_hndl);
2307 extern int32_t USBH_TimerDelete (void *timer_hndl);
2308 
2309 extern uint32_t USBH_ThreadFlagsSet (void *thread_hndl, uint32_t flags);
2310 extern uint32_t USBH_ThreadFlagsWait (uint32_t millisec);
2311 
2312 extern void *USBH_MutexCreate (usbhMutex_t mutex, uint8_t ctrl);
2313 extern int32_t USBH_MutexAcquire (void *mutex_hndl, uint32_t millisec);
2314 extern int32_t USBH_MutexRelease (void *mutex_hndl);
2315 extern int32_t USBH_MutexDelete (void *mutex_hndl);
2316 
2317 extern void *USBH_SemaphoreCreate (usbhSemaphore_t semaphore, uint8_t ctrl);
2318 extern int32_t USBH_SemaphoreAcquire (void *semaphore_hndl, uint32_t millisec);
2319 extern int32_t USBH_SemaphoreRelease (void *semaphore_hndl);
2320 extern int32_t USBH_SemaphoreDelete (void *semaphore_hndl);
2321 
2322 // USB Host library function prototypes
2323 extern void USBH_Debug_Initialize (uint8_t ctrl);
2324 
2325 extern uint8_t USBH_CDC_Configure (uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc);
2326 extern usbStatus USBH_CDC_Unconfigure (uint8_t instance);
2327 extern usbStatus USBH_CDC_Initialize_Lib (uint8_t instance);
2328 extern usbStatus USBH_CDC_Uninitialize_Lib (uint8_t instance);
2329 
2330 extern uint8_t USBH_HID_Configure (uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc);
2331 extern usbStatus USBH_HID_Unconfigure (uint8_t instance);
2332 extern usbStatus USBH_HID_Initialize_Lib (uint8_t instance);
2333 extern usbStatus USBH_HID_Uninitialize_Lib (uint8_t instance);
2334 
2335 extern uint8_t USBH_MSC_Configure (uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc);
2336 extern usbStatus USBH_MSC_Unconfigure (uint8_t instance);
2337 extern usbStatus USBH_MSC_Initialize_Lib (uint8_t instance);
2338 extern usbStatus USBH_MSC_Uninitialize_Lib (uint8_t instance);
2339 
2340 extern uint8_t USBH_CustomClass_Configure (uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc);
2341 extern usbStatus USBH_CustomClass_Unconfigure (uint8_t instance);
2342 extern usbStatus USBH_CustomClass_Initialize (uint8_t instance);
2343 extern usbStatus USBH_CustomClass_Uninitialize (uint8_t instance);
2344 
2345 // USB Host thread function prototypes
2346 extern void USBH_Core_Thread (void *arg);
2347 extern void USBH0_Core_Thread (void const *arg);
2348 extern void USBH1_Core_Thread (void const *arg);
2349 extern void USBH2_Core_Thread (void const *arg);
2350 extern void USBH3_Core_Thread (void const *arg);
2351 
2352 extern void USBH_CDC_IntIn_Thread (void *arg);
2353 
2354 extern void USBH_HID_IntIn_Thread (void *arg);
2355 
2356 // USB Host timer function prototypes
2357 extern void USBH_ConnectDebounce (void const *arg);
2358 
2359 #ifdef __cplusplus
2360 }
2361 #endif
2362 
2363 #endif
void USBD_CustomClassn_Endpoint9_Event(uint32_t event)
Request processed but busy.
Definition: rl_usb.h:83
void USBH_Notify(uint8_t ctrl, uint8_t port, uint8_t device, USBH_NOTIFY notify)
Callback function called when some event has happened on corresponding controller and port...
Mass Storage Device (MSC) error (no device or device produced error)
Definition: rl_usb.h:53
bool USBD_CDCn_NCM_SetNtbInputSize(uint32_t ntb_input_size)
Callback function called upon USB Host request to select the maximum size of NTB that is permitted to...
usbStatus USBH_PipeReset(USBH_PIPE_HANDLE pipe_hndl)
Reset Pipe (reset data toggle)
void USBD_ADCn_PlayStop(void)
Callback function called when play stopped.
bool USBD_CDCn_NCM_GetEthernetPowerManagementPatternFilter(uint16_t filter_number, uint16_t *pattern_active)
Callback function called upon USB Host request to retrieve the status of the specified Ethernet power...
Function completed; time-out occurred.
Definition: rl_usb.h:36
USB Setup Packet.
Definition: usb_structs.txt:7
uint32_t USBH_CDC_ACM_GetTxCount(uint8_t instance)
Get result of send data to Communication Device Class device.
uint8_t USBH_Device_GetPort(uint8_t device)
Get index of USB Host Root HUB port to which USB Device is connected.
void USBD_CDCn_ACM_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB CDC class instance (ACM) ...
CDC Line Coding structure.
Definition: usb_structs.txt:15
void USBH_MSC_Uninitialize(uint8_t instance)
Callback function called when Mass Storage Device was disconnected.
void USBD_MSCn_Initialize(void)
Callback function called during USBD_Initialize to initialize all Logical Units of the USB MSC class ...
uint32_t USBD_ADC_WrittenSamplesPending(uint8_t instance)
Number of audio samples written and pending to be sent to USB Host.
uint32_t USBH_CDC_ACM_GetRxCount(uint8_t instance)
Get result of receive data from Communication Device Class device.
void USBD_CustomClassn_Endpoint12_Event(uint32_t event)
void USBD_Devicen_Reset(void)
Callback function called upon USB Bus Reset signaling.
void USBD_CustomClassn_Endpoint15_Event(uint32_t event)
void USBD_ADCn_SetSpeakerVolume(uint8_t ch, uint16_t vol)
Callback function called when speaker volume setting changed.
void USBD_Devicen_Suspended(void)
Callback function called when USB Bus goes into suspend mode (no bus activity for 3 ms) ...
Invalid Parameter error: a mandatory parameter was missing or specified an incorrect object...
Definition: rl_usb.h:37
usbStatus USBH_Initialize(uint8_t ctrl)
Initialize USB Host stack and controller.
void USBD_CDCn_NCM_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB CDC class instance (NCM) ...
void USBD_HIDn_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB HID class instance...
int32_t USBD_CDC_NCM_NTB_IN_IsSent(uint8_t instance)
Check if NTB was sent and new NTB can be prepared.
Function completed with no error.
Definition: rl_usb.h:34
usbStatus USBH_CDC_ACM_SetLineCoding(uint8_t instance, const CDC_LINE_CODING *line_coding)
Change communication settings of Communication Device Class device.
uint32_t USBD_CDC_NCM_NTB_OUT_RawGetSize(uint8_t instance)
Get size of the received NTB.
int32_t USBD_CDC_NCM_NTB_OUT_IsReceived(uint8_t instance)
Check if NTB was received and is available for processing.
void USBD_CustomClassn_Endpoint0_SetupPacketProcessed(const USB_SETUP_PACKET *setup_packet)
Callback function called when a SETUP PACKET was processed by USB library.
uint8_t USBH_Device_GetAddress(uint8_t device)
Get communication address of USB Device.
void USBD_MSCn_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize all Logical Units of the USB MSC c...
usbStatus USBH_Device_GetStringDescriptor(uint8_t device, uint8_t index, uint16_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length)
Get String Descriptor of USB Device.
bool USBD_CDCn_NCM_SetEthernetPacketFilter(uint16_t packet_filter_bitmap)
Callback function called upon USB Host request to configure device Ethernet packet filter settings...
bool USBD_CDCn_NCM_GetCrcMode(uint16_t *crc_mode)
Callback function called upon USB Host request to return the currently selected CRC mode...
bool USBD_CDCn_ACM_GetEncapsulatedResponse(uint16_t max_len, uint8_t **buf, uint16_t *len)
Callback function called upon reception of request to get encapsulated response sent by the USB Host...
int USBD_CDC_ACM_GetChar(uint8_t instance)
Read one character received by Communication Device from USB Host.
void USBD_Devicen_HighSpeedActivated(void)
Callback function called when USB Bus speed has changed to high-speed.
uint32_t USBD_EndpointReadGetResult(uint8_t device, uint8_t ep_addr)
Get result of read operation on Endpoint.
int32_t USBD_CDC_NCM_NTB_OUT_ProcessNDP(uint8_t instance)
Process the next NDP in the received NTB.
usbStatus USBH_PipeUpdate(USBH_PIPE_HANDLE pipe_hndl)
Update Pipe.
bool USBD_MSCn_LUN_Read(uint8_t lun, uint32_t lba, uint32_t cnt, uint8_t *buf)
Callback function called to read data from media of a logical unit.
void USBD_CustomClassn_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB Custom class instance...
usbStatus USBD_Connect(uint8_t device)
Activate pull-up on D+ or D- line to signal USB Device connection on USB Bus.
Controller does not exist.
Definition: rl_usb.h:44
Unspecified USB error.
Definition: rl_usb.h:60
usbStatus USBH_DeviceRequest_GetDescriptor(uint8_t device, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint16_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length)
Standard Device Request on Default Pipe - GET_DESCRIPTOR.
CMSIS-RTOS Semaphore creation failed.
Definition: rl_usb.h:41
void USBD_Devicen_DisableRemoteWakeup(void)
Callback function called when Clear Feature for Remote Wakeup was requested over Control Endpoint 0...
uint32_t USBD_EndpointWriteGetResult(uint8_t device, uint8_t ep_addr)
Get result of write operation on Endpoint.
usbStatus USBH_DeviceRequest_SetInterface(uint8_t device, uint8_t index, uint8_t alternate)
Standard Device Request on Default Pipe - SET_INTERFACE.
usbStatus USBH_MSC_GetStatus(uint8_t instance)
Get status of Mass Storage Device.
void USBD_CustomClassn_Endpoint3_Event(uint32_t event)
void USBH_CDC_ACM_Notify(uint8_t instance, uint16_t status)
Callback function called when Communication Device Class device modem line or error status changes...
void USBD_ADCn_SetMicrophoneVolume(uint8_t ch, uint16_t vol)
Callback function called when microphone volume setting changed.
uint8_t USBD_MSCn_GetMaxLUN(void)
Callback function called to get maximum number of logical units.
usbStatus USBH_DeviceRequest_SetConfiguration(uint8_t device, uint8_t configuration)
Standard Device Request on Default Pipe - SET_CONFIGURATION.
int32_t USBD_CDC_NCM_NTB_IN_CreateNDP(uint8_t instance, uint8_t num_datagrams)
Create a new NDP in the NTB (datagrams can be added to it)
void USBD_CDCn_ACM_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB CDC class instance (ACM) ...
void USBD_Devicen_EnableRemoteWakeup(void)
Callback function called when Set Feature for Remote Wakeup was requested over Control Endpoint 0...
uint8_t USBH_CustomClass_GetDevice(uint8_t instance)
Get Device instance of Custom Class Device.
usbdRequestStatus USBD_Devicen_Endpoint0_SetupPacketReceived(const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len)
Callback function called when Device received SETUP PACKET on Control Endpoint 0. ...
uint32_t USBH_PipeSendGetResult(USBH_PIPE_HANDLE pipe_hndl)
Get result of send data operation on Pipe.
Request from periodic update.
Definition: rl_usb.h:94
void USBH_HID_Uninitialize(uint8_t instance)
Callback function called when Human Interface Device was disconnected.
USBH_PIPE_HANDLE USBH_PipeCreate(uint8_t device, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_max_packet_size, uint8_t ep_interval)
Create Pipe.
CMSIS-RTOS Thread creation/termination failed.
Definition: rl_usb.h:39
void USBD_CustomClassn_Endpoint13_Event(uint32_t event)
void USBH_HID_ParseReportDescriptor(uint8_t instance, const uint8_t *ptr_hid_report_desc, uint32_t len)
Callback function called for parsing of the Human Interface Device report descriptor.
int16_t y
Absolute Y position change.
Definition: rl_usb.h:165
void USBD_Devicen_ConfigurationChanged(uint8_t val)
Callback function called when Device configuration has changed.
void USBD_CustomClassn_Endpoint1_Event(uint32_t event)
Callback function called when DATA was sent or received on Endpoint n.
usbStatus USBH_DeviceRequest_SynchFrame(uint8_t device, uint8_t index, uint8_t *ptr_frame_number)
Standard Device Request on Default Pipe - SYNCH_FRAME.
usbStatus USBD_EndpointStall(uint8_t device, uint8_t ep_addr, bool stall)
Set/Clear stall on Endpoint.
void USBD_CustomClassn_Endpoint14_Event(uint32_t event)
usbStatus USBD_EndpointRead(uint8_t device, uint8_t ep_addr, uint8_t *buf, uint32_t len)
Start reception on Endpoint.
void USBD_CustomClassn_Endpoint10_Event(uint32_t event)
bool USBD_MSCn_Read(uint32_t lba, uint32_t cnt, uint8_t *buf)
Callback function called to read data from media.
void USBD_ADCn_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB ADC class instance.
USBD_STATE USBD_GetState(uint8_t device)
Retrieve USB Device state.
usbStatus USBD_Initialize(uint8_t device)
Initialize USB Device stack and controller.
usbStatus USBH_MSC_Write(uint8_t instance, uint32_t lba, uint32_t cnt, const uint8_t *buf)
Write requested number of blocks to Mass Storage Device.
bool USBD_CDCn_NCM_GetNetAddress(uint8_t *net_addr)
Callback function called upon USB Host request to return the USB Device's current EUI-48 station addr...
usbStatus USBH_MSC_Read(uint8_t instance, uint32_t lba, uint32_t cnt, uint8_t *buf)
Read requested number of blocks from Mass Storage Device.
void USBD_ADCn_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB ADC class instance...
uint8_t USBH_HID_GetDevice(uint8_t instance)
Get Device instance of Human Interface Device.
usbStatus USBH_CDC_ACM_SetControlLineState(uint8_t instance, uint16_t state)
Set control line states of Communication Device Class device.
void USBD_ADCn_SetMicrophoneMute(uint8_t ch, bool on)
Callback function called when microphone mute setting changed.
usbdRequestStatus USBD_CustomClassn_Endpoint0_InDataSent(uint32_t len)
Callback function called when IN DATA was sent on Control Endpoint 0.
Request not processed.
Definition: rl_usb.h:80
int32_t USBD_CDC_NCM_NTB_IN_Send(uint8_t instance)
Send the active NTB.
int32_t USBH_Device_GetSpeed(uint8_t device)
Get communication speed of USB Device.
bool USBD_HIDn_SetReport(uint8_t rtype, uint8_t req, uint8_t rid, const uint8_t *buf, int32_t len)
Callback function called to process received HID Report data.
usbStatus USBH_PipeReceive(USBH_PIPE_HANDLE pipe_hndl, uint8_t *buf, uint32_t len)
Receive data on Pipe.
Audio Device Class (ADC) error (no device or device produced error)
Definition: rl_usb.h:50
void USBD_CDCn_NCM_Start(void)
Callback function called when USB Host changes data interface from alternate 0 to alternate 1 (activa...
bool USBD_MSCn_GetCacheInfo(uint32_t *buffer, uint32_t *size)
Callback function called to get cache information.
void USBD_ADCn_PlayStart(void)
Callback function called when play started.
bool USBD_CDCn_ACM_SetControlLineState(uint16_t state)
Callback function called upon USB Host request to set control line states.
bool USBD_Configured(uint8_t device)
Retrieve USB Device configuration status.
uint8_t USBH_MSC_GetDevice(uint8_t instance)
Get Device instance of Mass Storage Device.
int32_t USBD_CDC_NCM_Notify_ConnectionSpeedChange(uint8_t instance, uint32_t us_bitrate, uint32_t ds_bitrate)
Report a change in upstream or downstream speed of the networking connection to the USB Host...
usbdRequestStatus USBD_CustomClassn_Endpoint0_SetupPacketReceived(const USB_SETUP_PACKET *setup_packet, uint8_t **buf, uint32_t *len)
Callback function called when a SETUP PACKET was received on Control Endpoint 0.
Definition: usb_structs.txt:1
usbStatus USBH_Port_Resume(uint8_t ctrl, uint8_t port)
Resume a root HUB port on specified controller.
usbStatus USBH_HID_GetStatus(uint8_t instance)
Get status of Human Interface Device.
uint8_t USBH_CustomClass_Configure(uint8_t device, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc)
Callback function called when custom class device is connected and needs to configure resources used ...
usbStatus USBH_Uninitialize(uint8_t ctrl)
De-initialize USB Host stack and controller.
usbStatus USBH_CustomClass_GetStatus(uint8_t instance)
Get status of Custom Class Device.
void USBH_MSC_Initialize(uint8_t instance)
Callback function called when Mass Storage Device was enumerated and is ready.
usbStatus USBH_DeviceRequest_ClearFeature(uint8_t device, uint8_t recipient, uint8_t index, uint8_t feature_selector)
Standard Device Request on Default Pipe - CLEAR_FEATURE.
uint32_t USBD_CDC_NCM_NTB_OUT_GetDatagramSize(uint8_t instance)
Get size of a datagram from the active NDP of the received NTB.
void USBD_CustomClassn_EndpointStop(uint8_t ep_addr)
Callback function called when Endpoint Stop was requested (by de-activating interface or activating c...
void USBD_CDCn_NCM_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB CDC class instance (NCM) ...
usbStatus USBH_CDC_ACM_Send(uint8_t instance, const uint8_t *data, uint32_t num)
Send data to Communication Device Class device.
usbStatus USBH_CDC_ACM_GetLineCoding(uint8_t instance, CDC_LINE_CODING *line_coding)
Retrieve communication settings of Communication Device Class device.
usbStatus USBD_Disconnect(uint8_t device)
Disconnect USB Device from USB Bus.
int32_t USBD_ADC_ReadSamples(uint8_t instance, void *buf, int32_t num)
Read audio samples received from USB Host.
bool USBD_CDCn_ACM_SetLineCoding(const CDC_LINE_CODING *line_coding)
Callback function called upon USB Host request to change communication settings.
int USBH_HID_GetKeyboardKey(uint8_t instance)
Retrieve first pending pressed keyboard key on HID Keyboard.
void USBD_CDCn_NCM_NTB_OUT_Received(void)
Callback function called when NTB was successfully received.
usbStatus USBD_EndpointAbort(uint8_t device, uint8_t ep_addr)
Abort read/write operation on Endpoint.
usbStatus USBH_Device_GetStatus(uint8_t device)
Get status of USB Device.
CMSIS-RTOS Mutex creation failed.
Definition: rl_usb.h:42
usbStatus USBH_DeviceRequest_SetAddress(uint8_t device, uint8_t device_address)
Standard Device Request on Default Pipe - SET_ADDRESS.
uint16_t USBH_Device_GetPID(uint8_t device)
Get Product ID (PID) of USB Device.
void USBD_ADCn_SetSpeakerMute(uint8_t ch, bool on)
Callback function called when speaker mute setting changed.
usbStatus USBD_SetSerialNumber(uint8_t device, const char *string)
Set USB Device serial number string.
void USBH_HID_DataReceived(uint8_t instance, uint32_t len)
Callback function called when data is received from the Human Interface Device.
uint8_t button
Current button states.
Definition: rl_usb.h:163
void USBD_CustomClassn_Endpoint7_Event(uint32_t event)
bool USBD_CDCn_NCM_SetEthernetPowerManagementPatternFilter(uint16_t filter_number, const uint8_t *pattern_filter, uint16_t pattern_filter_size)
Callback function called upon USB Host request to set up the specified Ethernet power management patt...
void USBD_CustomClassn_Endpoint11_Event(uint32_t event)
bool USBD_MSCn_Write(uint32_t lba, uint32_t cnt, const uint8_t *buf)
Callback function called to write data to media.
Communication Device Class (CDC) error (no device or device produced error)
Definition: rl_usb.h:51
usbStatus USBH_DeviceRequest_SetDescriptor(uint8_t device, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint16_t language_id, const uint8_t *descriptor_data, uint16_t descriptor_length)
Standard Device Request on Default Pipe - SET_DESCRIPTOR.
Request from control endpoint.
Definition: rl_usb.h:92
void USBH_HID_Initialize(uint8_t instance)
Callback function called when Human Interface Device was enumerated and is ready. ...
bool USBD_MSCn_LUN_GetMediaCapacity(uint8_t lun, uint32_t *block_count, uint32_t *block_size)
Callback function called to get media capacity of a logical unit.
void USBD_Devicen_Resumed(void)
Callback function called when USB Bus activity has resumed.
void USBD_CDCn_NCM_Reset(void)
Callback function called upon USB Bus Reset signaling.
void USBD_Devicen_VbusChanged(bool level)
Callback function called when VBUS level changes.
usbdRequestStatus
Definition: rl_usb.txt:6714
usbdRequestStatus USBD_Devicen_Endpoint0_InDataSent(uint32_t len)
Callback function called when Device sent IN DATA on Control Endpoint 0.
usbStatus USBH_PipeAbort(USBH_PIPE_HANDLE pipe_hndl)
Abort send/receive operation on Pipe.
int32_t USBD_CDC_ACM_ReadData(uint8_t instance, uint8_t *buf, int32_t len)
Read multiple data bytes received by Communication Device from USB Host.
int32_t USBD_CDC_ACM_DataAvailable(uint8_t instance)
Retrieve number of data bytes received by Communication Device from USB Host that are available to re...
bool USBD_CDCn_NCM_SetMaxDatagramSize(uint16_t max_datagram_size)
Callback function called upon USB Host request to select the maximum datagram size that can be sent i...
int32_t USBD_CDC_NCM_Notify_NetworkConnection(uint8_t instance, uint16_t status)
Report whether or not the physical layer (modem, Ethernet PHY, etc.) link is up to the USB Host...
void USBD_CustomClassn_Endpoint6_Event(uint32_t event)
CMSIS-RTOS Timer creation/deletion failed.
Definition: rl_usb.h:40
bool USBD_MSCn_GetMediaCapacity(uint32_t *block_count, uint32_t *block_size)
Callback function called to get media capacity.
bool USBD_CDCn_NCM_SetNtbFormat(uint16_t ntb_format)
Callback function called upon USB Host request to select the format of NTB to be used for NTBs transm...
usbStatus USBH_CDC_ACM_SendBreak(uint8_t instance, uint16_t duration)
Send break on Communication Device Class device.
usbStatus USBH_CDC_ACM_GetStatus(uint8_t instance)
Get status of Communication Device Class device.
bool USBD_CDCn_NCM_GetMaxDatagramSize(uint16_t *max_datagram_size)
Callback function called upon USB Host request to return the currently effective maximum datagram siz...
void USBD_CustomClassn_Endpoint5_Event(uint32_t event)
void USBD_ADCn_RecordStart(void)
Callback function called when recording started.
int32_t USBH_HID_Write(uint8_t instance, const uint8_t *buf, int32_t len)
Write data to Human Interface Device.
bool USBD_CDCn_NCM_GetNtbInputSize(uint32_t *ntb_input_size)
Callback function called upon USB Host request to return NTB input size currently being used...
bool USBD_CDCn_NCM_SetCrcMode(uint16_t crc_mode)
Callback function called upon USB Host request to control CRC mode.
bool USBD_MSCn_LUN_Write(uint8_t lun, uint32_t lba, uint32_t cnt, const uint8_t *buf)
Callback function called to write data to media of a logical unit.
uint32_t USBH_PipeReceiveGetResult(USBH_PIPE_HANDLE pipe_hndl)
Get result of receive data operation on Pipe.
Request processed and OK.
Definition: rl_usb.h:81
usbStatus USBD_CDC_ACM_Notify_ResponseAvailable(uint8_t instance)
Send notification to USB Host signaling that response is available.
void USBD_CDCn_ACM_DataReceived(uint32_t len)
Callback function called when new data was received.
usbStatus USBH_CustomClass_Initialize(uint8_t instance)
Callback function called when custom class device is connected and needs to initialize custom class d...
bool USBD_CDCn_NCM_GetEthernetStatistic(uint16_t feature_selector, uint32_t *data)
Callback function called upon USB Host request to retrieve a statistic based on the feature selector...
void USBD_Devicen_Uninitialize(void)
Callback function called during USBD_Uninitialize to de-initialize the USB Device.
usbStatus USBD_Uninitialize(uint8_t device)
De-initialize USB Device stack and controller.
uint32_t USBH_GetVersion(void)
Get version of USB Host stack.
Device is not configured (is connected)
Definition: rl_usb.h:49
usbStatus USBH_DeviceRequest_GetStatus(uint8_t device, uint8_t recipient, uint8_t index, uint8_t *ptr_stat_dat)
Standard Device Request on Default Pipe - GET_STATUS.
Mouse state information.
Definition: rl_usb.h:161
uint8_t USBH_Device_GetController(uint8_t device)
Get index of USB Host controller to which USB Device is connected.
usbStatus USBH_PipeDelete(USBH_PIPE_HANDLE pipe_hndl)
Delete Pipe.
usbStatus
Definition: rl_usb.txt:6716
usbdRequestStatus USBD_Devicen_Endpoint0_OutDataReceived(uint32_t len)
Callback function called when Device received OUT DATA on Control Endpoint 0.
void USBH_CDC_ACM_Uninitialize(uint8_t instance)
Callback function called when Communication Device Class device was disconnected. ...
usbStatus USBH_DeviceRequest_SetFeature(uint8_t device, uint8_t recipient, uint8_t index, uint8_t feature_selector)
Standard Device Request on Default Pipe - SET_FEATURE.
void USBD_CustomClassn_Endpoint4_Event(uint32_t event)
void USBD_CustomClassn_Reset(void)
Callback function called upon USB Bus Reset signaling.
void USBD_CustomClassn_Endpoint8_Event(uint32_t event)
usbStatus USBH_MSC_ReadCapacity(uint8_t instance, uint32_t *block_count, uint32_t *block_size)
Read capacity of Mass Storage Device.
void USBD_ADCn_ReceivedSamples(void)
Callback function called when data in USB buffer for speaker samples reaches half-full from empty...
int32_t USBD_CDC_NCM_NTB_IN_WriteDatagram(uint8_t instance, const uint8_t *buf, uint32_t len)
Add a datagram into the active NDP of the NTB to be sent.
Custom device Class (Class) error (no device or device produced error)
Definition: rl_usb.h:54
Request processed but unsupported.
Definition: rl_usb.h:82
uint32_t USBD_MSCn_CheckMedia(void)
Callback function called to check media presence and write protect status.
void USBD_Devicen_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB Device.
Request from interrupt endpoint.
Definition: rl_usb.h:93
usbdRequestStatus USBD_CustomClassn_Endpoint0_OutDataReceived(uint32_t len)
Callback function called when OUT DATA was received on Control Endpoint 0.
Device does not exist.
Definition: rl_usb.h:45
bool USBD_CDCn_NCM_SetNetAddress(const uint8_t *net_addr)
Callback function called upon USB Host request to set the USB Device's current EUI-48 station address...
uint32_t USBD_GetVersion(void)
Get version of USB Device stack.
void USBD_Devicen_Endpoint0_SetupPacketProcessed(const USB_SETUP_PACKET *setup_packet)
Callback function called when SETUP PACKET was processed by USB library.
usbStatus USBH_DeviceRequest_GetInterface(uint8_t device, uint8_t index, uint8_t *ptr_alternate)
Standard Device Request on Default Pipe - GET_INTERFACE.
usbStatus USBD_HID_GetReportTrigger(uint8_t instance, uint8_t rid, const uint8_t *buf, uint32_t len)
Asynchronously prepare HID Report data to send.
usbStatus USBH_CustomClass_Unconfigure(uint8_t instance)
Callback function called when custom class device is disconnected and needs to de-configure resources...
Memory management function produced error.
Definition: rl_usb.h:48
usbStatus USBD_ADC_SetMicrophoneVolumeRange(uint8_t instance, uint8_t ch, uint16_t min, uint16_t max, uint16_t res, uint16_t cur)
Set range for microphone volume (level) control.
USBD_HID_REQ_t
Definition: rl_usb.txt:6715
bool USBD_CDCn_NCM_GetNtbFormat(uint16_t *ntb_format)
Callback function called upon USB Host request to return the NTB data format currently being used...
Transfer error.
Definition: rl_usb.h:58
bool USBD_CDCn_NCM_SetEthernetMulticastFilters(const uint8_t *addr_list, uint16_t num_of_filters)
Callback function called upon USB Host request to set the Ethernet device multicast filters...
void USBD_ADCn_RecordStop(void)
Callback function called when recording stopped.
usbStatus USBH_PipeSend(USBH_PIPE_HANDLE pipe_hndl, const uint8_t *buf, uint32_t len)
Send data on Pipe.
void USBD_CDCn_NCM_NTB_IN_Sent(void)
Callback function called when NTB was successfully sent.
usbStatus USBH_DeviceRequest_GetConfiguration(uint8_t device, uint8_t *ptr_configuration)
Standard Device Request on Default Pipe - GET_CONFIGURATION.
int32_t USBD_CDC_NCM_NTB_IN_RawSend(uint8_t instance, const uint8_t *buf, uint32_t len)
Send already prepared NTB (for this option value of define in configuration USBD_CDCn_NCM_RAW_ENABLE ...
int32_t USBD_HIDn_GetReport(uint8_t rtype, uint8_t req, uint8_t rid, uint8_t *buf)
Callback function called to prepare HID Report data to send.
void USBD_CustomClassn_EndpointStart(uint8_t ep_addr)
Callback function called when Endpoint Start was requested (by activating interface or configuration)...
usbStatus USBH_ControlTransfer(uint8_t device, const USB_SETUP_PACKET *setup_packet, uint8_t *data, uint32_t len)
Do a Control Transfer on Default Pipe.
void USBD_CDCn_ACM_DataSent(void)
Callback function called when all data was sent.
void USBD_HIDn_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB HID class instance.
bool USBD_CDCn_ACM_GetLineCoding(CDC_LINE_CODING *line_coding)
Callback function called upon USB Host request to retrieve communication settings.
bool USBD_CDCn_ACM_SendEncapsulatedCommand(const uint8_t *buf, uint16_t len)
Callback function called upon reception of request send encapsulated command sent by the USB Host...
usbStatus USBH_HID_GetMouseState(uint8_t instance, usbHID_MouseState *state)
Retrieve state change since last call of this function.
void USBD_CDCn_ACM_Reset(void)
Callback function called upon USB Bus Reset signaling.
int16_t x
Absolute X position change.
Definition: rl_usb.h:164
int32_t USBD_CDC_NCM_NTB_OUT_RawReceive(uint8_t instance, uint8_t *buf, uint32_t max_len)
Receive an NDP (for this option value of define in configuration USBD_CDCn_NCM_RAW_ENABLE has to be 1...
uint8_t reserved
Reserved byte (for alignment)
Definition: rl_usb.h:162
void USBH_CDC_ACM_Initialize(uint8_t instance)
Callback function called when Communication Device Class device was enumerated and is ready...
Driver function produced error.
Definition: rl_usb.h:46
int32_t USBH_HID_Read(uint8_t instance, uint8_t *buf, int32_t len)
Read data received from Human Interface Device.
uint32_t USBD_MSCn_LUN_CheckMedia(uint8_t lun)
Callback function called to check media presence and write protect status of a logical unit...
int32_t USBD_CDC_NCM_NTB_OUT_ReadDatagram(uint8_t instance, uint8_t *buf, uint32_t max_len)
Read a datagram from the active NDP of the received NTB.
Driver function is busy.
Definition: rl_usb.h:47
int32_t USBD_ADC_WriteSamples(uint8_t instance, const void *buf, int32_t num)
Write audio samples to be transferred to USB Host.
uint8_t USBH_CDC_ACM_GetDevice(uint8_t instance)
Get Device instance of Communication Device Class device.
uint32_t USBD_ADC_ReceivedSamplesAvailable(uint8_t instance)
Number of audio samples received from USB Host and available to be read.
Transfer handshake was stall.
Definition: rl_usb.h:57
usbStatus USBD_ADC_SetSpeakerVolumeRange(uint8_t instance, uint8_t ch, uint16_t min, uint16_t max, uint16_t res, uint16_t cur)
Set range for speaker volume control.
int USBD_CDC_ACM_PutChar(uint8_t instance, int ch)
Write a single character from Communication Device to USB Host.
void USBD_CustomClassn_Initialize(void)
Callback function called during USBD_Initialize to initialize the USB Custom class instance...
int32_t USBD_CDC_ACM_WriteData(uint8_t instance, const uint8_t *buf, int32_t len)
Write data from Communication Device to USB Host.
void USBD_CDCn_NCM_Stop(void)
Callback function called when USB Host changes data interface from alternate 1 to alternate 0 (de-act...
Unsupported Class.
Definition: rl_usb.h:55
usbStatus USBH_CustomClass_Uninitialize(uint8_t instance)
Callback function called when custom class device is disconnected and needs to de-initialize custom c...
uint16_t USBH_Device_GetVID(uint8_t device)
Get Vendor ID (VID) of USB Device.
usbStatus USBD_EndpointWrite(uint8_t device, uint8_t ep_addr, const uint8_t *buf, uint32_t len)
Start write on Endpoint.
usbStatus USBH_CDC_ACM_Receive(uint8_t instance, uint8_t *data, uint32_t num)
Receive data from Communication Device Class device.
bool USBD_CDCn_NCM_GetNtbParameters(CDC_NCM_NTB_PARAM *ntb_params)
Callback function called upon USB Host request to retrieve the parameters that describe NTBs for each...
int32_t USBD_CDC_NCM_NTB_OUT_Release(uint8_t instance)
Flush the received NTB and release memory for reception of a new NTB.
void USBD_CustomClassn_Endpoint2_Event(uint32_t event)
usbStatus USBD_CDC_ACM_Notify_SerialState(uint8_t instance, uint16_t state)
Send notification of Communication Device status and line states to USB Host.
usbStatus USBH_Port_Suspend(uint8_t ctrl, uint8_t port)
Suspend a root HUB port on specified controller.
Human Interface Device (HID) error (no device or device produced error)
Definition: rl_usb.h:52
int32_t USBD_CDC_NCM_NTB_IN_Initialize(uint8_t instance)
Clear the active NTB (prepared for sending)