38 #include "hal_platform.h" 40 #ifdef HAL_I2S_MODULE_ENABLED 41 #ifdef HAL_I2S_SUPPORT_VFIFO 614 #endif // #ifdef HAL_I2S_SUPPORT_VFIFO 661 #ifdef HAL_I2S_EXTENDED 675 #ifdef HAL_I2S_FEATURE_TDM 676 hal_i2s_tdm_channel_t tdm_channel;
678 #ifdef HAL_I2S_EXTENDED 697 #ifdef HAL_I2S_SUPPORT_VFIFO 715 #ifdef HAL_I2S_SUPPORT_VFIFO 749 #ifdef HAL_I2S_FEATURE_MULTI_I2S 772 #ifdef HAL_I2S_FEATURE_MULTI_I2S 796 #ifdef HAL_I2S_FEATURE_MULTI_I2S 820 #ifdef HAL_I2S_FEATURE_MULTI_I2S 833 #ifdef HAL_I2S_SUPPORT_VFIFO 842 #ifdef HAL_I2S_FEATURE_MULTI_I2S 862 #ifdef HAL_I2S_FEATURE_MULTI_I2S 908 #ifdef HAL_I2S_SUPPORT_VFIFO 918 #ifdef HAL_I2S_FEATURE_MULTI_I2S 927 hal_i2s_status_t hal_i2s_enable_tx_dma_interrupt_ex(hal_i2s_port_t i2s_port);
938 #ifdef HAL_I2S_FEATURE_MULTI_I2S 946 hal_i2s_status_t hal_i2s_disable_tx_dma_interrupt_ex(hal_i2s_port_t i2s_port);
958 #ifdef HAL_I2S_FEATURE_MULTI_I2S 967 hal_i2s_status_t hal_i2s_enable_rx_dma_interrupt_ex(hal_i2s_port_t i2s_port);
978 #ifdef HAL_I2S_FEATURE_MULTI_I2S 986 hal_i2s_status_t hal_i2s_disable_rx_dma_interrupt_ex(hal_i2s_port_t i2s_port);
1005 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1021 hal_i2s_status_t hal_i2s_setup_tx_vfifo_ex(hal_i2s_port_t i2s_port, uint32_t *buffer, uint32_t threshold, uint32_t buffer_length);
1033 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1061 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1077 hal_i2s_status_t hal_i2s_setup_rx_vfifo_ex(hal_i2s_port_t i2s_port, uint32_t *buffer, uint32_t threshold, uint32_t buffer_length);
1089 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1104 #ifdef HAL_I2S_SUPPORT_VFIFO 1114 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1139 #ifdef HAL_I2S_SUPPORT_VFIFO 1149 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1174 #ifdef HAL_I2S_SUPPORT_VFIFO 1182 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1210 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1222 #ifdef HAL_I2S_SUPPORT_VFIFO 1235 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1246 hal_i2s_status_t hal_i2s_tx_write_ex(hal_i2s_port_t i2s_port, uint32_t data);
1264 #ifdef HAL_I2S_SUPPORT_VFIFO 1275 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1285 hal_i2s_status_t hal_i2s_get_tx_sample_count_ex(hal_i2s_port_t i2s_port, uint32_t *sample_count);
1300 #ifdef HAL_I2S_SUPPORT_VFIFO 1308 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1337 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1349 #ifdef HAL_I2S_SUPPORT_VFIFO 1361 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1370 hal_i2s_status_t hal_i2s_rx_read_ex(hal_i2s_port_t i2s_port, uint32_t *data);
1388 #ifdef HAL_I2S_SUPPORT_VFIFO 1399 #ifdef HAL_I2S_FEATURE_MULTI_I2S 1409 hal_i2s_status_t hal_i2s_get_rx_sample_count_ex(hal_i2s_port_t i2s_port, uint32_t *sample_count);
hal_i2s_sample_rate_t
I2S sample rate definition.
Definition: hal_platform.h:360
hal_i2s_status_t hal_i2s_init(hal_i2s_initial_type_t i2s_initial_type)
This function initializes the I2S hardware type.
hal_i2s_status_t hal_i2s_setup_rx_vfifo(uint32_t *buffer, uint32_t threshold, uint32_t buffer_length)
This function sets up the receive operation.
hal_i2s_status_t hal_i2s_get_rx_sample_count(uint32_t *sample_count)
This function queries length of the received data available in the RX VFIFO.
hal_i2s_sample_width_t sample_width
<Width per frame sync.
Definition: hal_i2s.h:680
hal_i2s_channel_number_t channel_number
Channel number of the I2S link.
Definition: hal_i2s.h:660
hal_i2s_sample_width_t
I2S sample widths.
Definition: hal_platform.h:370
hal_i2s_status_t hal_i2s_rx_read(uint32_t *data)
This function receives data from the I2S input link.
An error occurred during the function call.
Definition: hal_i2s.h:629
hal_i2s_word_select_inverse_t
Enable or disable word select clock inverting of the I2S link.
Definition: hal_platform.h:403
hal_i2s_word_select_inverse_t word_select_inverse
Enable or disable word select clock inverting of the I2S link by setting this value.
Definition: hal_i2s.h:665
Two channels.
Definition: hal_i2s.h:644
Clock source fed to an external device.
Definition: hal_i2s.h:636
hal_i2s_lr_swap_t lr_swap
Enable or disable data swapping between right and left channels of the I2S link by setting this value...
Definition: hal_i2s.h:664
Clock source comes from an external device.
Definition: hal_i2s.h:637
hal_i2s_channel_number_t
This enum defines the I2S channel number.
Definition: hal_i2s.h:642
hal_i2s_clock_mode_t
This enum defines the I2S clock mode.
Definition: hal_i2s.h:635
hal_i2s_tx_mode_t
Enable or disable right channel of the I2S TX to send the same data as on the left channel of the I2S...
Definition: hal_platform.h:384
hal_i2s_status_t hal_i2s_disable_audio_top(void)
This function disables uplink and downlink FIFOs of the I2S link.
hal_i2s_status_t hal_i2s_register_tx_vfifo_callback(hal_i2s_tx_callback_t tx_callback, void *user_data)
This function registers the callback function for output data.
hal_i2s_link_config_t i2s_in
I2S input link configuration.
Definition: hal_i2s.h:672
hal_i2s_event_t
I2S event.
Definition: hal_platform.h:354
hal_i2s_status_t hal_i2s_disable_tx_dma_interrupt(void)
This function disables the TX VFIFO DMA interrupt.
hal_i2s_tx_mode_t tx_mode
Enable or disable the I2S TX to send the same data on right and left channels.
Definition: hal_i2s.h:681
hal_i2s_status_t hal_i2s_enable_rx(void)
This function enables the I2S input link.
hal_i2s_status_t hal_i2s_tx_write(uint32_t data)
This function transmits data to the I2S output link.
hal_i2s_clock_mode_t clock_mode
I2S clock source.
Definition: hal_i2s.h:674
hal_i2s_status_t hal_i2s_get_tx_sample_count(uint32_t *sample_count)
This function queries available free space in the TX VFIFO.
hal_i2s_link_config_t i2s_out
I2S output link configuration.
Definition: hal_i2s.h:673
No error occurred during the function call.
Definition: hal_i2s.h:630
hal_i2s_rx_down_rate_t
Enable or disable twice the downsampling rate mode in the I2S RX link.
Definition: hal_platform.h:391
uint32_t msb_offset
The number of bits delay between frame sync and first data bit of the I2S link.
Definition: hal_i2s.h:662
hal_i2s_status_t hal_i2s_enable_tx(void)
This function enables the I2S output link.
hal_i2s_status_t hal_i2s_enable_tx_dma_interrupt(void)
This function enables the TX VFIFO DMA interrupt.
hal_i2s_status_t hal_i2s_disable_tx(void)
This function disables the I2S output link.
hal_i2s_status_t
This enum defines the I2S status.
Definition: hal_i2s.h:627
hal_i2s_sample_rate_t sample_rate
Sampling rate of the I2S link.
Definition: hal_i2s.h:659
hal_i2s_status_t hal_i2s_get_config(hal_i2s_config_t *config)
This function queries the I2S configuration details.
hal_i2s_lr_swap_t
Enable or disable data swapping between right and left channels of the I2S link.
Definition: hal_platform.h:397
hal_i2s_status_t hal_i2s_register_rx_vfifo_callback(hal_i2s_rx_callback_t rx_callback, void *user_data)
This function registers the callback function for input data.
hal_i2s_frame_sync_width_t
Number of bits per frame sync(FS).
Definition: hal_platform.h:377
hal_i2s_status_t hal_i2s_stop_tx_vfifo(void)
This function stops the transmit operation.
hal_i2s_status_t hal_i2s_set_config(const hal_i2s_config_t *config)
This function sets the I2S configuration details.
hal_i2s_status_t hal_i2s_enable_audio_top(void)
This function enables uplink and downlink FIFOs of the I2S link.
A wrong parameter is given.
Definition: hal_i2s.h:628
void(* hal_i2s_rx_callback_t)(hal_i2s_event_t event, void *user_data)
This function defines the I2S RX VFIFO callback function prototype.
Definition: hal_i2s.h:712
void(* hal_i2s_tx_callback_t)(hal_i2s_event_t event, void *user_data)
This function defines the I2S TX VFIFO callback function prototype.
Definition: hal_i2s.h:730
I2S configure structure.
Definition: hal_i2s.h:671
hal_i2s_status_t hal_i2s_stop_rx_vfifo(void)
This function stops the receive operation.
hal_i2s_status_t hal_i2s_deinit(void)
This function deinitializes the I2S hardware.
hal_i2s_status_t hal_i2s_disable_rx_dma_interrupt(void)
This function disables the RX VFIFO DMA interrupt.
I2S link structure.
Definition: hal_i2s.h:658
hal_i2s_status_t hal_i2s_disable_rx(void)
This function disables the I2S input link.
hal_i2s_status_t hal_i2s_setup_tx_vfifo(uint32_t *buffer, uint32_t threshold, uint32_t buffer_length)
This function sets up the transmit operation.
A single channel.
Definition: hal_i2s.h:643
hal_i2s_status_t hal_i2s_enable_rx_dma_interrupt(void)
This function enables the RX VFIFO DMA interrupt.
hal_i2s_initial_type_t
This enum defines initial type of I2S.
Definition: hal_platform.h:346
hal_i2s_rx_down_rate_t rx_down_rate
Enable or disable downsampling of the I2S RX rate by half of the I2S RX sampling rate by automaticall...
Definition: hal_i2s.h:683