The tfa9xxx driver provide codec control interface.
|
status_t | TFA9XXX_Init (tfa9xxx_handle_t *handle, tfa9xxx_config_t *tfa9xxxConfig) |
| Initialize the TFA, put the TFA to operating state, allocate memory side. More...
|
|
status_t | TFA9XXX_Deinit (tfa9xxx_handle_t *handle) |
| Deinitialize the TFA, put the TFA to powerdown state. More...
|
|
status_t | TFA9XXX_SetMute (tfa9xxx_handle_t *handle, bool isMute) |
| Mute/Unmute the TFA. More...
|
|
status_t | TFA9XXX_ConfigDataFormat (tfa9xxx_handle_t *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) |
| Configure the TFA based on I2S format. More...
|
|
status_t | TFA9XXX_SetVolume (tfa9xxx_handle_t *handle, uint32_t volume) |
| Set the volume level. More...
|
|
status_t | TFA9XXX_SetPlayChannel (tfa9xxx_handle_t *handle, uint32_t playChannel) |
| Set the audio channel for a speaker. More...
|
|
status_t | TFA9XXX_Start (tfa9xxx_handle_t *handle) |
| Start the TFA. More...
|
|
status_t | TFA9XXX_Stop (tfa9xxx_handle_t *handle) |
| Stop the TFA. More...
|
|
status_t | TFA9XXX_Reset (tfa9xxx_handle_t *handle) |
| Reset the TFA. More...
|
|
status_t | TFA9XXX_CheckCalibrationStatus (tfa9xxx_handle_t *handle, bool *isTFACalibrated) |
| check if TFA is calibrated. More...
|
|
status_t | TFA9XXX_CalibrateSpeakerBoost (tfa9xxx_handle_t *handle) |
| Start Speakerboost Calibration. More...
|
|
status_t | TFA9XXX_HardcodeCalibrationValue (tfa9xxx_handle_t *handle) |
| Hardcode calibration value for DSP usage instead of triggering calibration. More...
|
|
status_t | TFA9XXX_GetStatus (tfa9xxx_handle_t *handle) |
| Get the status of a running TFA. More...
|
|
status_t | TFA9XXX_ConvertErrorCode (int32_t rc) |
| Convert the return check value from TFA driver to predefined error code. More...
|
|
struct tfa9xxx_audio_format_t |
TFA9XXX only supports I2S format.
Enumerator |
---|
kTFA9XXX_BusI2S |
I2S type.
|
Enumerator |
---|
kTFA9XXX_AudioSampleRate48KHz |
Sample rate 48000 Hz.
|
Enumerator |
---|
kTFA9XXX_AudioBitWidth16bit |
audio bit width 16
|
Enumerator |
---|
kTFA9XXX_PlayChannelLeft0 |
codec play channel left 0
|
kTFA9XXX_PlayChannelRight0 |
codec play channel right 0
|
- Parameters
-
handle | TFA9XXX handle structure. |
tfa9xxxConfig | TFA9XXX configuration structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
- Parameters
-
handle | TFA9XXX handle structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | TFA9XXX handle structure. |
isMute | true is mute, false is unmute.. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
Assuming TFA_Init() is already called by calling CODEC_Init(), the TFA will be in operating state. So before calling TFA_SetFormat(), the TFA needs to be in powerdown state by calling TFA_Stop().
- Parameters
-
handle | TFA9XXX handle structure. |
mclk | The mclk. |
sampleRate | The sample rate. |
bitWidth | The bit width. |
- Returns
- Returns kStatus_Success if success, otherwise returns error code.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | TFA9XXX handle structure. |
volume | volume volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
By default, I2S channel is configured by the .tfaContainer
in tfa9xxx_config_t
. So you don't need to call this function. However, if required, calling this function allows overwriting I2S channel selection. This can be useful when the tuning is done, and you simply want to change the I2S channel.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | TFA9XXX handle structure. |
playChannel | _codec_play_channel play channel, available values are kCODEC_PlayChannelSpeakerLeft, kCODEC_PlayChannelSpeakerRight, kCODEC_PlayChannelSpeakerLeft | kCODEC_PlayChannelSpeakerRight. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
Start device will initialize if the device is in cold state if already warm then only clocks will be started.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA codec handle. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
Stop will put the TFA in powerdown/standby mode, the next time TFA start will be a warm start.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA9XXX handle structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
Reset will put the in powerdown/standby mode, the next time TFA start will be a cold start.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA9XXX handle structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA9XXX handle structure. |
isTFACalibrated | This value stores if TFA is calibrated. |
- Returns
- status_t Returns kStatus_Success if operation is successfully, otherwise returns error code..
The calibration will measure speaker impedance, and calculate the speaker impedance at 25 degree. This value will be used to estimate the real-time temperature.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA codec handle. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | TFA9XXX handle structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
This function has dependency on internal structure, it has to be called after TFA9XXX_CreatePlatform();
- Parameters
-
handle | The TFA9XXX handle structure. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.
status_t TFA9XXX_ConvertErrorCode |
( |
int32_t |
rc | ) |
|
- Parameters
-
rc | Return check value from TFA driver. |
- Returns
- status_t Returns kStatus_Success if success, otherwise returns error code.