TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
|
Data Structures | |
struct | tt_vuart |
In-memory ring buffer descriptor for Tenstorrent virtual UART. More... |
Enumerations | |
enum | tt_vuart_role { TT_VUART_ROLE_DEVICE , TT_VUART_ROLE_HOST } |
Role of the virtual UART in the context of the shared memory buffer. More... |
Functions | |
static size_t | tt_vuart_inst (volatile const struct tt_vuart *vuart) |
Determine the instance number of a virtual UART buffer descriptor. | |
static uint32_t | tt_vuart_buf_size (uint32_t head, uint32_t tail) |
Determine the size of the given buffer. | |
static uint32_t | tt_vuart_buf_space (uint32_t head, uint32_t tail, uint32_t cap) |
Determine the free space available in the given buffer. | |
static bool | tt_vuart_buf_empty (uint32_t head, uint32_t tail) |
Determine if the given buffer is empty. | |
static bool | tt_vuart_buf_full (uint32_t head, uint32_t tail, uint32_t cap) |
Determine if the given buffer is full. | |
static int | tt_vuart_poll_in (volatile struct tt_vuart *vuart, unsigned char *p_char, enum tt_vuart_role role) |
Poll the virtual UART buffer for incoming data. | |
static void | tt_vuart_poll_out (volatile struct tt_vuart *vuart, unsigned char out_char, enum tt_vuart_role role) |
Poll the virtual UART buffer with outgoing data. |
enum tt_vuart_role |
Role of the virtual UART in the context of the shared memory buffer.
The virtual UART is a shared memory buffer that is used to communicate between a device and a host. The device and host have different perspectives on the buffer, so the role of the virtual UART is used to clarify the direction of communication.
From the perspective of the device, the transmit buffer is used to send data to the host, and the receive buffer is used to receive data from the host. Conversely, from the perspective of the host, the transmit buffer is used to send data to the device, and the receive buffer is used to receive data from the device.
Enumerator | |
---|---|
TT_VUART_ROLE_DEVICE | Device perspective of tt_vuart |
TT_VUART_ROLE_HOST | Host perspective of tt_vuart |
Determine if the given buffer is empty.
head | Head index of the buffer |
tail | Tail index of the buffer |
Determine if the given buffer is full.
head | Head index of the buffer |
tail | Tail index of the buffer |
cap | Capacity of the buffer |
Determine the size of the given buffer.
head | Head index of the buffer |
tail | Tail index of the buffer |
Determine the free space available in the given buffer.
head | Head index of the buffer |
tail | Tail index of the buffer |
cap | Capacity of the buffer |
Determine the instance number of a virtual UART buffer descriptor.
vuart | Pointer to the virtual UART buffer descriptor |
|
inlinestatic |
Poll the virtual UART buffer for incoming data.
This method returns one byte of data from the virtual UART buffer, if available. If the buffer is empty, this method returns -1 (EOF).
vuart | Pointer to the virtual UART buffer descriptor |
p_char | Pointer to the location to store the incoming byte |
role | Role with respect to the virtual UART buffer |
|
inlinestatic |
Poll the virtual UART buffer with outgoing data.
This method transmits one byte of data from the virtual UART buffer, if possible. If the buffer is empty, this method simply returns.
If writing to the virtual UART results in buffer overflow, the overflow counter is incremented and the data is discarded.
vuart | Pointer to the virtual UART buffer descriptor |
out_char | The byte to transmit |
role | Role with respect to the virtual UART buffer |