Functions | |
static uint8_t | CODEC_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value) |
Writes/Read a single data. 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 CodecPdwnMode) |
Stops audio Codec playing. It powers down the codec. More... | |
|
static |
Writes/Read a single data.
Addr | I2C address |
Reg | Reg address |
Value | Data to be written |
None |
Definition at line 463 of file stm32f411/stm32f411e-disco/Drivers/BSP/Components/cs43l22/cs43l22.c.
void cs43l22_DeInit | ( | void | ) |
Deinitializes the audio codec.
None |
None |
Definition at line 217 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Init | ( | uint16_t | DeviceAddr, |
uint16_t | OutputDevice, | ||
uint8_t | Volume, | ||
uint32_t | AudioFreq | ||
) |
Initializes the audio codec and the control interface.
DeviceAddr | Device address on communication Bus. |
OutputDevice | can be OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO . |
Volume | Initial volume level (from 0 (Mute) to 100 (Max)) |
0 | if correct communication, else wrong communication |
Definition at line 133 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Pause | ( | uint16_t | DeviceAddr | ) |
Pauses playing on the audio codec.
DeviceAddr | Device address on communication Bus. |
0 | if correct communication, else wrong communication |
Definition at line 272 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Play | ( | uint16_t | DeviceAddr, |
uint16_t * | pBuffer, | ||
uint16_t | Size | ||
) |
Start the audio Codec play feature.
DeviceAddr | Device address on communication Bus. |
0 | if correct communication, else wrong communication |
Definition at line 246 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_ReadID | ( | uint16_t | DeviceAddr | ) |
Get the CS43L22 ID.
DeviceAddr | Device address on communication Bus. |
The | CS43L22 ID |
Definition at line 228 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Reset | ( | uint16_t | DeviceAddr | ) |
Resets cs43l22 registers.
DeviceAddr | Device address on communication Bus. |
0 | if correct communication, else wrong communication |
Definition at line 451 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Resume | ( | uint16_t | DeviceAddr | ) |
Resumes playing on the audio codec.
DeviceAddr | Device address on communication Bus. |
0 | if correct communication, else wrong communication |
Definition at line 291 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_SetFrequency | ( | uint16_t | DeviceAddr, |
uint32_t | AudioFreq | ||
) |
Sets new frequency.
DeviceAddr | Device address on communication Bus. |
AudioFreq | Audio frequency used to play the audio stream. |
0 | if correct communication, else wrong communication |
Definition at line 371 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_SetMute | ( | uint16_t | DeviceAddr, |
uint32_t | Cmd | ||
) |
Enables or disables the mute feature on the audio codec.
DeviceAddr | Device address on communication Bus. |
Cmd | AUDIO_MUTE_ON to enable the mute or AUDIO_MUTE_OFF to disable the mute mode. |
0 | if correct communication, else wrong communication |
Definition at line 383 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_SetOutputMode | ( | uint16_t | DeviceAddr, |
uint8_t | Output | ||
) |
Switch dynamically (while audio file is played) the output target (speaker or headphone).
DeviceAddr | Device address on communication Bus. |
Output | specifies the audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO |
0 | if correct communication, else wrong communication |
Definition at line 412 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_SetVolume | ( | uint16_t | DeviceAddr, |
uint8_t | Volume | ||
) |
Sets higher or lower the codec volume level.
DeviceAddr | Device address on communication Bus. |
Volume | a byte value from 0 to 255 (refer to codec registers description for more details). |
0 | if correct communication, else wrong communication |
Definition at line 344 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.
uint32_t cs43l22_Stop | ( | uint16_t | DeviceAddr, |
uint32_t | CodecPdwnMode | ||
) |
Stops audio Codec playing. It powers down the codec.
DeviceAddr | Device address on communication Bus. |
CodecPdwnMode | selects the power down mode.
|
0 | if correct communication, else wrong communication |
Definition at line 319 of file stm32f407/stm32f407g-disc1/Drivers/BSP/Components/cs43l22/cs43l22.c.