Class internal implementation.
Routines to control serial line | |
static uint8_t | udi_cdc_setup_to_port (void) |
Returns the port number corresponding at current setup request. More... | |
static void | udi_cdc_line_coding_received (void) |
Sends line coding to application. More... | |
static void | udi_cdc_ctrl_state_change (uint8_t port, bool b_set, le16_t bit_mask) |
Records new state. More... | |
static void | udi_cdc_ctrl_state_notify (uint8_t port, udd_ep_id_t ep) |
Check and eventually notify the USB host of new state. More... | |
static void | udi_cdc_serial_state_msg_sent (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) |
Ack sent of serial state message Callback called after serial state message sent. More... | |
Routines to process data transfer | |
static bool | udi_cdc_rx_start (uint8_t port) |
Enable the reception of data from the USB host. More... | |
static void | udi_cdc_data_received (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) |
Update rx buffer management with a new data Callback called after data reception on USB line. More... | |
static void | udi_cdc_data_sent (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) |
Ack sent of tx buffer Callback called after data transfer on USB line. More... | |
static void | udi_cdc_tx_send (uint8_t port) |
Send buffer on line or wait a SOF event. More... | |
Records new state.
port | Communication port number to manage |
b_set | State is enabled if true, else disabled |
bit_mask | Field to process (see CDC_SERIAL_STATE_ defines) |
References cpu_irq_restore(), cpu_irq_save(), MREPEAT, UDI_CDC_COMM_EP_0, udi_cdc_ctrl_state_notify(), UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_COMM_EP, and udi_cdc_state.
Referenced by udi_cdc_ctrl_signal_dcd(), udi_cdc_ctrl_signal_dsr(), udi_cdc_multi_ctrl_signal_dcd(), udi_cdc_multi_ctrl_signal_dsr(), udi_cdc_multi_signal_framing_error(), udi_cdc_multi_signal_overrun(), udi_cdc_multi_signal_parity_error(), udi_cdc_signal_framing_error(), udi_cdc_signal_overrun(), and udi_cdc_signal_parity_error().
|
static |
Check and eventually notify the USB host of new state.
port | Communication port number to manage |
ep | Port communication endpoint |
References udd_ep_run(), udi_cdc_serial_state_msg_ongoing, udi_cdc_serial_state_msg_sent(), udi_cdc_state, uid_cdc_state_msg, value, and usb_cdc_notify_serial_state_t::value.
Referenced by udi_cdc_ctrl_state_change(), and udi_cdc_serial_state_msg_sent().
|
static |
Update rx buffer management with a new data Callback called after data reception on USB line.
status | UDD_EP_TRANSFER_OK, if transfer finish |
status | UDD_EP_TRANSFER_ABORT, if transfer aborted |
n | number of data received |
References MREPEAT, udd_ep_run(), UDD_EP_TRANSFER_OK, UDI_CDC_DATA_EP_OUT_TO_PORT, UDI_CDC_PORT_NB, udi_cdc_rx_buf, udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, UDI_CDC_RX_BUFFERS, udi_cdc_rx_start(), and udi_cdc_rx_trans_ongoing.
Referenced by udi_cdc_rx_start().
|
static |
Ack sent of tx buffer Callback called after data transfer on USB line.
status | UDD_EP_TRANSFER_OK, if transfer finished |
status | UDD_EP_TRANSFER_ABORT, if transfer aborted |
n | number of data transfered |
References MREPEAT, UDD_EP_TRANSFER_OK, UDI_CDC_DATA_EP_IN_TO_PORT, UDI_CDC_PORT_NB, udi_cdc_tx_both_buf_to_send, udi_cdc_tx_buf_nb, udi_cdc_tx_buf_sel, UDI_CDC_TX_EMPTY_NOTIFY, udi_cdc_tx_send(), udi_cdc_tx_trans_ongoing, and UNUSED.
Referenced by udi_cdc_tx_send().
|
static |
Sends line coding to application.
Called after SETUP request when line coding data is received.
References UDI_CDC_SET_CODING_EXT, udi_cdc_setup_to_port(), and UNUSED.
Referenced by udi_cdc_comm_setup().
|
static |
Enable the reception of data from the USB host.
The value udi_cdc_rx_trans_sel indicate the RX buffer to fill.
port | Communication port number to manage |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), MREPEAT, udd_ep_run(), UDI_CDC_DATA_EP_OUT_0, udi_cdc_data_received(), udi_cdc_multi_is_rx_ready(), UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_OUT, udi_cdc_rx_buf, udi_cdc_rx_buf_nb, udi_cdc_rx_buf_sel, UDI_CDC_RX_BUFFERS, UDI_CDC_RX_NOTIFY, udi_cdc_rx_pos, and udi_cdc_rx_trans_ongoing.
Referenced by udi_cdc_data_enable(), udi_cdc_data_received(), udi_cdc_multi_getc(), udi_cdc_multi_read_buf(), and udi_cdc_multi_read_no_polling().
|
static |
Ack sent of serial state message Callback called after serial state message sent.
status | UDD_EP_TRANSFER_OK, if transfer finished |
status | UDD_EP_TRANSFER_ABORT, if transfer aborted |
n | number of data transfered |
References CDC_SERIAL_STATE_BREAK, CDC_SERIAL_STATE_FRAMING, CDC_SERIAL_STATE_OVERRUN, CDC_SERIAL_STATE_PARITY, CDC_SERIAL_STATE_RING, MREPEAT, udi_cdc_ctrl_state_notify(), UDI_CDC_GET_PORT_FROM_COMM_EP, UDI_CDC_PORT_NB, udi_cdc_serial_state_msg_ongoing, udi_cdc_state, uid_cdc_state_msg, UNUSED, and usb_cdc_notify_serial_state_t::value.
Referenced by udi_cdc_ctrl_state_notify().
|
static |
Returns the port number corresponding at current setup request.
References MREPEAT, udd_ctrl_request_t::req, udd_g_ctrlreq, UDI_CDC_IFACE_COMM_TO_PORT, UDI_CDC_PORT_NB, and usb_setup_req_t::wIndex.
Referenced by udi_cdc_comm_setup(), and udi_cdc_line_coding_received().
|
static |
Send buffer on line or wait a SOF event.
port | Communication port number to manage |
References cpu_irq_restore(), cpu_irq_save(), MREPEAT, udd_ep_run(), udd_get_frame_number(), udd_get_micro_frame_number(), udd_is_high_speed(), UDI_CDC_DATA_EP_IN_0, udi_cdc_data_sent(), UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_IN, udi_cdc_tx_both_buf_to_send, udi_cdc_tx_buf, udi_cdc_tx_buf_nb, udi_cdc_tx_buf_sel, UDI_CDC_TX_BUFFERS, udi_cdc_tx_sof_num, and udi_cdc_tx_trans_ongoing.
Referenced by udi_cdc_data_enable(), udi_cdc_data_sent(), and udi_cdc_data_sof_notify().