IceCube display
LED display to show IceCube event data
Go to the documentation of this file.
1 #ifndef USB_ENDPOINT_0_H
2 #define USB_ENDPOINT_0_H
98 #include <stdint.h>
99 #include "usb/std.h"
111 };
184 };
191  const struct usb_setup_packet_t* req;
193  void* data;
195  uint16_t data_length;
197  uint16_t data_done;
201  void (*callback_data)(struct control_transfer_t* transfer);
203  void (*callback_handshake)(struct control_transfer_t* transfer);
205  void (*callback_cancel)(struct control_transfer_t* transfer);
206 };
217 void process_setup(struct control_transfer_t* transfer);
224  struct control_transfer_t* transfer
225  , const struct usb_setup_packet_t* setup
226 );
229 void cancel_control_transfer(struct control_transfer_t* transfer);
232 void control_mark_data_done(struct control_transfer_t* transfer, uint16_t length);
234 #endif //USB_ENDPOINT_0_H
void process_setup(struct control_transfer_t *transfer)
Process setup request for control transfers.
Control transfer state tracking.
Definition: endpoint_0.h:187
Handshaking OUT transfer.
Definition: endpoint_0.h:109
Constants used to indicate the default control endpoint&#39;s current state.
Definition: endpoint_0.h:102
Definition: endpoint_0.h:171
void(* callback_handshake)(struct control_transfer_t *transfer)
Function to be called after the ZLP handshake is sent/received.
Definition: endpoint_0.h:203
Definition: endpoint_0.h:166
Performing post-handshake action.
Definition: endpoint_0.h:110
const struct usb_setup_packet_t * req
Setup request that is currently being handled.
Definition: endpoint_0.h:191
uint16_t data_length
Total length of data.
Definition: endpoint_0.h:195
Definition: endpoint_0.h:123
Definition: endpoint_0.h:134
Definitions of constants as described by the USB 2.0 standard.
void cancel_control_transfer(struct control_transfer_t *transfer)
Change the transfer state to STALL and perform the cancel callback, if any.
void * data
Data to be transmitted to/from the host.
Definition: endpoint_0.h:193
Control endpoint idle.
Definition: endpoint_0.h:103
Definition: std.h:102
Receiving data from host.
Definition: endpoint_0.h:107
void(* callback_data)(struct control_transfer_t *transfer)
Definition: endpoint_0.h:201
enum control_stage_t stage
Stage the request is currently in.
Definition: endpoint_0.h:189
Sending data to host.
Definition: endpoint_0.h:106
Definition: endpoint_0.h:160
void(* callback_cancel)(struct control_transfer_t *transfer)
Cleanup function to be called when the transfer is cancelled.
Definition: endpoint_0.h:205
Handshaking IN transfer.
Definition: endpoint_0.h:108
uint16_t data_done
Transmitted length of data.
Definition: endpoint_0.h:197
Definition: endpoint_0.h:143
Control endpoint stalled.
Definition: endpoint_0.h:105
Definition: endpoint_0.h:183
void control_mark_data_done(struct control_transfer_t *transfer, uint16_t length)
Mark length bytes of the control transfer as done and perform the data callback.
New setup request received.
Definition: endpoint_0.h:104
void init_control_transfer(struct control_transfer_t *transfer, const struct usb_setup_packet_t *setup)
Initialise the control transfer.