Functions | Variables
CS43L22_Exported_Functions
Collaboration diagram for CS43L22_Exported_Functions:

Functions

void AUDIO_IO_DeInit (void)
 DeInitializes Audio low level. More...
 
void AUDIO_IO_Init (void)
 Initializes Audio low level. More...
 
void cs43l22_DeInit (void)
 Deinitializes the audio codec. More...
 
uint32_t cs43l22_Init (uint16_t DeviceAddr, uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
 Initializes the audio codec and the control interface. More...
 
uint32_t cs43l22_Pause (uint16_t DeviceAddr)
 Pauses playing on the audio codec. More...
 
uint32_t cs43l22_Play (uint16_t DeviceAddr, uint16_t *pBuffer, uint16_t Size)
 Start the audio Codec play feature. More...
 
uint32_t cs43l22_ReadID (uint16_t DeviceAddr)
 Get the CS43L22 ID. More...
 
uint32_t cs43l22_Reset (uint16_t DeviceAddr)
 Resets cs43l22 registers. More...
 
uint32_t cs43l22_Resume (uint16_t DeviceAddr)
 Resumes playing on the audio codec. More...
 
uint32_t cs43l22_SetFrequency (uint16_t DeviceAddr, uint32_t AudioFreq)
 Sets new frequency. More...
 
uint32_t cs43l22_SetMute (uint16_t DeviceAddr, uint32_t Cmd)
 Enables or disables the mute feature on the audio codec. More...
 
uint32_t cs43l22_SetOutputMode (uint16_t DeviceAddr, uint8_t Output)
 Switch dynamically (while audio file is played) the output target (speaker or headphone). More...
 
uint32_t cs43l22_SetVolume (uint16_t DeviceAddr, uint8_t Volume)
 Sets higher or lower the codec volume level. More...
 
uint32_t cs43l22_Stop (uint16_t DeviceAddr, uint32_t Cmd)
 Stops audio Codec playing. It powers down the codec. More...
 

Variables

AUDIO_DrvTypeDef cs43l22_drv
 
AUDIO_DrvTypeDef cs43l22_drv
 
AUDIO_DrvTypeDef cs43l22_drv
 

Detailed Description

Function Documentation

◆ AUDIO_IO_DeInit()

void AUDIO_IO_DeInit ( void  )

DeInitializes Audio low level.

Definition at line 658 of file stm32f4_discovery.c.

◆ AUDIO_IO_Init()

void AUDIO_IO_Init ( void  )

Initializes Audio low level.

Definition at line 626 of file stm32f4_discovery.c.

◆ cs43l22_DeInit()

void cs43l22_DeInit ( void  )

Deinitializes the audio codec.

Parameters
None
Return values
None

Definition at line 217 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Init()

uint32_t cs43l22_Init ( uint16_t  DeviceAddr,
uint16_t  OutputDevice,
uint8_t  Volume,
uint32_t  AudioFreq 
)

Initializes the audio codec and the control interface.

Parameters
DeviceAddrDevice address on communication Bus.
OutputDevicecan be OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO .
VolumeInitial volume level (from 0 (Mute) to 100 (Max))
Return values
0if correct communication, else wrong communication

Definition at line 133 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Pause()

uint32_t cs43l22_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 272 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Play()

uint32_t cs43l22_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 246 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_ReadID()

uint32_t cs43l22_ReadID ( uint16_t  DeviceAddr)

Get the CS43L22 ID.

Parameters
DeviceAddrDevice address on communication Bus.
Return values
TheCS43L22 ID

Definition at line 228 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Reset()

uint32_t cs43l22_Reset ( uint16_t  DeviceAddr)

Resets cs43l22 registers.

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

Definition at line 451 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Resume()

uint32_t cs43l22_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 291 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_SetFrequency()

uint32_t cs43l22_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 371 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_SetMute()

uint32_t cs43l22_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 383 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_SetOutputMode()

uint32_t cs43l22_SetOutputMode ( uint16_t  DeviceAddr,
uint8_t  Output 
)

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

Note
This function modifies a global variable of the audio codec driver: OutputDev.
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 412 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_SetVolume()

uint32_t cs43l22_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 344 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

◆ cs43l22_Stop()

uint32_t cs43l22_Stop ( uint16_t  DeviceAddr,
uint32_t  Cmd 
)

Stops audio Codec playing. It powers down the codec.

Parameters
DeviceAddrDevice address on communication Bus.
CodecPdwnModeselects the power down mode.
  • 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 319 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.

Variable Documentation

◆ cs43l22_drv [1/3]

AUDIO_DrvTypeDef cs43l22_drv

◆ cs43l22_drv [2/3]

AUDIO_DrvTypeDef cs43l22_drv

◆ cs43l22_drv [3/3]

AUDIO_DrvTypeDef cs43l22_drv


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