|  | MCUXpresso SDK API Reference Manual
    Rev 2.16.000
    NXP Semiconductors | 
The wm8904 adapter provides a codec unify control interface.
| Macros | |
| #define | HAL_CODEC_WM8904_HANDLER_SIZE (WM8904_I2C_HANDLER_SIZE + 4) | 
| codec handler size | |
| Functions | |
| status_t | HAL_CODEC_WM8904_Init (void *handle, void *config) | 
| Codec initilization.  More... | |
| status_t | HAL_CODEC_WM8904_Deinit (void *handle) | 
| Codec de-initilization.  More... | |
| status_t | HAL_CODEC_WM8904_SetFormat (void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | 
| set audio data format.  More... | |
| status_t | HAL_CODEC_WM8904_SetVolume (void *handle, uint32_t playChannel, uint32_t volume) | 
| set audio codec module volume.  More... | |
| status_t | HAL_CODEC_WM8904_SetMute (void *handle, uint32_t playChannel, bool isMute) | 
| set audio codec module mute.  More... | |
| status_t | HAL_CODEC_WM8904_SetPower (void *handle, uint32_t module, bool powerOn) | 
| set audio codec module power.  More... | |
| status_t | HAL_CODEC_WM8904_SetRecord (void *handle, uint32_t recordSource) | 
| codec set record source.  More... | |
| status_t | HAL_CODEC_WM8904_SetRecordChannel (void *handle, uint32_t leftRecordChannel, uint32_t rightRecordChannel) | 
| codec set record channel.  More... | |
| status_t | HAL_CODEC_WM8904_SetPlay (void *handle, uint32_t playSource) | 
| codec set play source.  More... | |
| status_t | HAL_CODEC_WM8904_ModuleControl (void *handle, uint32_t cmd, uint32_t data) | 
| codec module control.  More... | |
| static status_t | HAL_CODEC_Init (void *handle, void *config) | 
| Codec initilization.  More... | |
| static status_t | HAL_CODEC_Deinit (void *handle) | 
| Codec de-initilization.  More... | |
| static status_t | HAL_CODEC_SetFormat (void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | 
| set audio data format.  More... | |
| static status_t | HAL_CODEC_SetVolume (void *handle, uint32_t playChannel, uint32_t volume) | 
| set audio codec module volume.  More... | |
| static status_t | HAL_CODEC_SetMute (void *handle, uint32_t playChannel, bool isMute) | 
| set audio codec module mute.  More... | |
| static status_t | HAL_CODEC_SetPower (void *handle, uint32_t module, bool powerOn) | 
| set audio codec module power.  More... | |
| static status_t | HAL_CODEC_SetRecord (void *handle, uint32_t recordSource) | 
| codec set record source.  More... | |
| static status_t | HAL_CODEC_SetRecordChannel (void *handle, uint32_t leftRecordChannel, uint32_t rightRecordChannel) | 
| codec set record channel.  More... | |
| static status_t | HAL_CODEC_SetPlay (void *handle, uint32_t playSource) | 
| codec set play source.  More... | |
| static status_t | HAL_CODEC_ModuleControl (void *handle, uint32_t cmd, uint32_t data) | 
| codec module control.  More... | |
| status_t HAL_CODEC_WM8904_Init | ( | void * | handle, | 
| void * | config | ||
| ) | 
| handle | codec handle. | 
| config | codec configuration. | 
| status_t HAL_CODEC_WM8904_Deinit | ( | void * | handle | ) | 
| handle | codec handle. | 
| status_t HAL_CODEC_WM8904_SetFormat | ( | void * | handle, | 
| uint32_t | mclk, | ||
| uint32_t | sampleRate, | ||
| uint32_t | bitWidth | ||
| ) | 
| handle | codec handle. | 
| mclk | master clock frequency in HZ. | 
| sampleRate | sample rate in HZ. | 
| bitWidth | bit width. | 
| status_t HAL_CODEC_WM8904_SetVolume | ( | void * | handle, | 
| uint32_t | playChannel, | ||
| uint32_t | volume | ||
| ) | 
| handle | codec handle. | 
| playChannel | audio codec play channel, can be a value or combine value of _codec_play_channel. | 
| volume | volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. | 
| status_t HAL_CODEC_WM8904_SetMute | ( | void * | handle, | 
| uint32_t | playChannel, | ||
| bool | isMute | ||
| ) | 
| handle | codec handle. | 
| playChannel | audio codec play channel, can be a value or combine value of _codec_play_channel. | 
| isMute | true is mute, false is unmute. | 
| status_t HAL_CODEC_WM8904_SetPower | ( | void * | handle, | 
| uint32_t | module, | ||
| bool | powerOn | ||
| ) | 
| handle | codec handle. | 
| module | audio codec module. | 
| powerOn | true is power on, false is power down. | 
| status_t HAL_CODEC_WM8904_SetRecord | ( | void * | handle, | 
| uint32_t | recordSource | ||
| ) | 
| handle | codec handle. | 
| recordSource | audio codec record source, can be a value or combine value of _codec_record_source. | 
| status_t HAL_CODEC_WM8904_SetRecordChannel | ( | void * | handle, | 
| uint32_t | leftRecordChannel, | ||
| uint32_t | rightRecordChannel | ||
| ) | 
| handle | codec handle. | 
| leftRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value or combine value of member in _codec_record_channel. | 
| rightRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel. | 
| status_t HAL_CODEC_WM8904_SetPlay | ( | void * | handle, | 
| uint32_t | playSource | ||
| ) | 
| handle | codec handle. | 
| playSource | audio codec play source, can be a value or combine value of _codec_play_source. | 
| status_t HAL_CODEC_WM8904_ModuleControl | ( | void * | handle, | 
| uint32_t | cmd, | ||
| uint32_t | data | ||
| ) | 
This function is used for codec module control, support switch digital interface cmd, can be expand to support codec module specific feature
| handle | codec handle. | 
| cmd | module control cmd, reference _codec_module_ctrl_cmd. | 
| data | value to write, when cmd is kCODEC_ModuleRecordSourceChannel, the data should be a value combine of channel and source, please reference macro CODEC_MODULE_RECORD_SOURCE_CHANNEL(source, LP, LN, RP, RN), reference codec specific driver for detail configurations. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| config | codec configuration. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| mclk | master clock frequency in HZ. | 
| sampleRate | sample rate in HZ. | 
| bitWidth | bit width. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| playChannel | audio codec play channel, can be a value or combine value of _codec_play_channel. | 
| volume | volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| playChannel | audio codec play channel, can be a value or combine value of _codec_play_channel. | 
| isMute | true is mute, false is unmute. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| module | audio codec module. | 
| powerOn | true is power on, false is power down. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| recordSource | audio codec record source, can be a value or combine value of _codec_record_source. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| leftRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value or combine value of member in _codec_record_channel. | 
| rightRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel. | 
| 
 | inlinestatic | 
| handle | codec handle. | 
| playSource | audio codec play source, can be a value or combine value of _codec_play_source. | 
| 
 | inlinestatic | 
This function is used for codec module control, support switch digital interface cmd, can be expand to support codec module specific feature
| handle | codec handle. | 
| cmd | module control cmd, reference _codec_module_ctrl_cmd. | 
| data | value to write, when cmd is kCODEC_ModuleRecordSourceChannel, the data should be a value combine of channel and source, please reference macro CODEC_MODULE_RECORD_SOURCE_CHANNEL(source, LP, LN, RP, RN), reference codec specific driver for detail configurations. |