FreeRTOS port on GAP8/RISC-V
|
Macros | |
#define | ADDRESS_WRITE |
#define | ADDRESS_READ |
#define | MAX_SIZE |
Functions | |
static void | __pi_i2c_handler (void *arg) |
static uint32_t | __pi_i2c_clk_div_get (uint32_t baudrate) |
static void | __pi_i2c_cs_data_add (struct i2c_itf_data_s *driver_data, struct i2c_cs_data_s *cs_data) |
static void | __pi_i2c_cs_data_remove (struct i2c_itf_data_s *driver_data, struct i2c_cs_data_s *cs_data) |
static void | __pi_i2c_handle_pending_transfer (struct i2c_itf_data_s *driver_data) |
static void | __pi_i2c_send_stop_cmd (struct i2c_itf_data_s *driver_data) |
static int32_t | __pi_i2c_hw_fifo_both_empty (struct i2c_itf_data_s *driver_data) |
static int32_t | __pi_i2c_hw_fifo_empty (struct i2c_itf_data_s *driver_data, udma_channel_e channel) |
static void | __pi_i2c_hw_fifo_enqueue (struct i2c_itf_data_s *driver_data, struct pi_task *task, udma_channel_e channel) |
static struct pi_task * | __pi_i2c_hw_fifo_pop (struct i2c_itf_data_s *driver_data, udma_channel_e channel) |
static void | __pi_i2c_task_fifo_enqueue (struct i2c_itf_data_s *driver_data, struct pi_task *task) |
static struct pi_task * | __pi_i2c_task_fifo_pop (struct i2c_itf_data_s *driver_data) |
static void | __pi_i2c_copy_exec_read (struct i2c_itf_data_s *driver_data, struct pi_task *task) |
static void | __pi_i2c_copy_exec_write (struct i2c_itf_data_s *driver_data, struct pi_task *task) |
static void | __pi_i2c_freq_cb (void *args) |
static int32_t | __pi_i2c_baudrate_set (struct i2c_cs_data_s *cs_data, uint32_t new_baudrate) |
void | __pi_i2c_conf_init (pi_i2c_conf_t *conf) |
int32_t | __pi_i2c_open (struct pi_i2c_conf *conf, struct i2c_cs_data_s **device_data) |
void | __pi_i2c_close (struct i2c_cs_data_s *device_data) |
void | __pi_i2c_ioctl (struct i2c_cs_data_s *device_data, uint32_t cmd, void *arg) |
void | __pi_i2c_copy (struct i2c_cs_data_s *cs_data, uint32_t l2_buff, uint32_t length, pi_i2c_xfer_flags_e flags, udma_channel_e channel, struct pi_task *task) |
int32_t | __pi_i2c_detect (struct i2c_cs_data_s *cs_data, struct pi_i2c_conf *conf, uint8_t *rx_data, struct pi_task *task) |
Variables | |
static struct i2c_itf_data_s * | g_i2c_itf_data [UDMA_NB_I2C] |
#define ADDRESS_READ |
Referenced by __pi_i2c_copy_exec_read(), and __pi_i2c_detect().
#define ADDRESS_WRITE |
Referenced by __pi_i2c_copy_exec_write().
#define MAX_SIZE |
Referenced by __pi_i2c_copy_exec_read(), and __pi_i2c_copy_exec_write().
|
static |
References __pi_i2c_clk_div_get(), i2c_cs_data_s::clk_div, i2c_cs_data_s::device_id, I2C_TRACE_ERR, and i2c_cs_data_s::max_baudrate.
Referenced by __pi_i2c_ioctl().
|
static |
References I2C_TRACE_ERR, and pi_freq_get().
Referenced by __pi_i2c_baudrate_set(), __pi_i2c_detect(), __pi_i2c_freq_cb(), and __pi_i2c_open().
void __pi_i2c_close | ( | struct i2c_cs_data_s * | device_data | ) |
References __pi_i2c_cs_data_remove(), i2c_cs_data_s::device_id, i2c_itf_data_s::device_id, hal_soc_eu_clear_fc_mask(), i2c_itf_data_s::i2c_freq_cb, I2C_TRACE, i2c_itf_data_s::nb_open, i2c_itf_data_s::pending, pi_fc_event_handler_clear(), pi_freq_callback_remove(), pi_l2_free(), SOC_EVENT_UDMA_I2C_RX, SOC_EVENT_UDMA_I2C_TX, udma_deinit_device(), and UDMA_I2C_ID.
Referenced by pi_i2c_close().
void __pi_i2c_conf_init | ( | pi_i2c_conf_t * | conf | ) |
Referenced by pi_i2c_conf_init().
void __pi_i2c_copy | ( | struct i2c_cs_data_s * | cs_data, |
uint32_t | l2_buff, | ||
uint32_t | length, | ||
pi_i2c_xfer_flags_e | flags, | ||
udma_channel_e | channel, | ||
struct pi_task * | task | ||
) |
|
static |
References __pi_i2c_hw_fifo_enqueue(), ADDRESS_READ, i2c_pending_transfer_s::channel, i2c_cs_data_s::clk_div, i2c_cs_data_s::cs, i2c_itf_data_s::device_id, i2c_pending_transfer_s::flags, hal_i2c_enqueue(), I2C_CMD_CFG, I2C_CMD_RD_ACK, I2C_CMD_RD_NACK, I2C_CMD_RPT, i2c_itf_data_s::i2c_cmd_seq, I2C_CMD_START, I2C_CMD_WR, i2c_itf_data_s::i2c_stop_send, MAX_SIZE, i2c_itf_data_s::pending, i2c_pending_transfer_s::pending_buffer, i2c_pending_transfer_s::pending_repeat, i2c_pending_transfer_s::pending_repeat_size, RX_CHANNEL, TX_CHANNEL, UDMA_CORE_RX_CFG_EN, and UDMA_CORE_TX_CFG_EN.
Referenced by __pi_i2c_copy(), and __pi_i2c_handler().
|
static |
References __pi_i2c_hw_fifo_enqueue(), ADDRESS_WRITE, i2c_pending_transfer_s::channel, i2c_cs_data_s::clk_div, i2c_cs_data_s::cs, i2c_itf_data_s::device_id, i2c_pending_transfer_s::flags, hal_i2c_enqueue(), I2C_CMD_CFG, I2C_CMD_RPT, i2c_itf_data_s::i2c_cmd_seq, I2C_CMD_START, I2C_CMD_WR, i2c_itf_data_s::i2c_stop_send, MAX_SIZE, i2c_itf_data_s::pending, i2c_pending_transfer_s::pending_buffer, i2c_pending_transfer_s::pending_repeat, i2c_pending_transfer_s::pending_repeat_size, TX_CHANNEL, and UDMA_CORE_TX_CFG_EN.
Referenced by __pi_i2c_copy(), and __pi_i2c_handler().
|
static |
References i2c_itf_data_s::cs_list, and i2c_cs_data_s::next.
Referenced by __pi_i2c_open().
|
static |
References i2c_itf_data_s::cs_list, hal_compiler_barrier(), and i2c_cs_data_s::next.
Referenced by __pi_i2c_close().
int32_t __pi_i2c_detect | ( | struct i2c_cs_data_s * | cs_data, |
struct pi_i2c_conf * | conf, | ||
uint8_t * | rx_data, | ||
struct pi_task * | task | ||
) |
References __pi_i2c_clk_div_get(), __pi_i2c_hw_fifo_enqueue(), ADDRESS_READ, i2c_cs_data_s::device_id, i2c_itf_data_s::device_id, hal_i2c_enqueue(), I2C_CMD_CFG, I2C_CMD_RD_NACK, i2c_itf_data_s::i2c_cmd_seq, I2C_CMD_START, I2C_CMD_WR, i2c_itf_data_s::i2c_stop_send, I2C_TRACE_ERR, i2c_itf_data_s::pending, i2c_pending_transfer_s::pending_repeat, RX_CHANNEL, TX_CHANNEL, UDMA_CORE_RX_CFG_EN, and UDMA_CORE_TX_CFG_EN.
Referenced by pi_i2c_detect().
|
static |
References __pi_i2c_clk_div_get(), i2c_cs_data_s::clk_div, i2c_itf_data_s::cs_list, i2c_itf_data_s::device_id, hal_i2c_busy_get(), i2c_cs_data_s::max_baudrate, and i2c_cs_data_s::next.
Referenced by __pi_i2c_open().
|
static |
References i2c_pending_transfer_s::flags, I2C_CMD_RPT, i2c_itf_data_s::i2c_cmd_seq, I2C_CMD_WR, i2c_itf_data_s::i2c_stop_send, i2c_itf_data_s::pending, i2c_pending_transfer_s::pending_buffer, i2c_pending_transfer_s::pending_repeat, i2c_pending_transfer_s::pending_repeat_size, and i2c_pending_transfer_s::pending_size.
Referenced by __pi_i2c_handler().
|
static |
References __pi_i2c_copy_exec_read(), __pi_i2c_copy_exec_write(), __pi_i2c_handle_pending_transfer(), __pi_i2c_hw_fifo_pop(), __pi_i2c_send_stop_cmd(), __pi_i2c_task_fifo_pop(), __pi_irq_handle_end_of_task(), i2c_pending_transfer_s::channel, i2c_itf_data_s::hw_buffer, i2c_itf_data_s::i2c_stop_send, i2c_itf_data_s::nb_events, i2c_itf_data_s::pending, i2c_pending_transfer_s::pending_repeat, RX_CHANNEL, TX_CHANNEL, UDMA_CHANNEL_NB_EVENTS_LOG2, and UDMA_I2C_ID.
Referenced by __pi_i2c_open().
|
static |
References __pi_i2c_hw_fifo_empty(), RX_CHANNEL, and TX_CHANNEL.
Referenced by __pi_i2c_copy().
|
static |
References i2c_itf_data_s::hw_buffer.
Referenced by __pi_i2c_hw_fifo_both_empty().
|
static |
References i2c_itf_data_s::hw_buffer.
Referenced by __pi_i2c_copy_exec_read(), __pi_i2c_copy_exec_write(), and __pi_i2c_detect().
|
static |
References i2c_itf_data_s::hw_buffer.
Referenced by __pi_i2c_handler().
void __pi_i2c_ioctl | ( | struct i2c_cs_data_s * | device_data, |
uint32_t | cmd, | ||
void * | arg | ||
) |
References __pi_i2c_baudrate_set().
Referenced by pi_i2c_ioctl().
int32_t __pi_i2c_open | ( | struct pi_i2c_conf * | conf, |
struct i2c_cs_data_s ** | device_data | ||
) |
References __pi_i2c_clk_div_get(), __PI_I2C_CMD_BUFF_SIZE, __pi_i2c_cs_data_add(), __pi_i2c_freq_cb(), __pi_i2c_handler(), i2c_cs_data_s::clk_div, i2c_cs_data_s::cs, i2c_itf_data_s::cs_list, i2c_cs_data_s::device_id, i2c_itf_data_s::device_id, i2c_itf_data_s::fifo_head, i2c_itf_data_s::fifo_tail, hal_soc_eu_set_fc_mask(), i2c_itf_data_s::hw_buffer, i2c_itf_data_s::i2c_cmd_index, i2c_itf_data_s::i2c_cmd_seq, I2C_CMD_STOP, I2C_CMD_WAIT, i2c_itf_data_s::i2c_freq_cb, i2c_itf_data_s::i2c_stop_send, i2c_itf_data_s::i2c_stop_seq, I2C_TRACE, I2C_TRACE_ERR, i2c_cs_data_s::max_baudrate, i2c_itf_data_s::nb_events, i2c_itf_data_s::nb_open, i2c_cs_data_s::next, i2c_itf_data_s::pending, pi_fc_event_handler_set(), pi_freq_callback_add(), pi_freq_callback_init(), pi_l2_free(), pi_l2_malloc(), SOC_EVENT_UDMA_I2C_RX, SOC_EVENT_UDMA_I2C_TX, UDMA_I2C_ID, and udma_init_device().
Referenced by pi_i2c_open().
|
static |
References __PI_I2C_STOP_CMD_SIZE, i2c_itf_data_s::device_id, hal_i2c_enqueue(), i2c_itf_data_s::i2c_stop_send, i2c_itf_data_s::i2c_stop_seq, TX_CHANNEL, and UDMA_CORE_TX_CFG_EN.
Referenced by __pi_i2c_handler().
|
static |
References i2c_itf_data_s::fifo_head, and i2c_itf_data_s::fifo_tail.
Referenced by __pi_i2c_copy().
|
static |
References i2c_itf_data_s::fifo_head.
Referenced by __pi_i2c_handler().
|
static |