FreeRTOS port on GAP8/RISC-V
|
Functions | |
static void | __pi_uart_handle_end_of_task (struct pi_task *task) |
static void | __pi_uart_handler (void *arg) |
static uint32_t | __pi_uart_task_fifo_enqueue (struct uart_itf_data_s *data, struct pi_task *task, udma_channel_e channel) |
static struct pi_task * | __pi_uart_task_fifo_pop (struct uart_itf_data_s *data, udma_channel_e channel) |
static void | __pi_uart_copy_exec (struct uart_itf_data_s *data, struct pi_task *task) |
static void | __pi_uart_conf_set (struct uart_itf_data_s *data, struct pi_uart_conf *conf) |
static void | __pi_uart_channel_enable (struct uart_itf_data_s *data, udma_channel_e channel) |
static void | __pi_uart_rx_abort (struct uart_itf_data_s *data) |
static void | __pi_uart_tx_abort (struct uart_itf_data_s *data) |
static int32_t | __pi_uart_flow_control_enable (struct uart_itf_data_s *data) |
static void | __pi_uart_copy_exec_flow_control (struct uart_itf_data_s *data, struct pi_task *task) |
static void | __pi_uart_freq_cb (void *args) |
static uint16_t | __pi_uart_clk_div (uint32_t baudrate) |
void | __pi_uart_conf_init (struct pi_uart_conf *conf) |
Initialize conf struct. More... | |
int32_t | __pi_uart_open (struct uart_itf_data_s **device_data, struct pi_uart_conf *conf) |
Open a device. More... | |
void | __pi_uart_close (struct uart_itf_data_s *data) |
Close a device. More... | |
int32_t | __pi_uart_ioctl (struct uart_itf_data_s *data, uint32_t cmd, void *arg) |
Ioctl commands. More... | |
int32_t | __pi_uart_copy (struct uart_itf_data_s *data, uint32_t l2_buf, uint32_t size, udma_channel_e channel, struct pi_task *task) |
Transfer data. More... | |
Variables | |
static struct uart_itf_data_s * | g_uart_itf_data [UDMA_NB_UART] |
|
inlinestatic |
References uart_itf_data_s::device_id, hal_uart_rx_enable(), hal_uart_tx_enable(), and RX_CHANNEL.
Referenced by __pi_uart_ioctl().
|
inlinestatic |
References pi_freq_get().
Referenced by __pi_uart_conf_set(), and __pi_uart_freq_cb().
void __pi_uart_close | ( | struct uart_itf_data_s * | driver_data | ) |
This function closes an opened device.
driver_data | Pointer to driver info. |
Referenced by pi_uart_close().
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. |
Referenced by pi_uart_conf_init().
|
inlinestatic |
References __pi_uart_clk_div(), uart_itf_data_s::baudrate_bps, uart_itf_data_s::device_id, hal_uart_setup_set(), uart, and UART_TRACE.
Referenced by __pi_uart_ioctl(), and __pi_uart_open().
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. |
Referenced by __pi_uart_read(), __pi_uart_write(), pi_uart_read_async(), and pi_uart_write_async().
|
static |
References uart_itf_data_s::device_id, hal_compiler_barrier(), hal_uart_enqueue(), max_size, RX_CHANNEL, UART_TRACE, and UDMA_MAX_SIZE.
Referenced by __pi_uart_copy(), and __pi_uart_handler().
|
static |
Referenced by __pi_uart_copy(), and __pi_uart_handler().
|
static |
Referenced by __pi_uart_ioctl(), and __pi_uart_open().
|
static |
References __pi_uart_clk_div(), uart_itf_data_s::baudrate_bps, uart_itf_data_s::device_id, hal_uart_clkdiv_set(), hal_uart_rx_disable(), hal_uart_rx_enable(), hal_uart_rx_status_get(), hal_uart_tx_disable(), hal_uart_tx_enable(), hal_uart_tx_status_get(), uart, and UART_TRACE.
Referenced by __pi_uart_open().
|
static |
References pi_task_push(), and pi_task_release().
Referenced by __pi_uart_handler().
|
static |
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. |
Referenced by pi_uart_ioctl().
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().
|
static |
References uart_itf_data_s::device_id, uart_itf_data_s::fifo_head, uart_itf_data_s::fifo_tail, hal_uart_rx_clear(), hal_uart_rx_disable(), RX_CHANNEL, uart, and UART_TRACE.
Referenced by __pi_uart_close(), and __pi_uart_ioctl().
|
inlinestatic |
References uart_itf_data_s::fifo_head, and uart_itf_data_s::fifo_tail.
Referenced by __pi_uart_copy().
|
static |
References uart_itf_data_s::fifo_head, and uart_itf_data_s::fifo_tail.
Referenced by __pi_uart_handler().
|
static |
References uart_itf_data_s::device_id, uart_itf_data_s::fifo_head, uart_itf_data_s::fifo_tail, hal_uart_tx_clear(), hal_uart_tx_disable(), TX_CHANNEL, uart, and UART_TRACE.
Referenced by __pi_uart_close(), and __pi_uart_ioctl().
|
static |