VSF Documented
Macros | Functions
i2s_common.c File Reference
#include "hal/driver/driver.h"

Macros

#define VSF_I2S_CFG_FUNCTION_RENAME   DISABLED
 

Functions

vsf_err_t vsf_i2s_init (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Initialize an I2S instance.
 
vsf_err_t vsf_i2s_tx_init (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Initialize i2s tx channel.
 
void vsf_i2s_tx_fini (vsf_i2s_t *i2s_ptr)
 Finalize i2s tx channel.
 
vsf_err_t vsf_i2s_tx_get_configuration (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Get the current configuration of i2s tx channel.
 
vsf_err_t vsf_i2s_tx_start (vsf_i2s_t *i2s_ptr)
 Start i2s tx channel.
 
vsf_err_t vsf_i2s_rx_init (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Initialize i2s rx channel.
 
void vsf_i2s_rx_fini (vsf_i2s_t *i2s_ptr)
 Finalize i2s rx channel.
 
vsf_err_t vsf_i2s_rx_get_configuration (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Get the current configuration of i2s rx channel.
 
vsf_err_t vsf_i2s_rx_start (vsf_i2s_t *i2s_ptr)
 Start i2s rx channel.
 
fsm_rt_t vsf_i2s_enable (vsf_i2s_t *i2s_ptr)
 Enable I2S instance.
 
fsm_rt_t vsf_i2s_disable (vsf_i2s_t *i2s_ptr)
 Disable i2s instance.
 
vsf_i2s_status_t vsf_i2s_status (vsf_i2s_t *i2s_ptr)
 Get the status of i2s instance.
 
vsf_i2s_capability_t vsf_i2s_capability (vsf_i2s_t *i2s_ptr)
 Get the capability of i2s instance.
 
vsf_err_t vsf_i2s_get_configuration (vsf_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr)
 Get the current configuration of an I2S instance.
 

Macro Definition Documentation

◆ VSF_I2S_CFG_FUNCTION_RENAME

#define VSF_I2S_CFG_FUNCTION_RENAME   DISABLED

Function Documentation

◆ vsf_i2s_init()

vsf_err_t vsf_i2s_init ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t i2s_cfg 
)

Initialize an I2S instance.

Parameters
[in]i2s_ptrpointer to structure vsf_i2s_t
[in]cfg_ptrpointer to configuration structure vsf_i2s_cfg_t
Returns
vsf_err_t: VSF_ERR_NONE if initialization successful, otherwise return error code
Note
It is not necessary to call vsf_i2s_fini() to deinitialization. vsf_i2s_init() should be called before any other I2S API except vsf_i2s_capability().

◆ vsf_i2s_tx_init()

vsf_err_t vsf_i2s_tx_init ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t i2s_cfg 
)

Initialize i2s tx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
[in]cfg_ptra pointer to structure vsf_i2s_cfg_t
Returns
vsf_err_t: VSF_ERR_NONE if i2s initialized successfully, or a negative error code

◆ vsf_i2s_tx_fini()

void vsf_i2s_tx_fini ( vsf_i2s_t i2s_ptr)

Finalize i2s tx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
void

◆ vsf_i2s_tx_get_configuration()

vsf_err_t vsf_i2s_tx_get_configuration ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t cfg_ptr 
)

Get the current configuration of i2s tx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
[out]cfg_ptra pointer to structure vsf_i2s_cfg_t to store the current configuration
Returns
vsf_err_t: VSF_ERR_NONE if successful, or a negative error code

◆ vsf_i2s_tx_start()

vsf_err_t vsf_i2s_tx_start ( vsf_i2s_t i2s_ptr)

Start i2s tx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
vsf_err_t: VSF_ERR_NONE if i2s started successfully, or a negative error code

◆ vsf_i2s_rx_init()

vsf_err_t vsf_i2s_rx_init ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t i2s_cfg 
)

Initialize i2s rx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
[in]cfg_ptra pointer to structure vsf_i2s_cfg_t
Returns
vsf_err_t: VSF_ERR_NONE if i2s initialized successfully, or a negative error code

◆ vsf_i2s_rx_fini()

void vsf_i2s_rx_fini ( vsf_i2s_t i2s_ptr)

Finalize i2s rx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
void

◆ vsf_i2s_rx_get_configuration()

vsf_err_t vsf_i2s_rx_get_configuration ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t cfg_ptr 
)

Get the current configuration of i2s rx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
[out]cfg_ptra pointer to structure vsf_i2s_cfg_t to store the current configuration
Returns
vsf_err_t: VSF_ERR_NONE if successful, or a negative error code

◆ vsf_i2s_rx_start()

vsf_err_t vsf_i2s_rx_start ( vsf_i2s_t i2s_ptr)

Start i2s rx channel.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
vsf_err_t: VSF_ERR_NONE if i2s started successfully, or a negative error code

◆ vsf_i2s_enable()

fsm_rt_t vsf_i2s_enable ( vsf_i2s_t i2s_ptr)

Enable I2S instance.

Parameters
[in]i2s_ptrpointer to structure vsf_i2s_t
Returns
fsm_rt_t: return fsm_rt_cpl if enabled, fsm_rt_onging if waiting to be enabled

◆ vsf_i2s_disable()

fsm_rt_t vsf_i2s_disable ( vsf_i2s_t i2s_ptr)

Disable i2s instance.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
fsm_rt_t: fsm_rt_cpl if disable complete, else return fsm_rt_onging

◆ vsf_i2s_status()

vsf_i2s_status_t vsf_i2s_status ( vsf_i2s_t i2s_ptr)

Get the status of i2s instance.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
vsf_i2s_status_t: return all status of current i2s

◆ vsf_i2s_capability()

vsf_i2s_capability_t vsf_i2s_capability ( vsf_i2s_t i2s_ptr)

Get the capability of i2s instance.

Parameters
[in]i2s_ptra pointer to structure vsf_i2s_t
Returns
vsf_i2s_capability_t: return all capability of current i2s vsf_i2s_capability_t

◆ vsf_i2s_get_configuration()

vsf_err_t vsf_i2s_get_configuration ( vsf_i2s_t i2s_ptr,
vsf_i2s_cfg_t cfg_ptr 
)

Get the current configuration of an I2S instance.

Parameters
[in]i2s_ptrpointer to structure vsf_i2s_t
[out]cfg_ptrpointer to configuration structure vsf_i2s_cfg_t to store the current configuration
Returns
vsf_err_t: VSF_ERR_NONE if successful, otherwise return error code
Note
This function retrieves the current I2S configuration including sample rate, data format, and other settings. The I2S instance should be initialized before calling this function.
Generated from commit: vsfteam/vsf@74aa6ce