We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-04-16
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Amplifier
Downloaded: 3587 times
Not followed.
License: MIT license
Audio Amp 6 click is a mono/subwoofer audio amplifier, capable of delivering up to 18.5W per channel with the 4Ω load. It is based on the TPA3138D2, a class-D integrated amplifier, which utilizes a highly efficient switching scheme.
Do you want to subscribe in order to receive notifications regarding "AudioAmp 6 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "AudioAmp 6 click" changes.
Do you want to report abuse regarding "AudioAmp 6 click".
Library Description
Library contains all the necessary functions for control to the AudioAmp 6 click.
Key functions:
void audioamp6_setMode(uint8_t mode)
- Sets MODE BD or 1SPW.void audioamp6_setOutput(uint8_t out)
- Enable or Disable output.void audioamp6_setGain(uint8_t gain)
- Sets Gain 20dB or 26dB.Examples description
The application is composed of the three sections :
Note: Sets the input voltage from 3.5V to 14.4V. Use the UART to control the amplification or reduction of sound.
Commands : 'e' - Enable/disable output 'g' - Changes the gain settings (20dB - 26dB)
void applicationTask()
{
uint8_t dataReady_;
char receivedData_;
dataReady_ = UART_Rdy_Ptr();
if (dataReady_ != 0)
{
receivedData_ = UART_Rd_Ptr();
switch (receivedData_)
{
case 'e' :
{
/* Device enable or disable */
if(fEnable == _AUDIOAMP6_OUTPUT_ENABLE)
{
audioamp6_setOutput(_AUDIOAMP6_OUTPUT_DISABLE);
mikrobus_logWrite("---- OUTPUT DISABLED ----", _LOG_LINE);
fEnable = _AUDIOAMP6_OUTPUT_DISABLE;
}
else
{
audioamp6_setOutput(_AUDIOAMP6_OUTPUT_ENABLE);
mikrobus_logWrite("---- OUTPUT ENABLED ----", _LOG_LINE);
fEnable = _AUDIOAMP6_OUTPUT_ENABLE;
}
break;
}
case 'g' :
{
/* Gain 20dB or 26dB*/
if(fGain == _AUDIOAMP6_GAIN_26dB)
{
audioamp6_setGain(_AUDIOAMP6_GAIN_20dB);
mikrobus_logWrite("---- Gain [20 dB] ----", _LOG_LINE);
fGain = _AUDIOAMP6_GAIN_20dB;
}
else
{
audioamp6_setGain(_AUDIOAMP6_GAIN_26dB);
mikrobus_logWrite("---- Gain [26 dB] ----", _LOG_LINE);
fGain = _AUDIOAMP6_GAIN_26dB;
}
break;
}
}
}
}
Other mikroE Libraries used in the example:
GPIO
UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.