123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- /*
- * @file hv_drv_audio.h
- * @brief Header file of audio module.
- *
- * @verbatim
- * ==============================================================================
- * ##### How to use #####
- * ==============================================================================
- * (+) Use Hv_Drv_Audio_??Init()
- *
- * @endverbatim
- * @author HiView SoC Software Team
- * @version 1.0.0
- * @date 2022-08-18
- */
- #ifndef __SDK_DRIVER_AUDIO_H__
- #define __SDK_DRIVER_AUDIO_H__
- #include "hv_comm_DataType.h"
- #include "hv_comm_DataBase.h"
- #include "hv_comm_Define.h"
- #define _AUDIO_FLAG_ENABLE 1
- #define _AUDIO_FLAG_DISABLE 0
- #define _AUDIO_MAX_VOLUME 100
- typedef enum _AudioCkRef
- {
- CLK_27M = 0,
- CLK_HDMI = 1,
- CLK_DP = 2,
- CLK_CK_MAX = 3
- }AudioCkRef;
- /**
- * @brief Audio PLL reset.
- */
- VOID Hv_Drv_Audio_PllReset(VOID);
- /**
- * @brief set reset.
- */
- VOID Hv_Drv_Audio_SetReset(VOID);
- /**
- * @brief set VCO to 27M and fs to 48K.
- */
- VOID Hv_Drv_Audio_ManualDefaultClock(VOID);
- /**
- * @brief Check Lock PLL State.
- */
- Status Hv_Drv_Audio_GetClockLockState(VOID);
- /**
- * @brief Lock PLL.
- */
- VOID Hv_Drv_Audio_ClockLock(VOID);
- /**
- * @brief change new FS's PLL configures.
- */
- VOID Hv_Drv_Audio_ChangeClock(VOID);
- /**
- * @brief set PLL configures.
- */
- VOID Hv_Drv_Audio_SetAudioClock(VOID);
- /**
- * @brief initialize audio Pll.
- */
- VOID Hv_Drv_Audio_PllInit(VOID);
- /**
- * @brief initialize audio GPIO.
- */
- VOID Hv_Drv_Audio_GpioInit(VOID);
- /**
- * @brief initialize audio RX IP.
- */
- VOID Hv_Drv_Audio_RxInit(VOID);
- /**
- * @brief initialize audio TX IP.
- */
- VOID Hv_Drv_Audio_TxInit(VOID);
- /**
- * @brief initialize audio DAC IP.
- */
- VOID Hv_Drv_Audio_DacInit(VOID);
- /**
- * @brief initialize audio HW IP.
- */
- VOID Hv_Drv_Audio_HwInit(VOID);
- /**
- * @brief initialize audio DM IP.
- */
- VOID Hv_Drv_Audio_DmInit(VOID);
- /**
- * @brief initialize audio Interrupt.
- */
- VOID Hv_Drv_Audio_InterruptInit(VOID);
- /**
- * @brief initialize audio Path.
- */
- VOID Hv_Drv_Audio_PathInit(VOID);
- /**
- * @brief set audio source.
- * @param[in] uiRxOutIndex: HDMI1/HDMI2/DP1/DP2.
- */
- Status Hv_Drv_Audio_SetSource(UINT32 uiRxOutIndex, ChannelType enChannelType);
- /**
- * @brief get headset volume value from datebase.
- * @return 0-100 value.
- */
- UINT32 Hv_Drv_Audio_GetHeadsetVolume(VOID);
- /**
- * @brief get speaker volume value from datebase.
- * @return 0-100 value.
- */
- UINT32 Hv_Drv_Audio_GetSpeakerVolume(VOID);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiDacVolumeValue: 0-100.
- */
- Status Hv_Drv_Audio_SetHeadsetVolume(UINT32 uiDacVolumeValue);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiDacVolumeValue: 0-100.
- */
- Status Hv_Drv_Audio_SetSpeakerVolume(UINT32 uiDacVolumeValue);
- /**
- * @brief Set DAC Mute Bit.
- */
- void Hv_Drv_Audio_SetMuteBit(UINT32 uiBitMsk);
- /**
- * @brief Clear DAC Mute Bit.
- */
- void Hv_Drv_Audio_ClearMuteBit(UINT32 uiBitMsk);
- /**
- * @brief mute audio DAC from UI.
- */
- VOID Hv_Drv_Audio_DACMute(UINT32 uiBitMsk);
- /**
- * @brief unmute audio DAC from UI.
- */
- VOID Hv_Drv_Audio_DACUnMute(UINT32 uiBitMsk);
- /**
- * @brief mute audio path from channel manager.
- */
- VOID Hv_Drv_Audio_TXMute(UINT32 uiBitMsk);
- /**
- * @brief unmute audio path from channel manager.
- */
- VOID Hv_Drv_Audio_TXUnMute(UINT32 uiBitMsk);
- #ifdef HV_PROJECT_CONFIG_AUDIO_EQ
- /**
- * @brief set default value to s_tAudioEqData.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetEQDefaultValue(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] : uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetLpf0DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetHpf0DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetBpf0DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetBpf1DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetBpf2DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetBpf3DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_GetBpf4DataAndSetRegs(UINT32 uiEQMode);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetLpf0DataAndSetRegs(UINT32 uiEQMode, AudioLpfData stAudioLpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetHpf0DataAndSetRegs(UINT32 uiEQMode, AudioHpfData stAudioHpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetBpf0DataAndSetRegs(UINT32 uiEQMode, AudioBpfData stAudioBpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetBpf1DataAndSetRegs(UINT32 uiEQMode, AudioBpfData stAudioBpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetBpf2DataAndSetRegs(UINT32 uiEQMode, AudioBpfData stAudioBpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetBpf3DataAndSetRegs(UINT32 uiEQMode, AudioBpfData stAudioBpfData);
- /**
- * @brief set 0-100 value to driver.
- * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
- */
- VOID Hv_Drv_Audio_SetBpf4DataAndSetRegs(UINT32 uiEQMode, AudioBpfData stAudioBpfData);
- #endif
- /**
- * @brief set DDR size value in DM register.
- */
- VOID Hv_Drv_Audio_SetSoundDelayDDRSize(UINT32 uiDelayTime);
- /**
- * @brief set DDR Address value in DM register.
- */
- VOID Hv_Drv_Audio_SetSoundDelayDDRAddress(VOID);
- /**
- * @brief enalbe the DM write module.
- */
- VOID Hv_Drv_Audio_DmWriteEnable(VOID);
- /**
- * @brief enalbe the DM read module.
- */
- VOID Hv_Drv_Audio_DmReadEnable(VOID *pvArg, USHORT16 usTimerId);
- /**
- * @brief disalbe the DM module.
- */
- VOID Hv_Drv_Audio_DmDisable(VOID);
- /**
- * @brief audio spdif out.
- */
- VOID Hv_Drv_Audio_SetSpdifOutMode(BOOL bAudioSpdifOut);
- #endif
|