Functions
WM8994_Private_Functions
Collaboration diagram for WM8994_Private_Functions:

Functions

static uint8_t CODEC_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
 Writes/Read a single data. More...
 
void wm8994_DeInit (void)
 Deinitializes the audio codec. More...
 
uint32_t wm8994_Init (uint16_t DeviceAddr, uint16_t OutputInputDevice, uint8_t Volume, uint32_t AudioFreq)
 Initializes the audio codec and the control interface. More...
 
uint32_t wm8994_Pause (uint16_t DeviceAddr)
 Pauses playing on the audio codec. More...
 
uint32_t wm8994_Play (uint16_t DeviceAddr, uint16_t *pBuffer, uint16_t Size)
 Start the audio Codec play feature. More...
 
uint32_t wm8994_ReadID (uint16_t DeviceAddr)
 Get the WM8994 ID. More...
 
uint32_t wm8994_Reset (uint16_t DeviceAddr)
 Resets wm8994 registers. More...
 
uint32_t wm8994_Resume (uint16_t DeviceAddr)
 Resumes playing on the audio codec. More...
 
uint32_t wm8994_SetFrequency (uint16_t DeviceAddr, uint32_t AudioFreq)
 Sets new frequency. More...
 
uint32_t wm8994_SetMute (uint16_t DeviceAddr, uint32_t Cmd)
 Enables or disables the mute feature on the audio codec. More...
 
uint32_t wm8994_SetOutputMode (uint16_t DeviceAddr, uint8_t Output)
 Switch dynamically (while audio file is played) the output target (speaker or headphone). More...
 
uint32_t wm8994_SetVolume (uint16_t DeviceAddr, uint8_t Volume)
 Sets higher or lower the codec volume level. More...
 
uint32_t wm8994_Stop (uint16_t DeviceAddr, uint32_t CodecPdwnMode)
 Stops audio Codec playing. It powers down the codec. More...
 

Detailed Description

Function Documentation

◆ CODEC_IO_Write()

static uint8_t CODEC_IO_Write ( uint8_t  Addr,
uint16_t  Reg,
uint16_t  Value 
)
static

Writes/Read a single data.

Parameters
AddrI2C address
RegReg address
ValueData to be written
Return values
None

Definition at line 1045 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_DeInit()

void wm8994_DeInit ( void  )

Deinitializes the audio codec.

Parameters
None
Return values
None

Definition at line 638 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Init()

uint32_t wm8994_Init ( uint16_t  DeviceAddr,
uint16_t  OutputInputDevice,
uint8_t  Volume,
uint32_t  AudioFreq 
)

Initializes the audio codec and the control interface.

Parameters
DeviceAddrDevice address on communication Bus.
OutputInputDevicecan be OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH, OUTPUT_DEVICE_AUTO, INPUT_DEVICE_DIGITAL_MICROPHONE_1, INPUT_DEVICE_DIGITAL_MICROPHONE_2, INPUT_DEVICE_DIGITAL_MIC1_MIC2, INPUT_DEVICE_INPUT_LINE_1 or INPUT_DEVICE_INPUT_LINE_2.
VolumeInitial volume level (from 0 (Mute) to 100 (Max))
AudioFreqAudio Frequency
Return values
0if correct communication, else wrong communication

Definition at line 137 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Pause()

uint32_t wm8994_Pause ( uint16_t  DeviceAddr)

Pauses playing on the audio codec.

Parameters
DeviceAddrDevice address on communication Bus.
Return values
0if correct communication, else wrong communication

Definition at line 679 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Play()

uint32_t wm8994_Play ( uint16_t  DeviceAddr,
uint16_t *  pBuffer,
uint16_t  Size 
)

Start the audio Codec play feature.

Note
For this codec no Play options are required.
Parameters
DeviceAddrDevice address on communication Bus.
Return values
0if correct communication, else wrong communication

Definition at line 663 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_ReadID()

uint32_t wm8994_ReadID ( uint16_t  DeviceAddr)

Get the WM8994 ID.

Parameters
DeviceAddrDevice address on communication Bus.
Return values
TheWM8994 ID

Definition at line 649 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Reset()

uint32_t wm8994_Reset ( uint16_t  DeviceAddr)

Resets wm8994 registers.

Parameters
DeviceAddrDevice address on communication Bus.
Return values
0if correct communication, else wrong communication

Definition at line 1026 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Resume()

uint32_t wm8994_Resume ( uint16_t  DeviceAddr)

Resumes playing on the audio codec.

Parameters
DeviceAddrDevice address on communication Bus.
Return values
0if correct communication, else wrong communication

Definition at line 698 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_SetFrequency()

uint32_t wm8994_SetFrequency ( uint16_t  DeviceAddr,
uint32_t  AudioFreq 
)

Sets new frequency.

Parameters
DeviceAddrDevice address on communication Bus.
AudioFreqAudio frequency used to play the audio stream.
Return values
0if correct communication, else wrong communication

Definition at line 966 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_SetMute()

uint32_t wm8994_SetMute ( uint16_t  DeviceAddr,
uint32_t  Cmd 
)

Enables or disables the mute feature on the audio codec.

Parameters
DeviceAddrDevice address on communication Bus.
CmdAUDIO_MUTE_ON to enable the mute or AUDIO_MUTE_OFF to disable the mute mode.
Return values
0if correct communication, else wrong communication

Definition at line 844 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_SetOutputMode()

uint32_t wm8994_SetOutputMode ( uint16_t  DeviceAddr,
uint8_t  Output 
)

Switch dynamically (while audio file is played) the output target (speaker or headphone).

Parameters
DeviceAddrDevice address on communication Bus.
Outputspecifies the audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO
Return values
0if correct communication, else wrong communication

Definition at line 879 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_SetVolume()

uint32_t wm8994_SetVolume ( uint16_t  DeviceAddr,
uint8_t  Volume 
)

Sets higher or lower the codec volume level.

Parameters
DeviceAddrDevice address on communication Bus.
Volumea byte value from 0 to 255 (refer to codec registers description for more details).
Return values
0if correct communication, else wrong communication

Definition at line 768 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.

◆ wm8994_Stop()

uint32_t wm8994_Stop ( uint16_t  DeviceAddr,
uint32_t  CodecPdwnMode 
)

Stops audio Codec playing. It powers down the codec.

Parameters
DeviceAddrDevice address on communication Bus.
CodecPdwnModeselects the power down mode.
  • CODEC_PDWN_SW: only mutes the audio codec. When resuming from this mode the codec keeps the previous initialization (no need to re-Initialize the codec registers).
  • CODEC_PDWN_HW: Physically power down the codec. When resuming from this mode, the codec is set to default configuration (user should re-Initialize the codec in order to play again the audio stream).
Return values
0if correct communication, else wrong communication

Definition at line 722 of file stm32f769/stm32f769i-disco/Drivers/BSP/Components/wm8994/wm8994.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:08