FreeRTOS port on GAP8/RISC-V
|
Data Structures | |
struct | uart_itf_data_s |
Macros | |
#define | UART_TX_BUFFER_SIZE |
#define | UART_DEFAULT_PRE_ALLOC_EVT |
#define | NB_UART |
#define | UART_DRIVER_DATA_IMPLEM_SPECIFC |
Functions | |
void | __pi_uart_conf_init (struct pi_uart_conf *conf) |
Initialize conf struct. More... | |
int32_t | __pi_uart_open (struct uart_itf_data_s **driver_data, struct pi_uart_conf *conf) |
Open a device. More... | |
void | __pi_uart_close (struct uart_itf_data_s *driver_data) |
Close a device. More... | |
int32_t | __pi_uart_ioctl (struct uart_itf_data_s *driver_data, uint32_t cmd, void *arg) |
Ioctl commands. More... | |
int32_t | __pi_uart_copy (struct uart_itf_data_s *driver_data, uint32_t l2_buf, uint32_t size, udma_channel_e channel, struct pi_task *task) |
Transfer data. More... | |
static int | __pi_uart_write (struct uart_itf_data_s *data, void *buffer, uint32_t size, pi_task_t *callback) |
Transfer data. More... | |
static int | __pi_uart_read (struct uart_itf_data_s *data, void *buffer, uint32_t size, pi_task_t *callback) |
Transfer data. More... | |
#define NB_UART |
#define UART_DEFAULT_PRE_ALLOC_EVT |
#define UART_DRIVER_DATA_IMPLEM_SPECIFC |
#define UART_TX_BUFFER_SIZE |
void __pi_uart_close | ( | struct uart_itf_data_s * | driver_data | ) |
This function closes an opened device.
driver_data | Pointer to driver info. |
void __pi_uart_conf_init | ( | struct pi_uart_conf * | conf | ) |
This function initializes a config struct with default values.
conf | Pointer to struct pi_uart_conf. |
int32_t __pi_uart_copy | ( | struct uart_itf_data_s * | driver_data, |
uint32_t | l2_buf, | ||
uint32_t | size, | ||
udma_channel_e | channel, | ||
struct pi_task * | task | ||
) |
This function allows to send/receive data using the periph. The transfer is executed immediately if there is no current transfer or no pending transfer. Otherwise, the transfer is enqueued in a fifo.
driver_data | Pointer to driver info. |
l2_buf | Address of data buffer. |
size | Size of data buffer. |
channel | Direction of transfer. |
task | Event task used to notify end of transfer. |
0 | If operation is successfull. |
-1 | Otherwise. |
int32_t __pi_uart_ioctl | ( | struct uart_itf_data_s * | driver_data, |
uint32_t | cmd, | ||
void * | arg | ||
) |
This function allows to configure a device using ioctl commands.
driver_data | Pointer to driver info. |
cmd | Ioctl command. |
arg | Ioctl command arg. |
-1 | If wrong ioctl command. |
Value | Value depending on ioctl command. |
int32_t __pi_uart_open | ( | struct uart_itf_data_s ** | driver_data, |
struct pi_uart_conf * | conf | ||
) |
This function opens a device. A conf struct and a pointer to store UART driver info should be given.
driver_data Pointer to store driver info.
conf | Pointer to struct pi_uart_conf. |
0 | If operation is successfull. |
ERRNO | An error code otherwise. |
References __pi_uart_conf_set(), __pi_uart_flow_control_enable(), __pi_uart_freq_cb(), __pi_uart_handler(), uart_itf_data_s::baudrate_bps, uart_itf_data_s::device_id, uart_itf_data_s::flow_ctrl_ena, hal_soc_eu_set_fc_mask(), memset(), uart_itf_data_s::nb_open, pi_fc_event_handler_set(), pi_freq_callback_add(), pi_freq_callback_init(), pi_l2_malloc(), SOC_EVENT_UDMA_UART_RX, SOC_EVENT_UDMA_UART_TX, uart, uart_itf_data_s::uart_freq_cb, UART_TRACE, UART_TRACE_ERR, udma_ctrl_cg_disable(), UDMA_GC, and UDMA_UART_ID.
Referenced by pi_uart_open().
|
inlinestatic |
This function allows to receive data using the periph. The transfer is executed immediately if there is no current transfer or no pending transfer. Otherwise, the transfer is enqueued in a fifo.
driver_data | Pointer to driver info. |
buffer | Pointer to data buffer. |
size | Size of data buffer. |
task | Event task used to notify end of transfer. |
0 | If operation is successfull. |
-1 | Otherwise. |
References __pi_uart_copy(), and RX_CHANNEL.
|
inlinestatic |
This function allows to send data using the periph. The transfer is executed immediately if there is no current transfer or no pending transfer. Otherwise, the transfer is enqueued in a fifo.
driver_data | Pointer to driver info. |
buffer | Pointer to data buffer. |
size | Size of data buffer. |
task | Event task used to notify end of transfer. |
0 | If operation is successfull. |
-1 | Otherwise. |
References __pi_uart_copy(), and TX_CHANNEL.
Referenced by __pi_cl_delegate_uart_write_req_callback().