Functions | |
void | uart_usb_flush (void) |
This function sends the data stored in the USB transmit buffer. More... | |
char | uart_usb_getchar (void) |
This function reads one byte from the USB bus. More... | |
void | uart_usb_init (void) |
This function initializes the UART over USB emulation driver. More... | |
int | uart_usb_putchar (int data_to_send) |
This function fills the USB transmit buffer with the new data. More... | |
bool | uart_usb_test_hit (void) |
This function checks if a character has been received on the USB bus. More... | |
bool | uart_usb_tx_ready (void) |
This function checks if the USB emission buffer is ready to accept at at least 1 byte. More... | |
Variables | |
bool | b_rx_new |
bool | b_tx_new |
void uart_usb_flush | ( | void | ) |
This function sends the data stored in the USB transmit buffer.
This function does nothing if there is no data in the buffer.
References b_tx_new, Is_usb_write_enabled, TX_EP, and Usb_ack_in_ready_send.
Referenced by device_cdc_task(), and uart_usb_putchar().
char uart_usb_getchar | ( | void | ) |
This function reads one byte from the USB bus.
If one byte is present in the USB fifo, this byte is returned. If no data is present in the USB fifo, this function waits for USB data.
References b_rx_new, RX_EP, uart_usb_test_hit(), Usb_ack_out_received_free, Usb_byte_count, and Usb_read_endpoint_data.
Referenced by device_cdc_task().
void uart_usb_init | ( | void | ) |
This function initializes the UART over USB emulation driver.
References b_rx_new, and b_tx_new.
Referenced by device_cdc_task_init().
int uart_usb_putchar | ( | int | data_to_send | ) |
This function fills the USB transmit buffer with the new data.
This buffer is sent if complete. To flush this buffer before waiting full, launch the uart_usb_flush() function.
data_to_send |
References Is_usb_write_enabled, TX_EP, uart_usb_flush(), uart_usb_tx_ready(), and Usb_write_endpoint_data.
Referenced by device_cdc_task().
bool uart_usb_test_hit | ( | void | ) |
This function checks if a character has been received on the USB bus.
References b_rx_new, Is_usb_out_received, RX_EP, Usb_ack_out_received_free, Usb_byte_count, and Usb_reset_endpoint_fifo_access.
Referenced by device_cdc_task(), and uart_usb_getchar().
bool uart_usb_tx_ready | ( | void | ) |
This function checks if the USB emission buffer is ready to accept at at least 1 byte.
References b_tx_new, Is_usb_write_enabled, TX_EP, and Usb_reset_endpoint_fifo_access.
Referenced by device_cdc_task(), and uart_usb_putchar().
bool b_rx_new |
Referenced by uart_usb_getchar(), uart_usb_init(), and uart_usb_test_hit().
bool b_tx_new |
Referenced by uart_usb_flush(), uart_usb_init(), and uart_usb_tx_ready().