STM32 LL(Low-Layer) C library. TDA7439 is a three-band digitally-controlled audio processor.
See datasheet: link
- Full feature support(volume, bass, treble etc)
- Easy to use
- No HAL dependencies
How to add CPM to the project, check the link
CPMAddPackage(
NAME TDA7439
GITHUB_REPOSITORY ximtech/TDA7439
GIT_TAG origin/main)
- Start project with STM32CubeMX:
- Select: Project Manager -> Advanced Settings -> I2C -> LL
- Generate Code
- Add sources to project:
add_subdirectory(${STM32_CORE_SOURCE_DIR}/I2C/Polling) # add I2C to project
include_directories(${TDA7439_DIRECTORY}) # source directories
file(GLOB_RECURSE SOURCES ${TDA7439_SOURCES}) # source files
- Then Build -> Clean -> Rebuild Project
NOTE: For correct IC work need use level converter
#include "TDA7439.h"
int main() {
I2CStatus processorStatus = initTDA7439(I2C1);
if (processorStatus != I2C_OK) {
Error_Handler();
}
setStereoInputTDA7439(TDA7439_INPUT_1); // switch to sound source input
setInputGainTDA7439(TDA7439_GAIN_14dB);
setVolumeTDA7439(TDA7439_VOLUME_MINUS_6dB);
setRightSpeakerAttenuationTDA7439(TDA7439_ATTENUATION_0dB); // set default attenuation, otherwise speakers will be muted
setLeftSpeakerAttenuationTDA7439(TDA7439_ATTENUATION_0dB);
}