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-10-14
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Amplifier
Downloaded: 3797 times
Not followed.
License: MIT license
Audio Amp 5 Click is a stereo audio amplifier, capable of delivering up to 10W per channel with the 8Ω 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 "Audio Amp 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Audio Amp 5 click" changes.
Do you want to report abuse regarding "Audio Amp 5 click".
Library Description
The library performs the audio control of the Audio Amp 5 Click board. This library consists of the special commands for audio output control, for example to mute/turn on the outputs, to select the desired output gain or mode. For more details check documentation.
Key functions:
void audioamp5_enable( uint8_t state )
- Function performs a shutdown or power up action, and on that way selects outputs to be muted or activated.void audioamp5_modeSelect( uint8_t state )
- Function puts a device to the desired mode.void audioamp5_gainSelect( uint8_t state )
- Function performs a desired gain selection.Examples description
The application is composed of the three sections :
void applicationTask()
{
rxDat = UART_Rdy_Ptr();
if (rxDat != UART_RX_NOT_READY)
{
rxDat = UART_Rd_Ptr();
switch (rxDat)
{
case 'm' :
{
audioamp5_enable( _AUDIOAMP5_SHDWN_MUTE_OUTPUTS );
mikrobus_logWrite( "** Outputs are muted **", _LOG_LINE );
break;
}
case 'e' :
{
audioamp5_enable( _AUDIOAMP5_PWRUP_UNMUTE_OUTPUTS );
mikrobus_logWrite( "** Outputs are enabled **", _LOG_LINE );
break;
}
case '0' :
{
audioamp5_modeSelect( _AUDIOAMP5_BD_MODE );
audioamp5_configUpdate();
mikrobus_logWrite( "** BD Mode is selected **", _LOG_LINE );
break;
}
case '1' :
{
audioamp5_modeSelect( _AUDIOAMP5_1SPW_MODE );
audioamp5_configUpdate();
mikrobus_logWrite( "** Low-Idle-Current 1SPW Mode is selected **", _LOG_LINE );
break;
}
case '-' :
{
audioamp5_gainSelect( _AUDIOAMP5_GAIN_20DB );
audioamp5_configUpdate();
mikrobus_logWrite( "** Gain value is 20dB **", _LOG_LINE );
break;
}
case '+' :
{
audioamp5_gainSelect( _AUDIOAMP5_GAIN_26DB );
audioamp5_configUpdate();
mikrobus_logWrite( "** Gain value is 26dB **", _LOG_LINE );
break;
}
default :
{
writeLegend();
break;
}
}
}
}
Additional Functions :
All additional functions such as timer initialization and default handler.
Other mikroE Libraries used in the example:
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.