Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 1.82 KB

README.md

File metadata and controls

81 lines (62 loc) · 1.82 KB

Welcome to TAS5720 Arduino Library 👋

License: MIT License

Arduino library to configure TI TAS5720(A) Class D amplifier

What is implemented ?

  • I2C communication
  • Configuration of the amplifier
  • Volume control
  • Mute control
  • Power control
  • Errors states

Install

Use the source files

Install it with platform io : https://registry.platformio.org/libraries/axoulc/TAS5720%20Arduino

pio pkg install --library "axoulc/TAS5720 Arduino@^1.1"

or with the platformio.ini file :

[env:myenv]
;...

lib_deps = axoulc/TAS5720 Arduino@^1.1

Usage

#include <TAS5720.h>

TAS5720 amp(Wire, 0x6D, true);
uint8_t left = 0, right = 0;

void setup() {
    pinMode(SPEAKER_SD, OUTPUT);  // /SPK_SD Pin
    digitalWrite(SPEAKER_SD, LOW);
    // Start I2S

    amp.mute(true);
    amp.setSerialAudioInterfaceFormat(SAI_I2S);
    amp.setChannelSelection(RIGHT);
    amp.setAnalogGain(GAIN_25_DBV);
    amp.setDigitalBoost(DIGITAL_BOOST_6DB);
    amp.setVolume(200);
    // Do Anything you want here
    digitalWrite(SPEAKER_SD, HIGH);
    amp.mute(false);
    // Play some music
}

void loop() {
    amp.getVolume();
    left = amp.volumeLeft;
    right = amp.volumeRight;
    amp.setVolume(++left, ++right);
    delay(1000);
}

Author

👤 Axel Chabot

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Axel Chabot.
This project is MIT licensed.