Go to the documentation of this file.
21 #ifndef USB_USBUS_CONTROL_H
22 #define USB_USBUS_CONTROL_H
size_t cur
Current position in the message
size_t reqlen
Maximum length of the request
void usbus_control_init(usbus_t *usbus, usbus_control_handler_t *handler)
Initialize the control endpoint handler.
uint8_t * usbus_control_get_out_data(usbus_t *usbus, size_t *len)
Retrieve the data from the OUT pipe of the control endpoint.
usbus_control_slicer_t slicer
Slicer state for multipart control request messages.
size_t start
Start offset of the current part.
USB setup packet (USB 2.0 spec table 9-2)
usbus_control_request_state_t
USBUS control request state machine.
usbus_control_request_state_t control_request_state
Control request state machine state.
size_t usbus_control_slicer_put_char(usbus_t *usbus, char c)
Helper function for adding single bytes to the current control message part.
usbdev endpoint descriptor
size_t len
Length of the full message
void usbus_control_slicer_ready(usbus_t *usbus)
Helper function to signal the end of the control message.
size_t received_len
Received bytes for set requests.
size_t transferred
Number of bytes transferred
int usbus_control_slicer_nextslice(usbus_t *usbus)
Initialize the next slice of the control message.
usbdev_ep_t * out
EP0 OUT endpoint.
helper struct to divide control messages in multiple parts
size_t usbus_control_slicer_put_bytes(usbus_t *usbus, const uint8_t *buf, size_t len)
Helper function for adding bytes to the current control message part.
Endpoint zero event handler.
usbdev_ep_t * in
EP0 IN endpoint.
usb_setup_t setup
Last received setup packet.
usbus_handler_t handler
inherited generic handler