1 #ifndef USB_ENDPOINT_0_H 2 #define USB_ENDPOINT_0_H 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
control_stage_t
Constants used to indicate the default control endpoint'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
vendor_request_t
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
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.