File syn_usb_host_cdc.c¶
FileList > drivers > syn_usb_host_cdc.c
Go to the source code of this file
Zero-Heap USB 2.0 Host CDC ACM Class Driver Implementation.
#include "syntropic/drivers/syn_usb_host_cdc.h"#include "port/syn_port_usb.h"#include "port/syn_port_usb_host.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_usb_host_cdc_init (SYN_USB_HostCDC * hcdc) Initialize USB Host CDC instance with defaults (115200 8N1). |
| SYN_Status | syn_usb_host_cdc_read (SYN_USB_HostCDC * hcdc, void * buf, size_t max_len, size_t * out_len) Read bytes from USB Host CDC RX buffer. |
| SYN_Status | syn_usb_host_cdc_register (SYN_USB_Host * host, SYN_USB_HostCDC * hcdc) Register USB Host CDC class driver with USB Host Core. |
| bool | syn_usb_host_cdc_rx_available (const SYN_USB_HostCDC * hcdc) Check if receive data is available. |
| bool | syn_usb_host_cdc_tx_ready (const SYN_USB_HostCDC * hcdc) Check if transmit buffer is ready. |
| SYN_Status | syn_usb_host_cdc_write (SYN_USB_HostCDC * hcdc, const void * data, size_t len) Write bytes to USB Host CDC TX buffer. |
Public Static Functions¶
| Type | Name |
|---|---|
| void | host_cdc_disconnected (void * ctx) Host class disconnected callback. |
| SYN_Status | host_cdc_probe (void * ctx, uint8_t dev_addr, const uint8_t * iface_desc, uint16_t len) Host class probe callback for CDC ACM interfaces. |
| void | host_cdc_process (void * ctx) Host class process/tick callback. |
Public Functions Documentation¶
function syn_usb_host_cdc_init¶
Initialize USB Host CDC instance with defaults (115200 8N1).
Parameters:
hcdcPointer to USB Host CDC instance.
Returns:
SYN_OK on success.
function syn_usb_host_cdc_read¶
Read bytes from USB Host CDC RX buffer.
SYN_Status syn_usb_host_cdc_read (
SYN_USB_HostCDC * hcdc,
void * buf,
size_t max_len,
size_t * out_len
)
Parameters:
hcdcPointer to USB Host CDC instance.bufPointer to destination buffer.max_lenMax capacity.out_lenPointer to receive read byte count.
Returns:
SYN_OK on success.
function syn_usb_host_cdc_register¶
Register USB Host CDC class driver with USB Host Core.
Parameters:
hostPointer to USB Host instance.hcdcPointer to USB Host CDC instance.
Returns:
SYN_OK on success.
function syn_usb_host_cdc_rx_available¶
Check if receive data is available.
Parameters:
hcdcPointer to USB Host CDC instance.
Returns:
true if unread data is present.
function syn_usb_host_cdc_tx_ready¶
Check if transmit buffer is ready.
Parameters:
hcdcPointer to USB Host CDC instance.
Returns:
true if transmit buffer is available.
function syn_usb_host_cdc_write¶
Write bytes to USB Host CDC TX buffer.
Parameters:
hcdcPointer to USB Host CDC instance.dataPointer to data bytes.lenByte length.
Returns:
SYN_OK on success.
Public Static Functions Documentation¶
function host_cdc_disconnected¶
Host class disconnected callback.
Parameters:
ctxContext pointer (SYN_USB_HostCDC).
function host_cdc_probe¶
Host class probe callback for CDC ACM interfaces.
static SYN_Status host_cdc_probe (
void * ctx,
uint8_t dev_addr,
const uint8_t * iface_desc,
uint16_t len
)
Parameters:
ctxContext pointer (SYN_USB_HostCDC).dev_addrDevice bus address.iface_descPointer to interface descriptor payload.lenDescriptor byte length.
Returns:
SYN_OK on successful claim.
function host_cdc_process¶
Host class process/tick callback.
Parameters:
ctxContext pointer (SYN_USB_HostCDC).
The documentation for this class was generated from the following file src/syntropic/drivers/syn_usb_host_cdc.c