IceCube display
LED display to show IceCube event data
All Data Structures Files Functions Variables Enumerations Enumerator Macros Modules Pages
endpoint.h
Go to the documentation of this file.
1 #ifndef USB_ENDPOINT_H
2 #define USB_ENDPOINT_H
3 
20 #include <stdbool.h>
21 #include <stdint.h>
22 
31 enum ep_type_t {
36  , EP_TYPE_BULK = 2
39 };
40 
43  EP_DIRECTION_OUT = (1 << 0)
44  , EP_DIRECTION_IN = (1 << 1)
46 };
47 
63 struct ep_config_t {
65  uint8_t num;
71  uint16_t size;
73  void (*init)();
74 };
75 
84 bool endpoint_configure(const struct ep_config_t* config);
85 
87 void endpoint_init_default(const uint8_t ep_num);
88 
90 void endpoint_deconfigure(const uint8_t ep_num);
91 
93 uint16_t endpoint_get_size(const uint8_t ep_num);
94 
96 
97 
102 bool endpoint_stall(const uint8_t ep_num);
104 
106 bool endpoint_clear_stall(const uint8_t ep_num);
107 
109 bool endpoint_is_stalled(const uint8_t ep_num);
110 
114 
116 void endpoint_reset_data_toggle(const uint8_t ep_num);
117 
120 
121 #endif
bool endpoint_stall(const uint8_t ep_num)
Stall an endpoint.
bool endpoint_configure(const struct ep_config_t *config)
Initialise the USB endpoint described by config.
Bulk endpoint.
Definition: endpoint.h:36
IN endpoint, for data from device to host.
Definition: endpoint.h:44
enum ep_direction_t dir
Endpoint data flow direction.
Definition: endpoint.h:69
ep_type_t
List of endpoint types.
Definition: endpoint.h:34
void endpoint_init_default(const uint8_t ep_num)
Default endpoint initialisation function.
uint16_t size
Endpoint buffer size.
Definition: endpoint.h:71
enum ep_type_t type
Endpoint type.
Definition: endpoint.h:67
Control endpoint.
Definition: endpoint.h:35
void(* init)()
Endpoint reset callback.
Definition: endpoint.h:73
OUT endpoint, for data from host to device.
Definition: endpoint.h:43
Bidirectional endpoint.
Definition: endpoint.h:45
void endpoint_deconfigure(const uint8_t ep_num)
Releases hardware and memory associated with the endpoint memory.
bool endpoint_clear_stall(const uint8_t ep_num)
Clear an endpoint stall.
Interrupt endoint.
Definition: endpoint.h:37
ep_direction_t
Endpoint directions.
Definition: endpoint.h:42
bool endpoint_is_stalled(const uint8_t ep_num)
Get endpoint stall status.
void endpoint_reset_data_toggle(const uint8_t ep_num)
Reset the DATAx toggle to DATA0.
uint16_t endpoint_get_size(const uint8_t ep_num)
Return the maximum endpoint packet size.
uint8_t num
Endpoint number.
Definition: endpoint.h:65
Isochronous endpoint.
Definition: endpoint.h:38
Endpoint configuration struct.
Definition: endpoint.h:63