📄 pmic_audio.h
字号:
* @param[in] rampSpeed The desired anti-pop circuitry ramp speed.
*
* @retval PMIC_SUCCESS If the anti-pop circuitry was successfully
* enabled.
* @retval PMIC_ERROR If the anti-pop circuitry could not be
* enabled.
*/
PMIC_STATUS PmicAudioAntipopEnable(
const PMIC_AUDIO_ANTI_POP_RAMP_SPEED rampSpeed);
/*!
* @brief Disable the anti-pop circuitry.
*
* Disable the use of the built-in anti-pop circuitry to prevent noise from
* being generated when an external audio device is inserted or removed
* from an audio plug.
*
* @retval PMIC_SUCCESS If the anti-pop circuitry was successfully
* disabled.
* @retval PMIC_ERROR If the anti-pop circuitry could not be
* disabled.
*/
PMIC_STATUS PmicAudioAntipopDisable(void);
/*!
* @brief Performs a reset of the Voice CODEC/Stereo DAC digital filter.
*
* This function performs a reset of the digital filter using the back-to-back
* SPI write procedure as documented in the SC55112 PMIC DTS document.
*
* @retval PMIC_SUCCESS If the digital filter was successfully
* reset.
* @retval PMIC_ERROR If the digital filter could not be reset.
*/
PMIC_STATUS PmicAudioDigitalFilterReset(const PMIC_AUDIO_HANDLE handle);
/*!
* @brief Get the most recent PTT button voltage reading.
*
* This function returns the most recent reading for the PTT button voltage.
* The value may be used during the processing of the PTT_BUTTON_RANGE event
* as part of the headset ID detection process.
*
* @retval PMIC_SUCCESS If the most recent PTT button voltage was
* returned.
* @retval PMIC_PARAMETER_ERROR If a NULL pointer argument was given.
*/
PMIC_STATUS PmicAudioGetPttButtonLevel(unsigned int *const level);
#ifdef DEBUG
/*!
* @brief Provide a hexadecimal dump of all PMIC audio registers (DEBUG only).
*
* This function is intended strictly for debugging purposes only (i.e.,
* the DEBUG macro must be defined) and will print the current values of the
* following PMIC registers:
*
* - AUD_CODEC (Voice CODEC state)
* - ST_DAC (Stereo DAC state)
* - RX_AUD_AMPS (audio input section state)
* - TX_AUD_AMPS (audio output section state)
*
* The register fields will also be decoded.
*/
void PmicAudioDumpRegisters(void);
#endif /* DEBUG */
/*@}*/
/*!
* @name General Voice CODEC Setup and Configuration APIs
* Functions for general setup and configuration of the PMIC Voice
* CODEC hardware.
*/
/*@{*/
/*!
* @brief Set the Voice CODEC clock source and operating characteristics.
*
* Define the Voice CODEC clock source and operating characteristics. This
* must be done before the Voice CODEC is enabled.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[in] clockIn Select the clock signal source.
* @param[in] clockFreq Select the clock signal frequency.
* @param[in] samplingRate Select the audio data sampling rate.
* @param[in] invert Enable inversion of the frame sync and/or
* bit clock inputs.
*
* @retval PMIC_SUCCESS If the Voice CODEC clock settings were
* successfully configured.
* @retval PMIC_PARAMETER_ERROR If the handle or clock configuration was
* invalid.
* @retval PMIC_ERROR If the Voice CODEC clock configuration
* could not be set.
*/
PMIC_STATUS PmicAudioVcodecSetClock(
const PMIC_AUDIO_HANDLE handle,
const PMIC_AUDIO_CLOCK_IN_SOURCE clockIn,
const PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ clockFreq,
const PMIC_AUDIO_VCODEC_SAMPLING_RATE samplingRate,
const PMIC_AUDIO_CLOCK_INVERT invert);
/*!
* @brief Get the Voice CODEC clock source and operating characteristics.
*
* Get the current Voice CODEC clock source and operating characteristics.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[out] clockIn The clock signal source.
* @param[out] clockFreq The clock signal frequency.
* @param[out] samplingRate The audio data sampling rate.
* @param[out] invert Inversion of the frame sync and/or
* bit clock inputs is enabled/disabled.
*
* @retval PMIC_SUCCESS If the Voice CODEC clock settings were
* successfully retrieved.
* @retval PMIC_PARAMETER_ERROR If the handle invalid.
* @retval PMIC_ERROR If the Voice CODEC clock configuration
* could not be retrieved.
*/
PMIC_STATUS PmicAudioVcodecGetClock(
const PMIC_AUDIO_HANDLE handle,
PMIC_AUDIO_CLOCK_IN_SOURCE *const clockIn,
PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ *const clockFreq,
PMIC_AUDIO_VCODEC_SAMPLING_RATE *const samplingRate,
PMIC_AUDIO_CLOCK_INVERT *const invert);
/*!
* @brief Set the Voice CODEC primary audio channel timeslot.
*
* Set the Voice CODEC primary audio channel timeslot. This function must be
* used if the default timeslot for the primary audio channel is to be changed.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[in] timeslot Select the primary audio channel timeslot.
*
* @retval PMIC_SUCCESS If the Voice CODEC primary audio channel
* timeslot was successfully configured.
* @retval PMIC_PARAMETER_ERROR If the handle or audio channel timeslot
* was invalid.
* @retval PMIC_ERROR If the Voice CODEC primary audio channel
* timeslot could not be set.
*/
PMIC_STATUS PmicAudioVcodecSetRxtxTimeslot(
const PMIC_AUDIO_HANDLE handle,
const PMIC_AUDIO_VCODEC_TIMESLOT timeslot);
/*!
* @brief Get the current Voice CODEC primary audio channel timeslot.
*
* Get the current Voice CODEC primary audio channel timeslot.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[out] timeslot The primary audio channel timeslot.
*
* @retval PMIC_SUCCESS If the Voice CODEC primary audio channel
* timeslot was successfully retrieved.
* @retval PMIC_PARAMETER_ERROR If the handle was invalid.
* @retval PMIC_ERROR If the Voice CODEC primary audio channel
* timeslot could not be retrieved.
*/
PMIC_STATUS PmicAudioVcodecGetRxtxTimeslot(
const PMIC_AUDIO_HANDLE handle,
PMIC_AUDIO_VCODEC_TIMESLOT *const timeslot);
/*!
* @brief Set the Voice CODEC secondary recording audio channel timeslot.
*
* Set the Voice CODEC secondary audio channel timeslot. This function must be
* used if the default timeslot for the secondary audio channel is to be
* changed. The secondary audio channel timeslot is used to transmit the audio
* data that was recorded by the Voice CODEC from the secondary audio input
* channel.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[in] timeslot Select the secondary audio channel timeslot.
*
* @retval PMIC_SUCCESS If the Voice CODEC secondary audio channel
* timeslot was successfully configured.
* @retval PMIC_PARAMETER_ERROR If the handle or audio channel timeslot
* was invalid.
* @retval PMIC_ERROR If the Voice CODEC secondary audio channel
* timeslot could not be set.
*/
PMIC_STATUS PmicAudioVcodecSetSecondaryTxslot(
const PMIC_AUDIO_HANDLE handle,
const PMIC_AUDIO_VCODEC_TIMESLOT timeslot);
/*!
* @brief Get the Voice CODEC secondary recording audio channel timeslot.
*
* Get the Voice CODEC secondary audio channel timeslot.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[out] timeslot The secondary audio channel timeslot.
*
* @retval PMIC_SUCCESS If the Voice CODEC secondary audio channel
* timeslot was successfully retrieved.
* @retval PMIC_PARAMETER_ERROR If the handle was invalid.
* @retval PMIC_ERROR If the Voice CODEC secondary audio channel
* timeslot could not be retrieved.
*/
PMIC_STATUS PmicAudioVcodecGetSecondaryTxslot(
const PMIC_AUDIO_HANDLE handle,
PMIC_AUDIO_VCODEC_TIMESLOT *const timeslot);
/*!
* @brief Set/Enable the Voice CODEC options.
*
* Set or enable various Voice CODEC options. The available options include
* the use of dithering, highpass digital filters, and loopback modes.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[in] config The Voice CODEC options to enable.
*
* @retval PMIC_SUCCESS If the Voice CODEC options were
* successfully configured.
* @retval PMIC_PARAMETER_ERROR If the handle or Voice CODEC options
* were invalid.
* @retval PMIC_ERROR If the Voice CODEC options could not be
* successfully set/enabled.
*/
PMIC_STATUS PmicAudioVcodecSetConfig(
const PMIC_AUDIO_HANDLE handle,
const PMIC_AUDIO_VCODEC_CONFIG config);
/*!
* @brief Clear/Disable the Voice CODEC options.
*
* Clear or disable various Voice CODEC options.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[in] config The Voice CODEC options to be cleared/disabled.
*
* @retval PMIC_SUCCESS If the Voice CODEC options were
* successfully cleared/disabled.
* @retval PMIC_PARAMETER_ERROR If the handle or the Voice CODEC options
* were invalid.
* @retval PMIC_ERROR If the Voice CODEC options could not be
* cleared/disabled.
*/
PMIC_STATUS PmicAudioVcodecClearConfig(
const PMIC_AUDIO_HANDLE handle,
const PMIC_AUDIO_VCODEC_CONFIG config);
/*!
* @brief Get the current Voice CODEC options.
*
* Get the current Voice CODEC options.
*
* @param[in] handle Device handle from pmic_audio_open() call.
* @param[out] config The current set of Voice CODEC options.
*
* @retval PMIC_SUCCESS If the Voice CODEC options were
* successfully retrieved.
* @retval PMIC_PARAMETER_ERROR If the handle was invalid.
* @retval PMIC_ERROR If the Voice CODEC options could not be
* retrieved.
*/
PMIC_STATUS PmicAudioVcodecGetConfig(
const PMIC_AUDIO_HANDLE handle,
PMIC_AUDIO_VCODEC_CONFIG *const config);
/*!
* @brief Enable the Voice CODEC bypass audio pathway.
*
* Enables the Voice CODEC bypass pathway for audio data. This allows direct
* output of the voltages on the TX data bus line to the output amplifiers
* (bypassing the digital-to-analog converters within the Voice CODEC).
*
* @param[in] handle Device handle from pmic_audio_open() call.
*
* @retval PMIC_SUCCESS If the Voice CODEC bypass was successfully
* enabled.
* @retval PMIC_PARAMETER_ERROR If the handle was invalid.
* @retval PMIC_ERROR If the Voice CODEC bypass could not be
* enabled.
*/
PMIC_STATUS PmicAudioVcodecEnableBypass(
const PMIC_AUDIO_HANDLE handle);
/*!
* @brief Disable the Voice CODEC bypass audio pathway.
*
* Disables the Voice CODEC bypass pathway for audio data. This means that
* the TX data bus line will deliver digital data to the digital-t
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -