Common APIs used by high level application to use this USB class.
These routines are used to transfer and control data to/from USB CDC endpoint.
See Quick start guide for USB device Communication Class Device module (UDI CDC).
Modules | |
Interface with USB Device Core (UDC) | |
Structures and functions required by UDC. | |
Implementation of UDI CDC | |
Class internal implementation. | |
USB interface descriptors | |
The following structures provide predefined USB interface descriptors. | |
Interface for application with single CDC interface support | |
void | udi_cdc_ctrl_signal_dcd (bool b_set) |
Notify a state change of DCD signal. More... | |
void | udi_cdc_ctrl_signal_dsr (bool b_set) |
Notify a state change of DSR signal. More... | |
void | udi_cdc_signal_framing_error (void) |
Notify a framing error. More... | |
void | udi_cdc_signal_parity_error (void) |
Notify a parity error. More... | |
void | udi_cdc_signal_overrun (void) |
Notify a overrun. More... | |
iram_size_t | udi_cdc_get_nb_received_data (void) |
Gets the number of byte received. More... | |
bool | udi_cdc_is_rx_ready (void) |
This function checks if a character has been received on the CDC line. More... | |
int | udi_cdc_getc (void) |
Waits and gets a value on CDC line. More... | |
iram_size_t | udi_cdc_read_buf (void *buf, iram_size_t size) |
Reads a RAM buffer on CDC line. More... | |
iram_size_t | udi_cdc_multi_read_no_polling (uint8_t port, void *buf, iram_size_t size) |
Non polling reads of a up to 'size' data from CDC line. More... | |
iram_size_t | udi_cdc_read_no_polling (void *buf, iram_size_t size) |
Non polling reads of a up to 'size' data from CDC line. More... | |
iram_size_t | udi_cdc_get_free_tx_buffer (void) |
Gets the number of free byte in TX buffer. More... | |
bool | udi_cdc_is_tx_ready (void) |
This function checks if a new character sent is possible The type int is used to support scanf redirection from compiler LIB. More... | |
int | udi_cdc_putc (int value) |
Puts a byte on CDC line The type int is used to support printf redirection from compiler LIB. More... | |
iram_size_t | udi_cdc_write_buf (const void *buf, iram_size_t size) |
Writes a RAM buffer on CDC line. More... | |
Interface for application with multi CDC interfaces support | |
void | udi_cdc_multi_ctrl_signal_dcd (uint8_t port, bool b_set) |
Notify a state change of DCD signal. More... | |
void | udi_cdc_multi_ctrl_signal_dsr (uint8_t port, bool b_set) |
Notify a state change of DSR signal. More... | |
void | udi_cdc_multi_signal_framing_error (uint8_t port) |
Notify a framing error. More... | |
void | udi_cdc_multi_signal_parity_error (uint8_t port) |
Notify a parity error. More... | |
void | udi_cdc_multi_signal_overrun (uint8_t port) |
Notify a overrun. More... | |
iram_size_t | udi_cdc_multi_get_nb_received_data (uint8_t port) |
Gets the number of byte received. More... | |
bool | udi_cdc_multi_is_rx_ready (uint8_t port) |
This function checks if a character has been received on the CDC line. More... | |
int | udi_cdc_multi_getc (uint8_t port) |
Waits and gets a value on CDC line. More... | |
iram_size_t | udi_cdc_multi_read_buf (uint8_t port, void *buf, iram_size_t size) |
Reads a RAM buffer on CDC line. More... | |
iram_size_t | udi_cdc_multi_get_free_tx_buffer (uint8_t port) |
Gets the number of free byte in TX buffer. More... | |
bool | udi_cdc_multi_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... | |
int | udi_cdc_multi_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 | udi_cdc_multi_write_buf (uint8_t port, const void *buf, iram_size_t size) |
Writes a RAM buffer on CDC line. More... | |
void udi_cdc_ctrl_signal_dcd | ( | bool | b_set | ) |
Notify a state change of DCD signal.
b_set | DCD is enabled if true, else disabled |
References CDC_SERIAL_STATE_DCD, and udi_cdc_ctrl_state_change().
void udi_cdc_ctrl_signal_dsr | ( | bool | b_set | ) |
Notify a state change of DSR signal.
b_set | DSR is enabled if true, else disabled |
References CDC_SERIAL_STATE_DSR, and udi_cdc_ctrl_state_change().
iram_size_t udi_cdc_get_free_tx_buffer | ( | void | ) |
Gets the number of free byte in TX buffer.
References udi_cdc_multi_get_free_tx_buffer().
iram_size_t udi_cdc_get_nb_received_data | ( | void | ) |
Gets the number of byte received.
References udi_cdc_multi_get_nb_received_data().
int udi_cdc_getc | ( | void | ) |
Waits and gets a value on CDC line.
References udi_cdc_multi_getc().
Referenced by ISR().
bool udi_cdc_is_rx_ready | ( | void | ) |
This function checks if a character has been received on the CDC line.
1
if a byte is ready to be read. References udi_cdc_multi_is_rx_ready().
Referenced by ISR().
bool udi_cdc_is_tx_ready | ( | void | ) |
This function checks if a new character sent is possible The type int is used to support scanf redirection from compiler LIB.
1
if a new character can be sent References udi_cdc_multi_is_tx_ready().
Referenced by ISR().
void udi_cdc_multi_ctrl_signal_dcd | ( | uint8_t | port, |
bool | b_set | ||
) |
Notify a state change of DCD signal.
port | Communication port number to manage |
b_set | DCD is enabled if true, else disabled |
References CDC_SERIAL_STATE_DCD, and udi_cdc_ctrl_state_change().
void udi_cdc_multi_ctrl_signal_dsr | ( | uint8_t | port, |
bool | b_set | ||
) |
Notify a state change of DSR signal.
port | Communication port number to manage |
b_set | DSR is enabled if true, else disabled |
References CDC_SERIAL_STATE_DSR, and udi_cdc_ctrl_state_change().
iram_size_t udi_cdc_multi_get_free_tx_buffer | ( | uint8_t | port | ) |
Gets the number of free byte in TX buffer.
port | Communication port number to manage |
References cpu_irq_restore(), cpu_irq_save(), udi_cdc_tx_both_buf_to_send, udi_cdc_tx_buf_nb, udi_cdc_tx_buf_sel, UDI_CDC_TX_BUFFERS, and udi_cdc_tx_trans_ongoing.
Referenced by udi_cdc_get_free_tx_buffer(), and udi_cdc_multi_is_tx_ready().
iram_size_t udi_cdc_multi_get_nb_received_data | ( | uint8_t | port | ) |
Gets the number of byte received.
port | Communication port number to manage |
References cpu_irq_restore(), cpu_irq_save(), udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, and udi_cdc_rx_pos.
Referenced by udi_cdc_get_nb_received_data(), and udi_cdc_multi_is_rx_ready().
int udi_cdc_multi_getc | ( | uint8_t | port | ) |
Waits and gets a value on CDC line.
port | Communication port number to manage |
References usb_cdc_line_coding_t::bDataBits, cpu_irq_restore(), cpu_irq_save(), udi_cdc_data_running, udi_cdc_rx_buf, udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, udi_cdc_rx_pos, and udi_cdc_rx_start().
Referenced by udi_cdc_getc().
bool udi_cdc_multi_is_rx_ready | ( | uint8_t | port | ) |
This function checks if a character has been received on the CDC line.
port | Communication port number to manage |
1
if a byte is ready to be read. References udi_cdc_multi_get_nb_received_data().
Referenced by udi_cdc_is_rx_ready(), and udi_cdc_rx_start().
bool udi_cdc_multi_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 to manage |
1
if a new character can be sent References udi_cdc_multi_get_free_tx_buffer().
Referenced by udi_cdc_is_tx_ready(), udi_cdc_multi_putc(), and udi_cdc_multi_write_buf().
int udi_cdc_multi_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 to manage |
value | Value to put |
1
if function was successfully done, otherwise 0
. References usb_cdc_line_coding_t::bDataBits, cpu_irq_restore(), cpu_irq_save(), udi_cdc_data_running, udi_cdc_multi_is_tx_ready(), udi_cdc_tx_buf, udi_cdc_tx_buf_nb, and udi_cdc_tx_buf_sel.
Referenced by udi_cdc_putc().
iram_size_t udi_cdc_multi_read_buf | ( | uint8_t | port, |
void * | buf, | ||
iram_size_t | size | ||
) |
Reads a RAM buffer on CDC line.
port | Communication port number to manage |
buf | Values read |
size | Number of values read |
References cpu_irq_restore(), cpu_irq_save(), udi_cdc_data_running, udi_cdc_rx_buf, udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, udi_cdc_rx_pos, and udi_cdc_rx_start().
Referenced by udi_cdc_read_buf().
iram_size_t udi_cdc_multi_read_no_polling | ( | uint8_t | port, |
void * | buf, | ||
iram_size_t | size | ||
) |
Non polling reads of a up to 'size' data from CDC line.
port | Communication port number to manage |
buf | Buffer where to store read data |
size | Maximum number of data to read (size of buffer) |
References cpu_irq_restore(), cpu_irq_save(), udi_cdc_data_running, udi_cdc_rx_buf, udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, udi_cdc_rx_pos, and udi_cdc_rx_start().
Referenced by udi_cdc_read_no_polling().
void udi_cdc_multi_signal_framing_error | ( | uint8_t | port | ) |
Notify a framing error.
port | Communication port number to manage |
References CDC_SERIAL_STATE_FRAMING, and udi_cdc_ctrl_state_change().
void udi_cdc_multi_signal_overrun | ( | uint8_t | port | ) |
Notify a overrun.
port | Communication port number to manage |
References CDC_SERIAL_STATE_OVERRUN, and udi_cdc_ctrl_state_change().
void udi_cdc_multi_signal_parity_error | ( | uint8_t | port | ) |
Notify a parity error.
port | Communication port number to manage |
References CDC_SERIAL_STATE_PARITY, and udi_cdc_ctrl_state_change().
iram_size_t udi_cdc_multi_write_buf | ( | uint8_t | port, |
const void * | buf, | ||
iram_size_t | size | ||
) |
Writes a RAM buffer on CDC line.
port | Communication port number to manage |
buf | Values to write |
size | Number of value to write |
References cpu_irq_restore(), cpu_irq_save(), udi_cdc_data_running, udi_cdc_multi_is_tx_ready(), udi_cdc_tx_buf, udi_cdc_tx_buf_nb, udi_cdc_tx_buf_sel, and UDI_CDC_TX_BUFFERS.
Referenced by udi_cdc_write_buf().
int udi_cdc_putc | ( | int | value | ) |
Puts a byte on CDC line The type int is used to support printf redirection from compiler LIB.
value | Value to put |
1
if function was successfully done, otherwise 0
. References udi_cdc_multi_putc().
Referenced by ISR().
iram_size_t udi_cdc_read_buf | ( | void * | buf, |
iram_size_t | size | ||
) |
Reads a RAM buffer on CDC line.
buf | Values read |
size | Number of value read |
References udi_cdc_multi_read_buf().
iram_size_t udi_cdc_read_no_polling | ( | void * | buf, |
iram_size_t | size | ||
) |
Non polling reads of a up to 'size' data from CDC line.
buf | Buffer where to store read data |
size | Maximum number of data to read (size of buffer) |
References udi_cdc_multi_read_no_polling().
void udi_cdc_signal_framing_error | ( | void | ) |
Notify a framing error.
References CDC_SERIAL_STATE_FRAMING, and udi_cdc_ctrl_state_change().
Referenced by ISR().
void udi_cdc_signal_overrun | ( | void | ) |
Notify a overrun.
References CDC_SERIAL_STATE_OVERRUN, and udi_cdc_ctrl_state_change().
Referenced by ISR().
void udi_cdc_signal_parity_error | ( | void | ) |
Notify a parity error.
References CDC_SERIAL_STATE_PARITY, and udi_cdc_ctrl_state_change().
iram_size_t udi_cdc_write_buf | ( | const void * | buf, |
iram_size_t | size | ||
) |
Writes a RAM buffer on CDC line.
buf | Values to write |
size | Number of value to write |
References udi_cdc_multi_write_buf().