dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_usbhook.c
Go to the documentation of this file.
1 
16 /*
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful, but
23  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25  * for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with this program; if not, see <http://www.gnu.org/licenses/>
29  */
30 
31 #include "pios.h"
32 #include "pios_usb.h" /* PIOS_USB_* */
33 #include "pios_usbhook.h"
34 #include "pios_usb_defs.h" /* struct usb_* */
35 #include "pios_usb_hid_pwr.h"
36 #include "pios_usb_cdc_priv.h" /* PIOS_USB_CDC_* */
37 #include "pios_usb_board_data.h" /* PIOS_USB_BOARD_* */
38 
39 /* STM32 USB Library Definitions */
40 #include "usb_lib.h"
41 
42 static ONE_DESCRIPTOR Device_Descriptor;
43 
44 void PIOS_USBHOOK_RegisterDevice(const uint8_t * desc, uint16_t desc_size)
45 {
46  Device_Descriptor.Descriptor = desc;
47  Device_Descriptor.Descriptor_Size = desc_size;
48 }
49 
50 static ONE_DESCRIPTOR Config_Descriptor;
51 
52 void PIOS_USBHOOK_RegisterConfig(uint8_t config_id, const uint8_t * desc, uint16_t desc_size)
53 {
54  Config_Descriptor.Descriptor = desc;
55  Config_Descriptor.Descriptor_Size = desc_size;
56 }
57 
58 static ONE_DESCRIPTOR String_Descriptor[4];
59 
60 void PIOS_USBHOOK_RegisterString(enum usb_string_desc string_id, const uint8_t * desc, uint16_t desc_size)
61 {
62  if (string_id < NELEMENTS(String_Descriptor)) {
63  String_Descriptor[string_id].Descriptor = desc;
64  String_Descriptor[string_id].Descriptor_Size = desc_size;
65  }
66 }
67 
68 static ONE_DESCRIPTOR Hid_Descriptor;
69 
70 void PIOS_USB_HID_RegisterHidDescriptor(const uint8_t * desc, uint16_t desc_size)
71 {
72  Hid_Descriptor.Descriptor = desc;
73  Hid_Descriptor.Descriptor_Size = desc_size;
74 }
75 
76 static ONE_DESCRIPTOR Hid_Report_Descriptor;
77 
78 void PIOS_USB_HID_RegisterHidReport(const uint8_t * desc, uint16_t desc_size)
79 {
80  Hid_Report_Descriptor.Descriptor = desc;
81  Hid_Report_Descriptor.Descriptor_Size = desc_size;
82 }
83 
85 {
86 }
87 
88 #if defined(STM32F10X_MD)
89 #include "stm32f10x.h" /* __IO */
90 #elif defined(STM32F30X)
91 #include "stm32f30x.h" /* __IO */
92 #else
93 #error UnsupportedArch
94 #endif
95 
96 __IO uint8_t EXTI_Enable;
97 
98 uint32_t ProtocolValue;
99 
100 DEVICE Device_Table = {
102  1
103 };
104 
105 static void PIOS_USBHOOK_Init(void);
106 static void PIOS_USBHOOK_Reset(void);
107 static void PIOS_USBHOOK_Status_In(void);
108 static void PIOS_USBHOOK_Status_Out(void);
109 static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo);
110 static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo);
111 static RESULT PIOS_USBHOOK_Get_Interface_Setting(uint8_t Interface, uint8_t AlternateSetting);
112 static const uint8_t *PIOS_USBHOOK_GetDeviceDescriptor(uint16_t Length);
113 static const uint8_t *PIOS_USBHOOK_GetConfigDescriptor(uint16_t Length);
114 static const uint8_t *PIOS_USBHOOK_GetStringDescriptor(uint16_t Length);
115 
116 DEVICE_PROP Device_Property = {
117  .Init = PIOS_USBHOOK_Init,
118  .Reset = PIOS_USBHOOK_Reset,
119  .Process_Status_IN = PIOS_USBHOOK_Status_In,
120  .Process_Status_OUT = PIOS_USBHOOK_Status_Out,
121  .Class_Data_Setup = PIOS_USBHOOK_Data_Setup,
122  .Class_NoData_Setup = PIOS_USBHOOK_NoData_Setup,
123  .Class_Get_Interface_Setting = PIOS_USBHOOK_Get_Interface_Setting,
124  .GetDeviceDescriptor = PIOS_USBHOOK_GetDeviceDescriptor,
125  .GetConfigDescriptor = PIOS_USBHOOK_GetConfigDescriptor,
126  .GetStringDescriptor = PIOS_USBHOOK_GetStringDescriptor,
127  .RxEP_buffer = 0,
128  .MaxPacketSize = 0x40,
129 };
130 
131 static void PIOS_USBHOOK_SetConfiguration(void);
132 static void PIOS_USBHOOK_SetDeviceAddress(void);
133 
134 USER_STANDARD_REQUESTS User_Standard_Requests = {
135  .User_GetConfiguration = NOP_Process,
136  .User_SetConfiguration = PIOS_USBHOOK_SetConfiguration,
137  .User_GetInterface = NOP_Process,
138  .User_SetInterface = NOP_Process,
139  .User_GetStatus = NOP_Process,
140  .User_ClearFeature = NOP_Process,
141  .User_SetEndPointFeature = NOP_Process,
142  .User_SetDeviceFeature = NOP_Process,
143  .User_SetDeviceAddress = PIOS_USBHOOK_SetDeviceAddress
144 };
145 
146 static RESULT PIOS_USBHOOK_SetProtocol(void);
147 static const uint8_t *PIOS_USBHOOK_GetProtocolValue(uint16_t Length);
148 static const uint8_t *PIOS_USBHOOK_GetReportDescriptor(uint16_t Length);
149 static const uint8_t *PIOS_USBHOOK_GetHIDDescriptor(uint16_t Length);
150 
151 /*******************************************************************************
152 * Function Name : PIOS_USBHOOK_Init.
153 * Description : Custom HID init routine.
154 * Input : None.
155 * Output : None.
156 * Return : None.
157 *******************************************************************************/
158 static void PIOS_USBHOOK_Init(void)
159 {
160  pInformation->Current_Configuration = 0;
161 
162  /* Connect the device */
163  PowerOn();
164 
165  /* Perform basic device initialization operations */
166  USB_SIL_Init();
167 
169 }
170 
171 /*******************************************************************************
172 * Function Name : PIOS_USBHOOK_Reset.
173 * Description : Custom HID reset routine.
174 * Input : None.
175 * Output : None.
176 * Return : None.
177 *******************************************************************************/
178 static void PIOS_USBHOOK_Reset(void)
179 {
180  /* Set DEVICE as not configured */
181  pInformation->Current_Configuration = 0;
182  pInformation->Current_Interface = 0; /*the default Interface */
183 
184  /* Current Feature initialization */
185  pInformation->Current_Feature = 0;
186 
187 #ifdef STM32F10X_CL
188  /* EP0 is already configured in DFU_Init() by USB_SIL_Init() function */
189 
190  /* Init EP1 IN as Interrupt endpoint */
191  OTG_DEV_EP_Init(EP1_IN, OTG_DEV_EP_TYPE_INT, 2);
192 
193  /* Init EP1 OUT as Interrupt endpoint */
194  OTG_DEV_EP_Init(EP1_OUT, OTG_DEV_EP_TYPE_INT, 2);
195 #else
196  SetBTABLE(BTABLE_ADDRESS);
197 
198  /* Initialize Endpoint 0 (Control) */
199  SetEPType(ENDP0, EP_CONTROL);
200  SetEPTxAddr(ENDP0, ENDP0_TXADDR);
201  SetEPTxStatus(ENDP0, EP_TX_STALL);
202  Clear_Status_Out(ENDP0);
203 
204  SetEPRxAddr(ENDP0, ENDP0_RXADDR);
205  SetEPRxCount(ENDP0, Device_Property.MaxPacketSize);
206  SetEPRxValid(ENDP0);
207 
208 #if defined(PIOS_INCLUDE_USB_HID)
209  /* Initialize Endpoint 1 (HID) */
210  SetEPType(ENDP1, EP_INTERRUPT);
211  SetEPTxAddr(ENDP1, ENDP1_TXADDR);
212  SetEPTxCount(ENDP1, PIOS_USB_BOARD_HID_DATA_LENGTH);
213  SetEPTxStatus(ENDP1, EP_TX_NAK);
214 
215  SetEPRxAddr(ENDP1, ENDP1_RXADDR);
216  SetEPRxCount(ENDP1, PIOS_USB_BOARD_HID_DATA_LENGTH);
217  SetEPRxStatus(ENDP1, EP_RX_VALID);
218 #endif /* PIOS_INCLUDE_USB_HID */
219 
220 #if defined(PIOS_INCLUDE_USB_CDC)
221  /* Initialize Endpoint 2 (CDC Call Control) */
222  SetEPType(ENDP2, EP_INTERRUPT);
223  SetEPTxAddr(ENDP2, ENDP2_TXADDR);
224  SetEPTxStatus(ENDP2, EP_TX_NAK);
225 
226  SetEPRxAddr(ENDP2, ENDP2_RXADDR);
227  SetEPRxCount(ENDP2, PIOS_USB_BOARD_CDC_MGMT_LENGTH);
228  SetEPRxStatus(ENDP2, EP_RX_DIS);
229 
230  /* Initialize Endpoint 3 (CDC Data) */
231  SetEPType(ENDP3, EP_BULK);
232  SetEPTxAddr(ENDP3, ENDP3_TXADDR);
233  SetEPTxStatus(ENDP3, EP_TX_NAK);
234 
235  SetEPRxAddr(ENDP3, ENDP3_RXADDR);
236  SetEPRxCount(ENDP3, PIOS_USB_BOARD_CDC_DATA_LENGTH);
237  SetEPRxStatus(ENDP3, EP_RX_VALID);
238 
239 #endif /* PIOS_INCLUDE_USB_CDC */
240 
241  /* Set this device to response on default address */
242  SetDeviceAddress(0);
243 #endif /* STM32F10X_CL */
244 
246 }
247 
248 /*******************************************************************************
249 * Function Name : PIOS_USBHOOK_SetConfiguration.
250 * Description : Update the device state to configured
251 * Input : None.
252 * Output : None.
253 * Return : None.
254 *******************************************************************************/
256 {
257  if (pInformation->Current_Configuration != 0) {
258  /* Device configured */
260  }
261 
262  /* Enable transfers */
263  PIOS_USB_ChangeConnectionState(pInformation->Current_Configuration != 0);
264 }
265 
266 /*******************************************************************************
267 * Function Name : PIOS_USBHOOK_SetConfiguration.
268 * Description : Update the device state to addressed.
269 * Input : None.
270 * Output : None.
271 * Return : None.
272 *******************************************************************************/
274 {
276 }
277 
278 /*******************************************************************************
279 * Function Name : PIOS_USBHOOK_Status_In.
280 * Description : status IN routine.
281 * Input : None.
282 * Output : None.
283 * Return : None.
284 *******************************************************************************/
285 static void PIOS_USBHOOK_Status_In(void)
286 {
287 }
288 
289 /*******************************************************************************
290 * Function Name : PIOS_USBHOOK_Status_Out
291 * Description : status OUT routine.
292 * Input : None.
293 * Output : None.
294 * Return : None.
295 *******************************************************************************/
296 static void PIOS_USBHOOK_Status_Out(void)
297 {
298 }
299 
300 /*******************************************************************************
301 * Function Name : PIOS_USBHOOK_Data_Setup
302 * Description : Handle the data class specific requests.
303 * Input : Request Nb.
304 * Output : None.
305 * Return : USB_UNSUPPORT or USB_SUCCESS.
306 *******************************************************************************/
307 extern uint8_t *PIOS_USB_CDC_SetLineCoding(uint16_t Length);
308 extern const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length);
309 
310 static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
311 {
312  uint8_t *(*CopyOutRoutine) (uint16_t);
313  const uint8_t *(*CopyInRoutine) (uint16_t);
314 
315  CopyInRoutine = NULL;
316  CopyOutRoutine = NULL;
317 
318  switch (Type_Recipient) {
319  case (STANDARD_REQUEST | INTERFACE_RECIPIENT):
320  switch (pInformation->USBwIndex0) {
321 #if defined(PIOS_INCLUDE_USB_CDC)
322  case 2: /* HID Interface */
323 #else
324  case 0: /* HID Interface */
325 #endif
326  switch (RequestNo) {
327  case GET_DESCRIPTOR:
328  switch (pInformation->USBwValue1) {
330  CopyInRoutine = PIOS_USBHOOK_GetReportDescriptor;
331  break;
332  case USB_DESC_TYPE_HID:
333  CopyInRoutine = PIOS_USBHOOK_GetHIDDescriptor;
334  break;
335  }
336  }
337  }
338  break;
339 
340  case (CLASS_REQUEST | INTERFACE_RECIPIENT):
341  switch (pInformation->USBwIndex0) {
342 #if defined(PIOS_INCLUDE_USB_CDC)
343  case 2: /* HID Interface */
344 #else
345  case 0: /* HID Interface */
346 #endif
347  switch (RequestNo) {
349  CopyInRoutine = PIOS_USBHOOK_GetProtocolValue;
350  break;
351  }
352 
353  break;
354 #if defined(PIOS_INCLUDE_USB_CDC)
355  case 0: /* CDC Call Control Interface */
356  switch (RequestNo) {
358  CopyOutRoutine = PIOS_USB_CDC_SetLineCoding;
359  break;
361  CopyInRoutine = PIOS_USB_CDC_GetLineCoding;
362  break;
363  }
364 
365  break;
366 
367  case 1: /* CDC Data Interface */
368  switch (RequestNo) {
369  case 0:
370  break;
371  }
372 
373  break;
374 #endif /* PIOS_INCLUDE_USB_CDC */
375  }
376  break;
377  }
378 
379  /* No registered copy routine */
380  if ((CopyInRoutine == NULL) && (CopyOutRoutine == NULL)) {
381  return USB_UNSUPPORT;
382  }
383 
384  /* Registered copy in AND copy out routine */
385  if ((CopyInRoutine != NULL) && (CopyOutRoutine != NULL)) {
386  /* This should never happen */
387  return USB_UNSUPPORT;
388  }
389 
390  if (CopyInRoutine != NULL) {
391  pInformation->Ctrl_Info.CopyDataIn = CopyInRoutine;
392  pInformation->Ctrl_Info.Usb_wOffset = 0;
393  (*CopyInRoutine) (0);
394  } else if (CopyOutRoutine != NULL) {
395  pInformation->Ctrl_Info.CopyDataOut = CopyOutRoutine;
396  pInformation->Ctrl_Info.Usb_rOffset = 0;
397  (*CopyOutRoutine) (0);
398  }
399 
400  return USB_SUCCESS;
401 }
402 
403 /*******************************************************************************
404 * Function Name : PIOS_USBHOOK_NoData_Setup
405 * Description : handle the no data class specific requests
406 * Input : Request Nb.
407 * Output : None.
408 * Return : USB_UNSUPPORT or USB_SUCCESS.
409 *******************************************************************************/
410 extern RESULT PIOS_USB_CDC_SetControlLineState(void);
411 
412 static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo)
413 {
414  switch (Type_Recipient) {
415  case (CLASS_REQUEST | INTERFACE_RECIPIENT):
416  switch (pInformation->USBwIndex0) {
417 #if defined(PIOS_INCLUDE_USB_CDC)
418  case 2: /* HID */
419 #else
420  case 0: /* HID */
421 #endif
422  switch (RequestNo) {
424  return PIOS_USBHOOK_SetProtocol();
425  break;
426  }
427 
428  break;
429 
430 #if defined(PIOS_INCLUDE_USB_CDC)
431  case 0: /* CDC Call Control Interface */
432  switch (RequestNo) {
435  break;
436  }
437 
438  break;
439 #endif /* PIOS_INCLUDE_USB_CDC */
440  }
441 
442  break;
443  }
444 
445  return USB_UNSUPPORT;
446 }
447 
448 /*******************************************************************************
449 * Function Name : PIOS_USBHOOK_GetDeviceDescriptor.
450 * Description : Gets the device descriptor.
451 * Input : Length
452 * Output : None.
453 * Return : The address of the device descriptor.
454 *******************************************************************************/
455 static const uint8_t *PIOS_USBHOOK_GetDeviceDescriptor(uint16_t Length)
456 {
457  return Standard_GetDescriptorData(Length, &Device_Descriptor);
458 }
459 
460 /*******************************************************************************
461 * Function Name : PIOS_USBHOOK_GetConfigDescriptor.
462 * Description : Gets the configuration descriptor.
463 * Input : Length
464 * Output : None.
465 * Return : The address of the configuration descriptor.
466 *******************************************************************************/
467 static const uint8_t *PIOS_USBHOOK_GetConfigDescriptor(uint16_t Length)
468 {
469  return Standard_GetDescriptorData(Length, &Config_Descriptor);
470 }
471 
472 /*******************************************************************************
473 * Function Name : PIOS_USBHOOK_GetStringDescriptor
474 * Description : Gets the string descriptors according to the needed index
475 * Input : Length
476 * Output : None.
477 * Return : The address of the string descriptors.
478 *******************************************************************************/
479 static const uint8_t *PIOS_USBHOOK_GetStringDescriptor(uint16_t Length)
480 {
481  uint8_t wValue0 = pInformation->USBwValue0;
482  if (wValue0 > 4) {
483  return NULL;
484  } else {
485  return Standard_GetDescriptorData(Length, &String_Descriptor[wValue0]);
486  }
487 }
488 
489 /*******************************************************************************
490 * Function Name : PIOS_USBHOOK_GetReportDescriptor.
491 * Description : Gets the HID report descriptor.
492 * Input : Length
493 * Output : None.
494 * Return : The address of the configuration descriptor.
495 *******************************************************************************/
496 static const uint8_t *PIOS_USBHOOK_GetReportDescriptor(uint16_t Length)
497 {
498  return Standard_GetDescriptorData(Length, &Hid_Report_Descriptor);
499 }
500 
501 /*******************************************************************************
502 * Function Name : PIOS_USBHOOK_GetHIDDescriptor.
503 * Description : Gets the HID descriptor.
504 * Input : Length
505 * Output : None.
506 * Return : The address of the configuration descriptor.
507 *******************************************************************************/
508 static const uint8_t *PIOS_USBHOOK_GetHIDDescriptor(uint16_t Length)
509 {
510  return Standard_GetDescriptorData(Length, &Hid_Descriptor);
511 }
512 
513 /*******************************************************************************
514 * Function Name : PIOS_USBHOOK_Get_Interface_Setting.
515 * Description : tests the interface and the alternate setting according to the
516 * supported one.
517 * Input : - Interface : interface number.
518 * - AlternateSetting : Alternate Setting number.
519 * Output : None.
520 * Return : USB_SUCCESS or USB_UNSUPPORT.
521 *******************************************************************************/
522 static RESULT PIOS_USBHOOK_Get_Interface_Setting(uint8_t Interface, uint8_t AlternateSetting)
523 {
524  if (AlternateSetting > 0) {
525  return USB_UNSUPPORT;
526  } else if (Interface > 0) {
527  return USB_UNSUPPORT;
528  }
529  return USB_SUCCESS;
530 }
531 
532 /*******************************************************************************
533 * Function Name : PIOS_USBHOOK_SetProtocol
534 * Description : Set Protocol request routine.
535 * Input : None.
536 * Output : None.
537 * Return : USB SUCCESS.
538 *******************************************************************************/
539 static RESULT PIOS_USBHOOK_SetProtocol(void)
540 {
541  uint8_t wValue0 = pInformation->USBwValue0;
542  ProtocolValue = wValue0;
543  return USB_SUCCESS;
544 }
545 
546 /*******************************************************************************
547 * Function Name : PIOS_USBHOOK_GetProtocolValue
548 * Description : get the protocol value
549 * Input : Length.
550 * Output : None.
551 * Return : address of the protcol value.
552 *******************************************************************************/
553 static const uint8_t *PIOS_USBHOOK_GetProtocolValue(uint16_t Length)
554 {
555  if (Length == 0) {
556  pInformation->Ctrl_Info.Usb_wLength = 1;
557  return NULL;
558  } else {
559  return (uint8_t *) (&ProtocolValue);
560  }
561 }
562 
563 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
static void PIOS_USBHOOK_SetDeviceAddress(void)
Definition: pios_usbhook.c:273
static ONE_DESCRIPTOR Hid_Descriptor
Definition: pios_usbhook.c:68
static const uint8_t * PIOS_USBHOOK_GetStringDescriptor(uint16_t Length)
Definition: pios_usbhook.c:479
void PIOS_USB_HID_RegisterHidDescriptor(const uint8_t *desc, uint16_t desc_size)
Definition: pios_usbhook.c:70
static const uint8_t * PIOS_USBHOOK_GetHIDDescriptor(uint16_t Length)
Definition: pios_usbhook.c:508
static const uint8_t * PIOS_USBHOOK_GetConfigDescriptor(uint16_t Length)
Definition: pios_usbhook.c:467
static ONE_DESCRIPTOR Config_Descriptor
Definition: pios_usbhook.c:50
Main PiOS header to include all the compiled in PiOS options.
static ONE_DESCRIPTOR String_Descriptor[4]
Definition: pios_usbhook.c:58
static ONE_DESCRIPTOR Hid_Report_Descriptor
Definition: pios_usbhook.c:76
uint32_t ProtocolValue
Definition: pios_usbhook.c:98
#define NELEMENTS(x)
Definition: pios.h:192
static void PIOS_USBHOOK_Status_Out(void)
Definition: pios_usbhook.c:296
uint32_t desc_size
APIs for PIOS_USBHOOK layer.
DEVICE Device_Table
Definition: pios_usbhook.c:100
void PIOS_USB_HID_RegisterHidReport(const uint8_t *desc, uint16_t desc_size)
Definition: pios_usbhook.c:78
void PIOS_USBHOOK_Deactivate(void)
Definition: pios_usbhook.c:84
tuple desc
Definition: px_mkfw.py:82
static void PIOS_USBHOOK_Status_In(void)
Definition: pios_usbhook.c:285
uint8_t * PIOS_USB_CDC_SetLineCoding(uint16_t Length)
RESULT PowerOn(void)
#define PIOS_USB_BOARD_CDC_MGMT_LENGTH
USER_STANDARD_REQUESTS User_Standard_Requests
Definition: pios_usbhook.c:134
static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo)
Definition: pios_usbhook.c:412
#define PIOS_USB_BOARD_EP_NUM
const uint8_t * PIOS_USB_CDC_GetLineCoding(uint16_t Length)
static RESULT PIOS_USBHOOK_Get_Interface_Setting(uint8_t Interface, uint8_t AlternateSetting)
Definition: pios_usbhook.c:522
static void PIOS_USBHOOK_Reset(void)
Definition: pios_usbhook.c:178
static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
Definition: pios_usbhook.c:310
usb_string_desc
Definition: pios_usbhook.h:43
__IO uint32_t bDeviceState
static ONE_DESCRIPTOR Device_Descriptor
Definition: pios_usbhook.c:42
USB_DESC_TYPE_REPORT
Definition: pios_usb_defs.h:48
USB_DESC_TYPE_HID
Definition: pios_usb_defs.h:47
int32_t PIOS_USB_ChangeConnectionState(bool connected)
void PIOS_USBHOOK_RegisterConfig(uint8_t config_id, const uint8_t *desc, uint16_t desc_size)
Definition: pios_usbhook.c:52
USB HID layer functions header.
static const uint8_t * PIOS_USBHOOK_GetReportDescriptor(uint16_t Length)
Definition: pios_usbhook.c:496
static const uint8_t * PIOS_USBHOOK_GetDeviceDescriptor(uint16_t Length)
Definition: pios_usbhook.c:455
void PIOS_USBHOOK_RegisterString(enum usb_string_desc string_id, const uint8_t *desc, uint16_t desc_size)
Definition: pios_usbhook.c:60
DEVICE_PROP Device_Property
Definition: pios_usbhook.c:116
void PIOS_USBHOOK_RegisterDevice(const uint8_t *desc, uint16_t desc_size)
Definition: pios_usbhook.c:44
static RESULT PIOS_USBHOOK_SetProtocol(void)
Definition: pios_usbhook.c:539
#define PIOS_USB_BOARD_HID_DATA_LENGTH
__IO uint8_t EXTI_Enable
Definition: pios_usbhook.c:96
#define PIOS_USB_BOARD_CDC_DATA_LENGTH
RESULT PIOS_USB_CDC_SetControlLineState(void)
USB COM CDC private definitions.
static void PIOS_USBHOOK_SetConfiguration(void)
Definition: pios_usbhook.c:255
static void PIOS_USBHOOK_Init(void)
Definition: pios_usbhook.c:158
static const uint8_t * PIOS_USBHOOK_GetProtocolValue(uint16_t Length)
Definition: pios_usbhook.c:553