Event handling Serial I/O Functionalities.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | USB_CTRL_RD_HI() |
#define | USB_CTRL_RD_LO() |
#define | USB_CTRL_WR_HI() |
#define | USB_CTRL_WR_LO() |
#define | USB_DATA_SETINP() |
#define | USB_DATA_SETOUTP() |
Typedefs | |
typedef enum pin_state_tag | pin_state_t |
Enumerations | |
enum | pin_state_tag { LOW, HIGH, LOW, HIGH } |
Functions | |
int | _read (int *f) |
int | _write (char c, int *f) |
uint8_t | sio2host_getchar (void) |
This function performs a blocking character receive functionality. More... | |
int | sio2host_getchar_nowait (void) |
This function performs a non-blocking character receive functionality. More... | |
void | sio2host_init (void) |
Initializes the Serial IO Module of the Host Device. More... | |
uint8_t | sio2host_rx (uint8_t *data, uint8_t max_length) |
Receives data from USB. More... | |
uint8_t | sio2host_tx (uint8_t *data, uint8_t length) |
Transmits data via USB. More... | |
static void | usb_getc (void) |
Gets a byte from USB FIFO. More... | |
void | usb_handler (void) |
Services data transmission or reception on USB. More... | |
static void | usb_putc (void) |
Puts a character onto USB FIFO. More... | |
Variables | |
uint8_t | usb_rx_buf [USB_RX_BUF_SIZE] |
USB receive buffer. More... | |
static uint8_t | usb_rx_buf_head |
Receive buffer head. More... | |
static uint8_t | usb_rx_buf_tail |
Receive buffer tail. More... | |
static uint8_t | usb_rx_count |
Number of bytes in receive buffer. More... | |
uint8_t | usb_tx_buf [USB_TX_BUF_SIZE] |
USB transmit buffer. More... | |
static uint8_t | usb_tx_buf_head |
Transmit buffer head. More... | |
static uint8_t | usb_tx_buf_tail |
Transmit buffer tail. More... | |
static bool | usb_tx_busy = false |
USB Tx busy flag: This is required in order to detect a Tx busy condition if the terminal program is not running, so that the FTDI chip cannot deliver its data. More... | |
static uint8_t | usb_tx_count |
Number of bytes in transmit buffer. More... | |
#define USB_CTRL_RD_HI | ( | ) |
Referenced by sio2host_init(), and usb_getc().
#define USB_CTRL_RD_LO | ( | ) |
Referenced by sio2host_init(), and usb_getc().
#define USB_CTRL_WR_HI | ( | ) |
Referenced by usb_putc().
#define USB_CTRL_WR_LO | ( | ) |
Referenced by usb_putc().
#define USB_DATA_SETINP | ( | ) |
Referenced by sio2host_init(), usb_getc(), and usb_putc().
#define USB_DATA_SETOUTP | ( | ) |
Referenced by sio2host_init(), and usb_putc().
typedef enum pin_state_tag pin_state_t |
enum pin_state_tag |
int _read | ( | int * | f | ) |
Referenced by sio2host_init().
int _write | ( | char | c, |
int * | f | ||
) |
Referenced by sio2host_init().
|
static |
Gets a byte from USB FIFO.
This function receives a byte from usb.
References nop, USB_CTRL_RD_HI, USB_CTRL_RD_LO, USB_DATA_PIN, USB_DATA_SETINP, usb_rx_buf, USB_RX_BUF_SIZE, usb_rx_buf_tail, and usb_rx_count.
Referenced by usb_handler().
|
static |
Puts a character onto USB FIFO.
This function transmits a byte over usb.
References USB_CTRL_WR_HI, USB_CTRL_WR_LO, USB_DATA_PORT, USB_DATA_SETINP, USB_DATA_SETOUTP, usb_tx_buf, usb_tx_buf_head, USB_TX_BUF_SIZE, and usb_tx_count.
Referenced by usb_handler().
uint8_t usb_rx_buf[USB_RX_BUF_SIZE] |
USB receive buffer.
Referenced by sio2host_rx(), and usb_getc().
|
static |
Receive buffer head.
Referenced by sio2host_rx().
|
static |
Receive buffer tail.
Referenced by sio2host_rx(), and usb_getc().
|
static |
Number of bytes in receive buffer.
Referenced by sio2host_rx(), and usb_getc().
uint8_t usb_tx_buf[USB_TX_BUF_SIZE] |
USB transmit buffer.
Referenced by sio2host_tx(), and usb_putc().
|
static |
Transmit buffer head.
Referenced by sio2host_tx(), and usb_putc().
|
static |
Transmit buffer tail.
Referenced by sio2host_tx().
|
static |
USB Tx busy flag: This is required in order to detect a Tx busy condition if the terminal program is not running, so that the FTDI chip cannot deliver its data.
Referenced by sio2host_tx(), and usb_handler().
|
static |
Number of bytes in transmit buffer.
Referenced by sio2host_tx(), usb_handler(), and usb_putc().