38#ifndef ZEPHYR_INCLUDE_USB_USB_DEVICE_H_
39#define ZEPHYR_INCLUDE_USB_USB_DEVICE_H_
53#define USBD_DEVICE_DESCR_DEFINE(p) \
54 static __in_section(usb, descriptor_##p, 0) __used __aligned(1)
55#define USBD_CLASS_DESCR_DEFINE(p, instance) \
56 static __in_section(usb, descriptor_##p.1, instance) __used __aligned(1)
57#define USBD_MISC_DESCR_DEFINE(p) \
58 static __in_section(usb, descriptor_##p, 2) __used __aligned(1)
59#define USBD_USER_DESCR_DEFINE(p) \
60 static __in_section(usb, descriptor_##p, 3) __used __aligned(1)
61#define USBD_STRING_DESCR_DEFINE(p) \
62 static __in_section(usb, descriptor_##p, 4) __used __aligned(1)
63#define USBD_TERM_DESCR_DEFINE(p) \
64 static __in_section(usb, descriptor_##p, 5) __used __aligned(1)
70#define USBD_CFG_DATA_DEFINE(p, name) \
71 static __in_section(usb, data_##p, name) __used
77#define USB_MAX_CTRL_MPS 64
78#define USB_MAX_FS_BULK_MPS 64
79#define USB_MAX_FS_INT_MPS 64
80#define USB_MAX_FS_ISO_MPS 1023
351#define USB_TRANS_READ BIT(0)
352#define USB_TRANS_WRITE BIT(1)
353#define USB_TRANS_NO_ZLP BIT(2)
void
Definition: eswifi_shell.c:15
void(* usb_dc_status_callback)(enum usb_dc_status_code cb_status, const uint8_t *param)
Definition: usb_dc.h:163
usb_dc_status_code
USB Driver Status Codes.
Definition: usb_dc.h:63
usb_dc_ep_cb_status_code
USB Endpoint Callback Status Codes.
Definition: usb_dc.h:95
int usb_transfer_sync(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags)
Start a transfer and block-wait for completion.
int usb_transfer(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags, usb_transfer_callback cb, void *priv)
Start a transfer.
int usb_set_config(const uint8_t *usb_descriptor)
Configure USB controller.
int usb_deconfig(void)
Deconfigure USB controller.
void(* usb_transfer_callback)(uint8_t ep, int tsize, void *priv)
Definition: usb_device.h:348
void(* usb_interface_config)(struct usb_desc_header *head, uint8_t bInterfaceNumber)
Function for interface runtime configuration.
Definition: usb_device.h:115
void usb_transfer_ep_callback(uint8_t ep, enum usb_dc_ep_cb_status_code)
Transfer management endpoint callback.
int usb_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, uint32_t *read_bytes)
Read data from the specified endpoint.
bool usb_transfer_is_busy(uint8_t ep)
Check that transfer is ongoing for the endpoint.
int usb_disable(void)
Disable the USB device.
int usb_write(uint8_t ep, const uint8_t *data, uint32_t data_len, uint32_t *bytes_ret)
Write data to the specified endpoint.
void usb_cancel_transfers(void)
Cancel all ongoing transfers.
int usb_wakeup_request(void)
Start the USB remote wakeup procedure.
void(* usb_ep_callback)(uint8_t ep, enum usb_dc_ep_cb_status_code cb_status)
Callback function signature for the USB Endpoint status.
Definition: usb_device.h:95
int usb_ep_read_continue(uint8_t ep)
Continue reading data from the endpoint.
int usb_ep_set_stall(uint8_t ep)
Set STALL condition on the specified endpoint.
int usb_read(uint8_t ep, uint8_t *data, uint32_t max_data_len, uint32_t *ret_bytes)
Read data from the specified endpoint.
void usb_cancel_transfer(uint8_t ep)
Cancel any ongoing transfer on the specified endpoint.
int usb_enable(usb_dc_status_callback status_cb)
Enable the USB subsystem and associated hardware.
int(* usb_request_handler)(struct usb_setup_packet *setup, int32_t *transfer_len, uint8_t **payload_data)
Callback function signature for class specific requests.
Definition: usb_device.h:109
int usb_ep_clear_stall(uint8_t ep)
Clears STALL condition on the specified endpoint.
flags
Definition: http_parser.h:131
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__INT32_TYPE__ int32_t
Definition: stdint.h:44
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
USB device configuration.
Definition: usb_device.h:169
usb_interface_config interface_config
Definition: usb_device.h:178
uint8_t num_endpoints
Definition: usb_device.h:186
const uint8_t * usb_device_description
Definition: usb_device.h:174
struct usb_interface_cfg_data interface
Definition: usb_device.h:184
void(* cb_usb_status)(struct usb_cfg_data *cfg, enum usb_dc_status_code cb_status, const uint8_t *param)
Definition: usb_device.h:180
struct usb_ep_cfg_data * endpoint
Definition: usb_device.h:192
void * interface_descriptor
Definition: usb_device.h:176
USB Endpoint Configuration.
Definition: usb_device.h:123
usb_ep_callback ep_cb
Definition: usb_device.h:129
uint8_t ep_addr
Definition: usb_device.h:136
USB Interface Configuration.
Definition: usb_device.h:144
usb_request_handler custom_handler
Definition: usb_device.h:158
usb_request_handler class_handler
Definition: usb_device.h:146
usb_request_handler vendor_handler
Definition: usb_device.h:148
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
USB Chapter 9 structures and definitions.
USB device controller APIs.