Go to the documentation of this file.
28 #ifndef USB_USBUS_CDC_ACM_H
29 #define USB_USBUS_CDC_ACM_H
49 #ifdef CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE_EXP
50 #define CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE (1<<CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE_EXP)
52 #ifndef CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE
53 #define CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE (128)
59 #if IS_ACTIVE(CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE_8)
60 #define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE (8)
61 #elif IS_ACTIVE(CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE_16)
62 #define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE (16)
63 #elif IS_ACTIVE(CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE_32)
64 #define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE (32)
65 #elif IS_ACTIVE(CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE_64)
66 #define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE (64)
69 #ifndef CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE
70 #define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE (64)
77 #define USBUS_CDC_ACM_INT_EP_SIZE (8)
109 uint8_t *data,
size_t len);
126 uint32_t baud, uint8_t bits,
127 uint8_t parity, uint8_t stop);
160 uint8_t *buf,
size_t len);
172 const uint8_t *buf,
size_t len);
usbus_cdcacm_line_state_t state
Current line state
usbus_interface_t iface_ctrl
CDC control interface
tsrb_t tsrb
TSRB for data to the host
usbus_t * usbus
USBUS reference
USB CDC ACM line coding setup content.
usbus_descr_gen_t cdcacm_descr
CDC descriptor generator
int(* usbus_cdcacm_coding_cb_t)(usbus_cdcacm_device_t *cdcacm, uint32_t baud, uint8_t bits, uint8_t parity, uint8_t stop)
CDC ACM line coding callback.
usbus_handler_t handler_ctrl
control handler
usbus_interface_t iface_data
CDC data interface
usb_req_cdcacm_coding_t coding
Current coding configuration
size_t usbus_cdc_acm_submit(usbus_cdcacm_device_t *cdcacm, const uint8_t *buf, size_t len)
Submit bytes to the CDC ACM handler.
@ USBUS_CDC_ACM_LINE_STATE_DISCONNECTED
No DTE connected.
void usbus_cdc_acm_flush(usbus_cdcacm_device_t *cdcacm)
Flush the buffer to the USB host.
void usbus_cdc_acm_set_coding_cb(usbus_cdcacm_device_t *cdcacm, usbus_cdcacm_coding_cb_t coding_cb)
Set the callback for control settings.
usbus_cdcacm_line_state_t
CDC ACM line state as reported by the host computer.
size_t occupied
Number of bytes for the host
USBUS descriptor generator.
USBUS CDC ACM context struct.
Definition for USB CDC interfaces.
usbus_cdcacm_cb_t cb
Callback for data handlers
void usbus_cdc_acm_init(usbus_t *usbus, usbus_cdcacm_device_t *cdcacm, usbus_cdcacm_cb_t cb, usbus_cdcacm_coding_cb_t coding_cb, uint8_t *buf, size_t len)
Initialize an USBUS CDC ACM interface.
thread-safe ringbuffer struct
event_t flush
device2host forced flush event
void(* usbus_cdcacm_cb_t)(usbus_cdcacm_device_t *cdcacm, uint8_t *data, size_t len)
CDC ACM data callback.
@ USBUS_CDC_ACM_LINE_STATE_DTE
DTE (e.g.
Thread-safe ringbuffer interface definition.
usbus_cdcacm_coding_cb_t coding_cb
Callback for ACM coding changes.