bf0_hal_audprc.h
Header file of AUDPRC HAL module.
- Author
Sifli software development team
- Attention
Defines
-
HAL_AUDPRC_ERROR_NONE
No error
-
HAL_AUDPRC_ERROR_TIMEOUT
Timeout error
-
HAL_AUDPRC_ERROR_OVR
OVR error
-
HAL_AUDPRC_ERROR_UDR
UDR error
-
HAL_AUDPRC_ERROR_DMA
DMA transfer error
-
HAL_AUDPRC_ERROR_UNKNOW
Unknow Error error
-
AUDPRC_TX_OUT1_FIFO_UNDERF
AUDPRC STATUS TX OUT1 FIFO UNDER FLOW
-
AUDPRC_TX_OUT0_FIFO_UNDERF
AUDPRC STATUS TX OUT0 FIFO UNDER FLOW
-
AUDPRC_RX_IN_FIFO_OVERF
AUDPRC STATUS Rx IN FIFO OVER FLOW
-
AUDPRC_TX_OUT_FIFO_UNDERF
AUDPRC STATUS TX OUT FIFO UNDER FLOW
-
AUDPRC_RX1_FIFO_UNDERF
AUDPRC STATUS Rx0 FIF1 UNDER FLOW
-
AUDPRC_RX0_FIFO_UNDERF
AUDPRC STATUS Rx0 FIFO UNDER FLOW
-
AUDPRC_TX3_FIFO_OVERF
AUDPRC STATUS Tx3 FIFO OVER FLOW
-
AUDPRC_TX2_FIFO_OVERF
AUDPRC STATUS Tx2 FIFO OVER FLOW
-
AUDPRC_TX1_FIFO_OVERF
AUDPRC STATUS Tx1 FIFO OVER FLOW
-
AUDPRC_TX0_FIFO_OVERF
AUDPRC STATUS Tx0 FIFO OVER FLOW
-
AUDPRC_RX_FROM_CODEC
AUDPRC Source from audio codec
-
AUDPRC_RX_FROM_I2S
AUDPRC Srouce from external interface
-
AUDPRC_RX_TO_MEM
AUDPRC Output to RX buffer
-
AUDPRC_RX_TO_MUX
AUDPRC Output to DAC MUX
-
AUDPRC_TX_TO_MEM
AUDPRC Output to TX OUT buffer
-
AUDPRC_TX_TO_I2S
AUDPRC Output to I2S TX
-
AUDPRC_TX_TO_CODEC
AUDPRC Output to audio codec
-
AUDPRC_EQ_ENABLE
-
__HAL_AUDPRC_RESET_HANDLE_STATE(__HANDLE__)
Reset AUDPRC handle state.
- 参数:
__HANDLE__ – AUDPRC handle.
- 返回值:
None –
-
__HAL_AUDPRC_ENABLE(__HANDLE__)
Enable audio prc .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DISABLE(__HANDLE__)
Disable the AUDPRC .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DACPATH_DISABLE(__HANDLE__)
Disable the AUDPRC dac path .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DACPATH_ENABLE(__HANDLE__)
Enable audprc dac path .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_ADCPATH_DISABLE(__HANDLE__)
Disable the AUDPRC adc path .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_ADCPATH_ENABLE(__HANDLE__)
Enable the audprc adc path .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_SRESET_START(__HANDLE__)
AUDPRC soft reset start.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_SRESET_STOP(__HANDLE__)
AUDPRC soft reset stop.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DACPATH_SRESET(__HANDLE__)
AUDPRC DAC PATH soft reset.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_ADCPATH_SRESET(__HANDLE__)
AUDPRC ADC PATH soft reset.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_AUTO_GATE_EN(__HANDLE__)
AUDPRC auto clock gate enable.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_CLK_XTAL(__HANDLE__)
Set the AUDPRC clock from crystal.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_CLK_PLL(__HANDLE__)
Set the AUDPRC clock from pll.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DAC_DST_CODEC(__HANDLE__)
Set the AUDPRC DAC dest to audio codec.
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DAC_DST_I2S(__HANDLE__)
Set the AUDPRC DAC dest to exteral interface(I2S).
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_DAC_DST_MEM(__HANDLE__)
Set the AUDPRC DAC dest to APB interface(memory) .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_ADC_SRC_CODEC(__HANDLE__)
Set the AUDPRC ADC source from audio codec .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_ADC_SRC_I2S(__HANDLE__)
Set the AUDPRC ADC source from external interface(I2S) .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
- 返回值:
None –
-
__HAL_AUDPRC_STB_DIV_CLK(__HANDLE__, adc_div, dac_div)
Set the AUDPRC STB div clk .
- 参数:
__HANDLE__ – specifies the AUDPRC Handle.
adc_div – adc clock divider.
dac_div – dac clock divider.
- 返回值:
None –
Enums
-
enum HAL_AUDPRC_StateTypeDef
HAL State structures definition.
Values:
-
enumerator HAL_AUDPRC_STATE_RESET
AUDPRC not yet initialized or disabled
-
enumerator HAL_AUDPRC_STATE_READY
AUDPRC initialized and ready for use
-
enumerator HAL_AUDPRC_STATE_BUSY
AUDPRC internal process is ongoing
-
enumerator HAL_AUDPRC_STATE_BUSY_TX
Data Transmission process is ongoing
-
enumerator HAL_AUDPRC_STATE_BUSY_RX
Data Reception process is ongoing
-
enumerator HAL_AUDPRC_STATE_PAUSE
AUDPRC pause state: used in case of DMA
-
enumerator HAL_AUDPRC_STATE_ERROR
AUDPRC error state
-
enumerator HAL_AUDPRC_STATE_RESET
-
enum HAL_AUDPRC_ChannelTypeDef
AUDPRC TX/RX BUFFER/DMA ENUM definition.
Values:
-
enumerator HAL_AUDPRC_TX_CH0
AUDPRC TX channel 0
-
enumerator HAL_AUDPRC_TX_CH1
AUDPRC TX channel 1
-
enumerator HAL_AUDPRC_TX_CH2
AUDPRC TX channel 2
-
enumerator HAL_AUDPRC_TX_CH3
AUDPRC TX channel 3
-
enumerator HAL_AUDPRC_RX_CH0
AUDPRC RX channel 0
-
enumerator HAL_AUDPRC_RX_CH1
AUDPRC RX channel 1
-
enumerator HAL_AUDPRC_TX_OUT_CH0
AUDPRC TX Output channel 0
-
enumerator HAL_AUDPRC_TX_OUT_CH1
AUDPRC TX Output channel 1
-
enumerator HAL_AUDPRC_INSTANC_CNT
Total dma/buffer counter
-
enumerator HAL_AUDPRC_TX_CH0
Functions
-
HAL_StatusTypeDef HAL_AUDPRC_Init(AUDPRC_HandleTypeDef *haprc)
Initializes the AUDPRC according to the specified parameters in the AUDPRC_InitTypeDef and create the associated handle.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_DeInit(AUDPRC_HandleTypeDef *haprc)
DeInitializes the AUDPRC peripheral.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
- 返回值:
HAL – status
-
void HAL_AUDPRC_MspInit(AUDPRC_HandleTypeDef *haprc)
Initializes the AUDPRC pin setting.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
- 返回值:
None –
-
void HAL_AUDPRC_MspDeInit(AUDPRC_HandleTypeDef *haprc)
deunitializes the AUDPRC pin setting.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
- 返回值:
None –
-
HAL_StatusTypeDef HAL_AUDPRC_Config_TChanel(AUDPRC_HandleTypeDef *haprc, int channel, AUDPRC_ChnlCfgTypeDef *cfg)
Set AUDPRC transmit channel configures.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
channel – configure channel
cfg – configure parameters
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Config_RChanel(AUDPRC_HandleTypeDef *haprc, int channel, AUDPRC_ChnlCfgTypeDef *cfg)
Set AUDPRC Receive configures.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
channel – configure channel
cfg – configure parameters
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Config_OutChanel(AUDPRC_HandleTypeDef *haprc, int channel, AUDPRC_ChnlCfgTypeDef *cfg)
Set AUDPRC transmit output channel configures.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
channel – configure channel
cfg – configure parameters
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Clear_All_Channel(AUDPRC_HandleTypeDef *haprc)
all channel disable
- 参数:
haprc – -pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
- 返回:
HAL status
-
HAL_StatusTypeDef HAL_AUDPRC_Clear_Adc_Channel(AUDPRC_HandleTypeDef *haprc)
-
HAL_StatusTypeDef HAL_AUDPRC_Clear_Dac_Channel(AUDPRC_HandleTypeDef *haprc)
-
HAL_StatusTypeDef HAL_AUDPRC_Config_DACPath(AUDPRC_HandleTypeDef *haprc, AUDPRC_DACCfgTypeDef *cfg)
Configure DAC path.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
cfg – configure parameters
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Config_ADCPath(AUDPRC_HandleTypeDef *haprc, AUDPRC_ADCCfgTypeDef *cfg)
Configure ADC path.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
cfg – configure parameters
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Transmit_DMA(AUDPRC_HandleTypeDef *haprc, uint8_t *pData, uint32_t Size, uint32_t did)
Set AUDPRC Transmit data with DMA mode.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
pData – data buffer
Size – data length need to be transmit
did – DMA channel index
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_Receive_DMA(AUDPRC_HandleTypeDef *haprc, uint8_t *pData, uint32_t Size, uint32_t did)
Set AUDPRC Receive configures.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
pData – data buffer
Size – data length need to be transmit
did – DMA channel index
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_AUDPRC_DMAStop(AUDPRC_HandleTypeDef *haprc, uint32_t did)
Stop AUD PRC DMA.
- 参数:
haprc – pointer to a AUDPRC_HandleTypeDef structure that contains the configuration information for AUDPRC module
did – DMA channel index
- 返回值:
HAL – status
-
struct AUDPRC_ChnlCfgTypeDef
- #include <bf0_hal_audprc.h>
AUDPRC TX/RX channel configure structure definition.
-
struct AUDPRC_DACCfgTypeDef
- #include <bf0_hal_audprc.h>
AUDPRC DAC PATH configure structure definition.
Public Members
-
uint8_t dst_sel
-
uint8_t mixrsrc1
-
uint8_t mixrsrc0
-
uint8_t mixlsrc1
-
uint8_t mixlsrc0
-
int8_t vol_r
-
int8_t vol_l
-
uint8_t src_hbf3_mode
-
uint8_t src_hbf3_en
-
uint8_t src_hbf2_mode
-
uint8_t src_hbf2_en
-
uint8_t src_hbf1_mode
-
uint8_t src_hbf1_en
-
uint8_t src_ch_en
-
uint8_t eq_clr
-
uint8_t eq_stage
-
uint8_t eq_ch_en
-
uint8_t muxrsrc1
-
uint8_t muxrsrc0
-
uint8_t muxlsrc1
-
uint8_t muxlsrc0
-
uint8_t src_sinc_en
-
uint32_t sinc_ratio
-
uint8_t dst_sel
-
struct AUDPRC_ADCCfgTypeDef
- #include <bf0_hal_audprc.h>
AUDPRC ADC PATH configure structure definition.
-
struct AUDPRC_InitTypeDef
- #include <bf0_hal_audprc.h>
AUDPRC Init structure definition.
Public Members
-
uint32_t clk_div
Source clk for AUDPRC module
-
uint16_t adc_div
adc AUDPRC adc clock configure
-
uint16_t dac_div
dac AUDPRC dac clock configure
-
uint8_t clk_sel
0:xtal 48M 1:PLL 44.1M
-
AUDPRC_DACCfgTypeDef dac_cfg
dac AUDPRC DAC PATH configure
-
AUDPRC_ADCCfgTypeDef adc_cfg
dac AUDPRC ADC PATH configure
-
uint32_t clk_div
-
struct AUDPRC_CLK_CONFIG_TYPE
- #include <bf0_hal_audprc.h>
audprc clock config definition
-
struct AUDPRC_HandleTypeDef
- #include <bf0_hal_audprc.h>
AUDPRC handle Structure definition.
Public Members
-
AUDPRC_TypeDef *Instance
AUDPRC registers base address
-
AUDPRC_InitTypeDef Init
AUDPRC communication parameters
-
DMA_HandleTypeDef *hdma[HAL_AUDPRC_INSTANC_CNT]
AUDPRC Tx/rx Channel DMA handle parameters
-
uint8_t *buf[HAL_AUDPRC_INSTANC_CNT]
AUDPRC data buffer
-
uint32_t dataSize[HAL_AUDPRC_INSTANC_CNT]
AUDPRC Data size
-
uint16_t bufTxSize
AUDPRC Data buffer size
-
uint16_t bufRxSize
AUDPRC Data buffer size
-
HAL_LockTypeDef Lock
AUDPRC locking object
-
HAL_AUDPRC_StateTypeDef State[HAL_AUDPRC_INSTANC_CNT]
AUDPRC communication state
-
uint32_t ErrorCode
AUDPRC Error code This parameter can be a value of AUDPRC Error
-
uint16_t dest_sel
AUDPRC destination path selet
-
uint16_t channel_ref
HAL_AUDPRC_ChannelTypeDef bit map
-
AUDPRC_TypeDef *Instance