21#ifndef USB_USBUS_CONTROL_H
22#define USB_USBUS_CONTROL_H
27#define USBUS_CONTROL_EP_IN_REQUIRED_NUMOF 1
32#define USBUS_CONTROL_EP_OUT_REQUIRED_NUMOF 1
void usbus_control_slicer_ready(usbus_t *usbus)
Helper function to signal the end of the control message.
uint8_t * usbus_control_get_out_data(usbus_t *usbus, size_t *len)
Retrieve the data from the OUT pipe of the control endpoint.
size_t usbus_control_slicer_put_char(usbus_t *usbus, char c)
Helper function for adding single bytes to the current control message part.
int usbus_control_slicer_nextslice(usbus_t *usbus)
Initialize the next slice of the control message.
void usbus_control_init(usbus_t *usbus, usbus_control_handler_t *handler)
Initialize the control endpoint handler.
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.
#define usbdev_ep_buf_t
Instantiation type for usbdev endpoint buffers.
#define CONFIG_USBUS_EP0_SIZE
USBUS endpoint 0 buffer size.
usbus_control_request_state_t
USBUS control request state machine.
USB setup packet (USB 2.0 spec table 9-2)
usbdev endpoint descriptor
Endpoint zero event handler.
size_t received_len
Received bytes for set requests.
usbus_handler_t handler
inherited generic handler
usbus_control_slicer_t slicer
Slicer state for multipart control request messages.
usb_setup_t setup
Last received setup packet.
usbdev_ep_t * out
EP0 OUT endpoint reference.
usbdev_ep_t * in
EP0 IN endpoint reference.
usbus_control_request_state_t control_request_state
Control request state machine state.
helper struct to divide control messages in multiple parts
size_t len
Length of the full message
size_t reqlen
Maximum length of the request
size_t start
Start offset of the current part.
size_t transferred
Number of bytes transferred
size_t cur
Current position in the message