FreeRTOS port on GAP8/RISC-V
|
Functions | |
static void | __pi_i2s_handler (void *arg) |
static void | __pi_i2s_resume (struct i2s_itf_data_s *itf_data) |
static void | __pi_i2s_suspend (struct i2s_itf_data_s *itf_data) |
static uint8_t | __pi_i2s_enqueue (struct i2s_itf_data_s *itf_data) |
static void * | __pi_i2s_pop (struct i2s_itf_data_s *itf_data) |
static int32_t | __pi_i2s_conf_apply (struct i2s_itf_data_s *itf_data) |
static int32_t | __pi_i2s_conf_set (struct i2s_itf_data_s *itf_data, struct pi_i2s_conf *conf) |
static void | __pi_i2s_conf_get (struct i2s_itf_data_s *itf_data, struct pi_i2s_conf *conf) |
static void | __pi_i2s_clock_enable (struct i2s_itf_data_s *itf_data) |
static void | __pi_i2s_clock_disable (struct i2s_itf_data_s *itf_data) |
static uint32_t | __pi_i2s_clk_div (uint32_t i2s_freq) |
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_read_async (struct i2s_itf_data_s *itf_data, 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... | |
void | __pi_i2s_setup (uint32_t flags) |
Setup misc flags. More... | |
Variables | |
static uint32_t | g_i2s_flags |
struct i2s_itf_data_s * | g_i2s_itf_data [UDMA_NB_I2S<< 1] |
|
inlinestatic |
References I2S_TRACE, I2S_TRACE_ERR, and pi_freq_get().
Referenced by __pi_i2s_clock_enable().
|
static |
References i2s_itf_data_s::clk, i2s_itf_data_s::device_id, hal_i2s_cfg_clkgen0_set(), hal_i2s_cfg_clkgen1_set(), and I2S_TRACE.
Referenced by __pi_i2s_ioctl(), and __pi_i2s_suspend().
|
static |
void __pi_i2s_close | ( | struct i2s_itf_data_s * | itf_data | ) |
i2s_id | ID of i2s interface. |
Referenced by pi_i2s_close().
|
static |
References i2s_itf_data_s::channels, i2s_itf_data_s::clk, i2s_itf_data_s::device_id, i2s_itf_data_s::format, i2s_itf_data_s::frame_clk_freq, i2s_itf_data_s::frequency, g_i2s_flags, hal_i2s_chmode_ch0_set(), hal_i2s_chmode_ch1_set(), hal_i2s_filt_ch0_set(), hal_i2s_filt_ch1_set(), i2s_itf_data_s::i2s_id, I2S_TRACE_ERR, i2s_itf_data_s::mem_slab, i2s_itf_data_s::options, i2s_itf_data_s::pdm_decimation, i2s_itf_data_s::pdm_filter_ena, i2s_itf_data_s::pdm_shift, pi_fc_l1_malloc(), i2s_itf_data_s::pingpong_buffers, i2s_itf_data_s::ring_buffer, i2s_itf_data_s::ring_buffer_head, i2s_itf_data_s::ring_buffer_nb_elem, i2s_itf_data_s::ring_buffer_tail, and i2s_itf_data_s::word_size.
Referenced by __pi_i2s_conf_set(), and __pi_i2s_open().
|
static |
References i2s_itf_data_s::block_size, i2s_itf_data_s::channels, i2s_itf_data_s::format, i2s_itf_data_s::frame_clk_freq, i2s_itf_data_s::i2s_id, i2s_itf_data_s::mem_slab, 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::pingpong_buffers, and i2s_itf_data_s::word_size.
Referenced by __pi_i2s_ioctl().
void __pi_i2s_conf_init | ( | struct pi_i2s_conf * | conf | ) |
conf | Pointer to i2s conf. |
Referenced by __pi_i2s_open(), and pi_i2s_conf_init().
|
static |
References __pi_i2s_conf_apply(), i2s_itf_data_s::block_size, i2s_itf_data_s::channels, i2s_itf_data_s::format, i2s_itf_data_s::frame_clk_freq, i2s_itf_data_s::i2s_id, i2s_itf_data_s::mem_slab, 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::pingpong_buffers, and i2s_itf_data_s::word_size.
Referenced by __pi_i2s_ioctl().
|
static |
References i2s_itf_data_s::block_size, i2s_itf_data_s::cur_buffer, i2s_itf_data_s::device_id, hal_i2s_enqueue(), i2s_itf_data_s::i2s_id, max_size, i2s_itf_data_s::mem_slab, i2s_itf_data_s::options, i2s_itf_data_s::pending_buffer, i2s_itf_data_s::pending_size, pi_mem_slab_alloc(), i2s_itf_data_s::pingpong_buffers, i2s_itf_data_s::ring_buffer, i2s_itf_data_s::ring_buffer_head, i2s_itf_data_s::ring_buffer_nb_elem, and i2s_itf_data_s::udma_cfg.
Referenced by __pi_i2s_handler(), and __pi_i2s_resume().
|
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. |
Referenced by pi_i2s_ioctl().
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. |
Referenced by pi_i2s_open().
|
static |
References i2s_itf_data_s::ring_buffer, i2s_itf_data_s::ring_buffer_nb_elem, and i2s_itf_data_s::ring_buffer_tail.
Referenced by __pi_i2s_handler(), and __pi_i2s_read_async().
int32_t __pi_i2s_read_async | ( | struct i2s_itf_data_s * | itf_data, |
pi_task_t * | task | ||
) |
itf_data | Pointer to driver data. |
task | Pointer to struct pi_task. |
References __pi_i2s_pop(), __pi_irq_handle_end_of_task(), i2s_itf_data_s::block_size, i2s_itf_data_s::cur_read_buffer, pi_task_t::data, disable_irq(), i2s_itf_data_s::fifo_head, i2s_itf_data_s::fifo_tail, i2s_itf_data_s::nb_ready_buffer, pi_task_t::next, i2s_itf_data_s::options, i2s_itf_data_s::pingpong_buffers, and restore_irq().
Referenced by pi_i2s_read_async().
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. |
Referenced by pi_i2s_read_status().
|
static |
References __pi_i2s_clock_enable(), __pi_i2s_enqueue(), i2s_itf_data_s::block_size, i2s_itf_data_s::cur_buffer, i2s_itf_data_s::cur_read_buffer, i2s_itf_data_s::device_id, i2s_itf_data_s::fifo_head, i2s_itf_data_s::fifo_tail, i2s_itf_data_s::format, i2s, i2s_itf_data_s::i2s_id, I2S_TRACE, i2s_itf_data_s::nb_ready_buffer, i2s_itf_data_s::options, i2s_itf_data_s::reenqueue, i2s_itf_data_s::udma_cfg, and i2s_itf_data_s::word_size.
Referenced by __pi_i2s_ioctl().
void __pi_i2s_setup | ( | uint32_t | flags | ) |
|
static |
References __pi_i2s_clock_disable(), i2s_itf_data_s::device_id, hal_i2s_clear(), i2s_itf_data_s::i2s_id, i2s_itf_data_s::nb_ready_buffer, and i2s_itf_data_s::reenqueue.
Referenced by __pi_i2s_ioctl().
|
static |
Referenced by __pi_i2s_conf_apply(), and __pi_i2s_setup().
struct i2s_itf_data_s* g_i2s_itf_data[UDMA_NB_I2S<< 1] |