tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
usbd_dcd.h
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
42 #ifndef _TUSB_USBD_DCD_H_
43 #define _TUSB_USBD_DCD_H_
44 
45 //--------------------------------------------------------------------+
46 // INCLUDE
47 //--------------------------------------------------------------------+
48 #include "common/common.h"
49 
50 #ifdef __cplusplus
51  extern "C" {
52 #endif
53 
54 enum {
55  USBD_INTERFACE_NUM_MAX = 16 // USB specs specify up to 16 endpoints per device
56 };
57 
58 typedef enum {
59  USBD_BUS_EVENT_RESET = 1,
60  USBD_BUS_EVENT_UNPLUGGED,
61  USBD_BUS_EVENT_SUSPENDED,
62  USBD_BUS_EVENT_RESUME
63 }usbd_bus_event_type_t;
64 
65 typedef struct {
66  volatile uint8_t state;
67  uint8_t interface2class[USBD_INTERFACE_NUM_MAX]; // determine interface number belongs to which class
69 
70 extern usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
71 //--------------------------------------------------------------------+
72 // callback from DCD ISR
73 //--------------------------------------------------------------------+
74 void usbd_dcd_bus_event_isr(uint8_t coreid, usbd_bus_event_type_t bus_event);
75 void usbd_setup_received_isr(uint8_t coreid, tusb_control_request_t * p_request);
76 void usbd_xfer_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes);
77 
78 
79 #ifdef __cplusplus
80  }
81 #endif
82 
83 #endif /* _TUSB_USBD_DCD_H_ */
84