Common APIs used by high level application to use this USB host class.
These routines are used by memory to transfer its data to/from USB CDC endpoint.
See Quick start guide for USB host Communication Device Class module (UHI CDC).
Modules | |
Implementation of UHI Communication Device Class | |
Class internal implementation. | |
Interface with USB Host Core (UHC) | |
Define and functions required by UHC. | |
Functions | |
void | uhi_cdc_close (uint8_t port) |
Close a port. More... | |
iram_size_t | uhi_cdc_get_nb_received (uint8_t port) |
This function returns the number of character available on the CDC line. More... | |
int | uhi_cdc_getc (uint8_t port) |
Waits and gets a value on CDC line. More... | |
bool | uhi_cdc_is_rx_ready (uint8_t port) |
This function checks if a character has been received on the CDC line. More... | |
bool | uhi_cdc_is_tx_ready (uint8_t port) |
This function checks if a new character sent is possible The type int is used to support scanf redirection from compiler LIB. More... | |
bool | uhi_cdc_open (uint8_t port, usb_cdc_line_coding_t *configuration) |
Open a port of UHI CDC interface. More... | |
int | uhi_cdc_putc (uint8_t port, int value) |
Puts a byte on CDC line The type int is used to support printf redirection from compiler LIB. More... | |
iram_size_t | uhi_cdc_read_buf (uint8_t port, void *buf, iram_size_t size) |
Reads a RAM buffer on CDC line. More... | |
iram_size_t | uhi_cdc_write_buf (uint8_t port, const void *buf, iram_size_t size) |
Writes a RAM buffer on CDC line. More... | |
void uhi_cdc_close | ( | uint8_t | port | ) |
iram_size_t uhi_cdc_get_nb_received | ( | uint8_t | port | ) |
This function returns the number of character available on the CDC line.
port | Communication port number |
References uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_port_t::line_rx, uhi_cdc_buf_t::nb, uhi_cdc_buf_t::pos, and uhi_cdc_get_port().
Referenced by uhi_cdc_is_rx_ready().
int uhi_cdc_getc | ( | uint8_t | port | ) |
Waits and gets a value on CDC line.
port | Communication port number |
References usb_cdc_line_coding_t::bDataBits, uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_port_t::conf, uhi_cdc_port_t::line_rx, uhi_cdc_buf_t::nb, uhi_cdc_buf_t::pos, uhi_cdc_buf_t::ptr, rx_data, uhi_cdc_get_port(), and uhi_cdc_rx_update().
Referenced by uart_rx_notify(), and usart_tx_callback().
bool uhi_cdc_is_rx_ready | ( | uint8_t | port | ) |
This function checks if a character has been received on the CDC line.
port | Communication port number |
true
if a byte is ready to be read. References uhi_cdc_get_nb_received().
Referenced by usart_tx_callback().
bool uhi_cdc_is_tx_ready | ( | uint8_t | port | ) |
This function checks if a new character sent is possible The type int is used to support scanf redirection from compiler LIB.
port | Communication port number |
true
if a new character can be sent References uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_line_t::buffer_size, uhi_cdc_port_t::line_tx, uhi_cdc_buf_t::nb, and uhi_cdc_get_port().
Referenced by usart_rx_callback().
bool uhi_cdc_open | ( | uint8_t | port, |
usb_cdc_line_coding_t * | configuration | ||
) |
Open a port of UHI CDC interface.
port | Communication port number |
configuration | Pointer on port configuration |
true
if the port is available References CDC_CTRL_SIGNAL_DTE_PRESENT, uhi_cdc_set_conf(), and uhi_cdc_set_ctrl_line().
Referenced by ui_usb_enum_event().
int uhi_cdc_putc | ( | uint8_t | port, |
int | value | ||
) |
Puts a byte on CDC line The type int is used to support printf redirection from compiler LIB.
port | Communication port number |
value | Value to put |
true
if function was successfully done, otherwise false
. References usb_cdc_line_coding_t::bDataBits, uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_line_t::buffer_size, uhi_cdc_port_t::conf, cpu_irq_restore(), cpu_irq_save(), uhi_cdc_port_t::line_tx, uhi_cdc_buf_t::nb, uhi_cdc_buf_t::ptr, and uhi_cdc_get_port().
Referenced by usart_rx_callback().
iram_size_t uhi_cdc_read_buf | ( | uint8_t | port, |
void * | buf, | ||
iram_size_t | size | ||
) |
Reads a RAM buffer on CDC line.
port | Communication port number |
buf | Values read |
size | Number of value read |
References uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_port_t::line_rx, uhi_cdc_buf_t::nb, uhi_cdc_buf_t::pos, uhi_cdc_buf_t::ptr, uhi_cdc_get_port(), and uhi_cdc_rx_update().
iram_size_t uhi_cdc_write_buf | ( | uint8_t | port, |
const void * | buf, | ||
iram_size_t | size | ||
) |
Writes a RAM buffer on CDC line.
port | Communication port number |
buf | Values to write |
size | Number of value to write |
References usb_cdc_line_coding_t::bDataBits, uhi_cdc_line_t::buf_sel, uhi_cdc_line_t::buffer, uhi_cdc_line_t::buffer_size, uhi_cdc_port_t::conf, cpu_irq_restore(), cpu_irq_save(), uhi_cdc_port_t::line_tx, uhi_cdc_buf_t::nb, uhi_cdc_buf_t::ptr, and uhi_cdc_get_port().