FreeRTOS port on GAP8/RISC-V
|
Macros | |
#define | I2S_ASRC_CHANNEL_OFFSET |
Functions | |
static void | __pi_i2s_rx_handler (struct i2s_itf_slot_s *slot) |
static uint32_t | __pi_i2s_clk_div (uint32_t i2s_freq) |
static void | __pi_i2s_slot_conf_init (struct pi_i2s_conf *conf) |
static int32_t | __pi_i2s_slot_conf_apply (struct i2s_itf_slot_s *slot, uint8_t is_rx) |
static int32_t | __pi_i2s_slot_conf_set (struct i2s_itf_data_s *fifo, struct pi_i2s_conf *conf) |
static void | __pi_i2s_slot_conf_get (struct i2s_itf_data_s *fifo, struct pi_i2s_conf *conf) |
static void | __pi_i2s_resume (struct i2s_itf_data_s *fifo) |
static void | __pi_i2s_suspend (struct i2s_itf_data_s *fifo) |
static uint8_t | __pi_i2s_enqueue (struct i2s_itf_slot_s *slot) |
static void * | __pi_i2s_pop (struct i2s_itf_slot_s *slot) |
static void | __pi_i2s_tx_handler (struct i2s_itf_slot_s *slot) |
static void | __pi_i2s_timestamp_enable (struct i2s_itf_data_s *itf_data, pi_udma_timestamp_t *timestamp) |
void | __pi_i2s_conf_init (struct pi_i2s_conf *conf) |
Init i2s configuration structure. More... | |
int32_t | __pi_i2s_open (struct pi_i2s_conf *conf, struct i2s_itf_data_s **device_data) |
Open i2s device. More... | |
void | __pi_i2s_close (struct i2s_itf_data_s *itf_data) |
Close i2s device. More... | |
int32_t | __pi_i2s_ioctl (struct i2s_itf_data_s *itf_data, uint32_t cmd, void *arg) |
Ioctl function. More... | |
int32_t | __pi_i2s_channel_read_async (struct i2s_itf_data_s *itf_data, uint32_t channel, pi_task_t *task) |
Load data from micro. More... | |
int32_t | __pi_i2s_read_status (pi_task_t *task, void **mem_block, size_t *size) |
Return status. More... | |
int32_t | __pi_i2s_channel_write_async (struct i2s_itf_data_s *itf_data, uint32_t channel, void *mem_block, size_t size, pi_task_t *task) |
Send data to speakers. More... | |
int32_t | __pi_i2s_write_status (pi_task_t *task) |
Return status. More... | |
Variables | |
struct i2s_itf_data_s * | g_i2s_itf_data [UDMA_NB_I2S] |
#define I2S_ASRC_CHANNEL_OFFSET |
Referenced by __pi_i2s_slot_conf_apply(), and __pi_i2s_suspend().
int32_t __pi_i2s_channel_read_async | ( | struct i2s_itf_data_s * | itf_data, |
uint32_t | channel, | ||
pi_task_t * | task | ||
) |
itf_data | Pointer to driver data. |
channel | ID of the channel to use. |
task | Pointer to struct pi_task. |
References __pi_irq_handle_end_of_task(), i2s_itf_slot_s::cur_read_buffer, pi_task_t::data, disable_irq(), i2s_itf_slot_s::fifo_head, i2s_itf_slot_s::fifo_tail, i2s_itf_slot_s::nb_ready_buffer, pi_task_t::next, restore_irq(), RX_CHANNEL, i2s_itf_slot_s::rx_conf, and i2s_itf_data_s::slots.
Referenced by pi_i2s_channel_read_async().
int32_t __pi_i2s_channel_write_async | ( | struct i2s_itf_data_s * | itf_data, |
uint32_t | channel, | ||
void * | mem_block, | ||
size_t | size, | ||
pi_task_t * | task | ||
) |
itf_data | Pointer to driver data. |
channel | ID of the channel to use. |
mem_block | Pointer to data buffer. |
size | Size of data to send. |
task | Pointer to struct pi_task. |
References __pi_irq_handle_end_of_task(), pi_task_t::data, disable_irq(), i2s_itf_slot_s::fifo_head, i2s_itf_slot_s::fifo_tail, i2s_itf_slot_s::nb_ready_buffer, pi_task_t::next, restore_irq(), i2s_itf_data_s::slots, TX_CHANNEL, and i2s_itf_slot_s::tx_conf.
Referenced by pi_i2s_channel_write_async().
|
inlinestatic |
References I2S_TRACE, and pi_freq_get().
Referenced by __pi_i2s_resume().
void __pi_i2s_close | ( | struct i2s_itf_data_s * | itf_data | ) |
i2s_id | ID of i2s interface. |
References i2s_itf_data_s::channels, i2s_itf_data_s::device_id, hal_soc_eu_clear_fc_mask(), hal_udma_ctrl_cg_enable(), hal_udma_ctrl_reset_clear(), i2s_itf_data_s::i2s_id, i2s_itf_data_s::nb_open, pi_fc_event_handler_clear(), pi_fc_l1_free(), pi_l2_free(), i2s_itf_data_s::slots, SOC_EVENT_UDMA_I2S_RX, SOC_EVENT_UDMA_I2S_TX, udma_deinit_device(), and UDMA_I2S_ID.
void __pi_i2s_conf_init | ( | struct pi_i2s_conf * | conf | ) |
conf | Pointer to i2s conf. |
|
static |
int32_t __pi_i2s_ioctl | ( | struct i2s_itf_data_s * | itf_data, |
uint32_t | cmd, | ||
void * | arg | ||
) |
i2s_id | ID of i2s interface. |
cmd | Ioctl command. |
arg | Ioctl argument. |
-1 | Uknown command. |
Value | Ioctl command return value. |
References __pi_i2s_clock_disable(), __pi_i2s_clock_enable(), __pi_i2s_conf_get(), __pi_i2s_conf_set(), __pi_i2s_resume(), __pi_i2s_slot_conf_get(), __pi_i2s_slot_conf_set(), __pi_i2s_suspend(), __pi_i2s_timestamp_enable(), i2s_itf_data_s::device_id, disable_irq(), i2s_itf_data_s::i2s_id, I2S_TRACE, and restore_irq().
int32_t __pi_i2s_open | ( | struct pi_i2s_conf * | conf, |
struct i2s_itf_data_s ** | device_data | ||
) |
conf | Pointer to i2s conf. |
device_data | Pointer to device data. |
0 | Operation is successful. |
ERRNO | Error code. |
References __pi_i2s_conf_apply(), __pi_i2s_conf_init(), __pi_i2s_handler(), __pi_i2s_slot_conf_set(), i2s_itf_data_s::block_size, i2s_itf_data_s::channels, i2s_itf_data_s::clk, i2s_itf_data_s::clkcfg, i2s_itf_data_s::cur_buffer, i2s_itf_data_s::cur_read_buffer, i2s_itf_data_s::device_id, i2s_itf_slot_s::device_id, i2s_itf_data_s::fifo_head, i2s_itf_slot_s::fifo_head, i2s_itf_data_s::fifo_tail, i2s_itf_slot_s::fifo_tail, i2s_itf_data_s::format, i2s_itf_data_s::frame_clk_freq, i2s_itf_data_s::frequency, i2s_itf_data_s::glb_setup, hal_soc_eu_set_fc_mask(), hal_udma_ctrl_cg_disable(), hal_udma_ctrl_reset_set(), I2S_CLK_EDGE_RISE, I2S_CLK_EXT_SRC_PAD, I2S_GLB_PDM_2CH_DIS, i2s_itf_data_s::i2s_id, I2S_TRACE, I2S_TRACE_ERR, I2S_WS_EDGE_RISE, I2S_WS_EXT_SRC_PAD, I2S_WS_TYPE_PULSE, i2s_itf_data_s::mem_slab, i2s_itf_data_s::nb_open, i2s_itf_data_s::nb_ready_buffer, i2s_itf_data_s::options, i2s_itf_data_s::pdm_decimation, i2s_itf_data_s::pdm_filter_ena, i2s_itf_data_s::pdm_shift, i2s_itf_data_s::pending_size, pi_fc_event_handler_set(), pi_fc_l1_free(), pi_fc_l1_malloc(), pi_l2_malloc(), i2s_itf_data_s::pingpong_buffers, i2s_itf_data_s::reenqueue, RX_CHANNEL, i2s_itf_slot_s::rx_conf, i2s_itf_slot_s::slot_cfg, i2s_itf_slot_s::slot_id, i2s_itf_data_s::slots, SOC_EVENT_UDMA_I2S_RX, SOC_EVENT_UDMA_I2S_TX, TX_CHANNEL, i2s_itf_slot_s::tx_conf, i2s_itf_data_s::udma_cfg, i2s_itf_slot_s::udma_chan_id_rx, i2s_itf_slot_s::udma_chan_id_tx, UDMA_CORE_RX_CFG_DATASIZE, UDMA_CORE_RX_CFG_EN, udma_ctrl, udma_i2s, UDMA_I2S_CLKCFG_SETUP_CLK_EDGE, UDMA_I2S_CLKCFG_SETUP_CLK_EXT_SRC, UDMA_I2S_CLKCFG_SETUP_CLK_SRC, UDMA_I2S_CLKCFG_SETUP_WS_EDGE, UDMA_I2S_CLKCFG_SETUP_WS_EXT_SRC, UDMA_I2S_CLKCFG_SETUP_WS_SRC, UDMA_I2S_CLKCFG_SETUP_WS_TYPE, UDMA_I2S_GLB_SETUP_FRAME_LENGTH, UDMA_I2S_GLB_SETUP_FULL_DUPLEX_EN, UDMA_I2S_GLB_SETUP_PDM_2CH, UDMA_I2S_GLB_SETUP_PDM_EN, UDMA_I2S_GLB_SETUP_SLOT_WIDTH, UDMA_I2S_GLB_SETUP_WS_DELAY, UDMA_I2S_ID, udma_init_device(), and i2s_itf_data_s::word_size.
|
static |
int32_t __pi_i2s_read_status | ( | pi_task_t * | task, |
void ** | mem_block, | ||
size_t * | size | ||
) |
task | Pointer to struct pi_task. |
mem_block | Pointer to data buffer. |
size | Pointer to size. |
References pi_task_t::data.
|
static |
References __pi_i2s_clk_div(), i2s_itf_data_s::channels, i2s_itf_data_s::clkcfg, i2s_itf_slot_s::cur_read_buffer, i2s_itf_slot_s::cur_write_buffer, i2s_itf_data_s::device_id, i2s_itf_slot_s::device_id, i2s_itf_slot_s::fifo_head, i2s_itf_slot_s::fifo_tail, i2s_itf_data_s::format, i2s_itf_data_s::frame_clk_freq, i2s_itf_data_s::frequency, i2s_itf_data_s::glb_setup, hal_udma_core_lin_enqueue(), hal_udma_core_lin_get(), hal_udma_i2s_clkcfg_reg_get(), hal_udma_i2s_clkcfg_reg_set(), hal_udma_i2s_glb_reg_get(), hal_udma_i2s_glb_reg_set(), hal_udma_i2s_slot_cfg_get(), hal_udma_i2s_slot_cfg_set(), hal_udma_i2s_slot_en_get(), hal_udma_i2s_slot_en_set(), I2S_CLK_ENABLE, I2S_GLB_ENABLE, I2S_TRACE, I2S_TRACE_ERR, i2s_itf_slot_s::nb_ready_buffer, i2s_itf_data_s::options, i2s_itf_slot_s::reenqueue, RX_CHANNEL, i2s_itf_slot_s::rx_conf, i2s_itf_slot_s::slot_cfg, i2s_itf_slot_s::slot_id, i2s_itf_data_s::slots, TX_CHANNEL, i2s_itf_slot_s::tx_conf, i2s_itf_slot_s::udma_chan_id_rx, i2s_itf_slot_s::udma_chan_id_tx, UDMA_CORE_LIN_ADDRGEN_CFG_CTRL_CONT, UDMA_I2S_CLKCFG_SETUP_CLK_DIV, UDMA_I2S_CLKCFG_SETUP_CLK_EN, and UDMA_I2S_GLB_SETUP_GLOBAL_EN.
Referenced by __pi_i2s_ioctl().
|
static |
|
static |
References __pi_i2s_rx_handler(), __pi_i2s_tx_handler(), i2s_itf_slot_s::device_id, hal_soc_eu_set_fc_mask(), hal_udma_i2s_word_size_get(), hal_udma_i2s_word_size_rx_set(), hal_udma_i2s_word_size_tx_set(), I2S_ASRC_CHANNEL_OFFSET, I2S_TRACE, I2S_TRACE_ERR, pi_udma_core_lin_alloc(), i2s_itf_slot_s::rx_conf, i2s_itf_slot_s::slot_cfg, i2s_itf_slot_s::slot_id, SOC_EVENT_UDMA_CHAN_LIN, i2s_itf_slot_s::tx_conf, i2s_itf_slot_s::udma_chan_id_rx, i2s_itf_slot_s::udma_chan_id_tx, UDMA_I2S_SLOT_CFG_0_BYP, UDMA_I2S_SLOT_CFG_0_ID_RX, UDMA_I2S_SLOT_CFG_0_RX_DSIZE, UDMA_I2S_SLOT_CFG_0_RX_EN, UDMA_I2S_SLOT_CFG_0_RX_LEFT_ALIGN, UDMA_I2S_SLOT_CFG_0_RX_MSB_FIRST, UDMA_I2S_SLOT_CFG_0_RX_SIGN, UDMA_I2S_SLOT_CFG_0_TX_DSIZE, UDMA_I2S_SLOT_CFG_0_TX_EN, UDMA_I2S_SLOT_CFG_0_TX_ID, UDMA_I2S_SLOT_CFG_0_TX_LEFT_ALIGN, UDMA_I2S_SLOT_CFG_0_TX_MSB_FIRST, and UDMA_I2S_SLOT_CFG_0_TX_SIGN.
Referenced by __pi_i2s_slot_conf_set().
|
static |
References I2S_TRACE, memcpy(), i2s_itf_slot_s::rx_conf, i2s_itf_data_s::slots, and i2s_itf_slot_s::tx_conf.
Referenced by __pi_i2s_ioctl().
|
static |
|
static |
References __pi_i2s_slot_conf_apply(), i2s_itf_data_s::device_id, I2S_TRACE, memcpy(), i2s_itf_slot_s::rx_conf, i2s_itf_data_s::slots, and i2s_itf_slot_s::tx_conf.
Referenced by __pi_i2s_ioctl(), and __pi_i2s_open().
|
static |
References i2s_itf_data_s::channels, i2s_itf_data_s::device_id, hal_udma_core_lin_get(), hal_udma_core_lin_stop(), hal_udma_i2s_clkcfg_reg_set(), hal_udma_i2s_glb_reg_set(), hal_udma_i2s_slot_en_set(), I2S_ASRC_CHANNEL_OFFSET, I2S_CLK_DISABLE, I2S_GLB_DISABLE, I2S_TRACE, i2s_itf_data_s::options, i2s_itf_data_s::slots, i2s_itf_slot_s::udma_chan_id_rx, i2s_itf_slot_s::udma_chan_id_tx, UDMA_I2S_CLKCFG_SETUP_CLK_EN, and UDMA_I2S_GLB_SETUP_GLOBAL_EN.
Referenced by __pi_i2s_ioctl().
|
static |
References pi_udma_timestamp_ioctl(), i2s_itf_data_s::slots, SOC_EVENT_UDMA_CHAN_LIN, TIMESTAMP_TRACE, i2s_itf_slot_s::udma_chan_id_rx, and i2s_itf_slot_s::udma_chan_id_tx.
Referenced by __pi_i2s_ioctl().
|
static |
int32_t __pi_i2s_write_status | ( | pi_task_t * | task | ) |
task | Pointer to struct pi_task. |
References pi_task_t::data.
Referenced by pi_i2s_write_status().
struct i2s_itf_data_s* g_i2s_itf_data[UDMA_NB_I2S] |