audioamp8  2.0.0.0
Main Page

AudioAmp 8 click

<PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU>

[click Product page](<CLICK_PRODUCT_PAGE_LINK>)


Click library

  • Author : Nenad Filipovic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

We provide a library for the AudioAmp8 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for AudioAmp8 Click driver.

Standard key functions :

Example key functions :

Example Description

This library contains API for AudioAmp 8 Click driver. The library initializes and defines the I2C bus drivers to write and read data from registers.

The demo application is composed of two sections :

Application Init

The initialization of I2C module, log UART, and additional pins. After the driver init and then executes a default configuration, the app performs a BTL signal configuration, configure power mode and configure power mode profile.

void application_init ( void )
{
log_cfg_t log_cfg;
audioamp8_cfg_t audioamp8_cfg;
// Logger initialization.
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 115200;
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
audioamp8_cfg_setup( &audioamp8_cfg );
AUDIOAMP8_MAP_MIKROBUS( audioamp8_cfg, MIKROBUS_1 );
err_t init_flag = audioamp8_init( &audioamp8, &audioamp8_cfg );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
audioamp8_default_cfg ( &audioamp8 );
log_info( &logger, " Application Task " );
audioamp8_btl_config( &audioamp8 );
Delay_ms( 100 );
pwr_mode.manual_pm = AUDIOAMP8_SET_MANUAL_PWR_MODE;
pwr_mode.pm_man = AUDIOAMP8_PM_MAN_3;
pwr_mode.mthr_1to2 = AUDIOAMP8_SET_MTHR_1TO2_DEFAULT;
pwr_mode.mthr_2to1 = AUDIOAMP8_SET_MTHR_2TO1_DEFAULT;
pwr_mode.mthr_2to3 = AUDIOAMP8_SET_MTHR_2TO3_DEFAULT;
pwr_mode.mthr_3to2 = AUDIOAMP8_SET_MTHR_3TO2_DEFAULT;
audioamp8_set_config_power_mode( &audioamp8, pwr_mode );
Delay_ms( 100 );
pm_profile.pm_profile = AUDIOAMP8_PM_PROFILE_3;
pm_profile.pm3_man_sh = AUDIOAMP8_SCHEME_C;
audioamp8_set_config_power_mode_profile( &audioamp8, pm_profile );
Delay_ms( 100 );
log_printf( &logger, "-------------------------\r\n" );
Delay_ms( 1000 );
}

Application Task

This is an example that shows the use of a AudioAmp 8 Click boardâ„¢. Display status monitoring for the channel 0 or channel 1. This task repeats every 2 seconds.

void application_task ( void )
{
channel_status_monitoring( );
Delay_ms( 1000 );
}

Additional Function

  • channel_status_monitoring The function displays the status monitoring channel.
    static void channel_status_monitoring ( void );

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.AudioAmp8

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. UART terminal is available in all MikroElektronika compilers.


AUDIOAMP8_MAP_MIKROBUS
#define AUDIOAMP8_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: audioamp8.h:137
AUDIOAMP8_PM_MAN_3
@ AUDIOAMP8_PM_MAN_3
Definition: audioamp8.h:269
audioamp8_monitor_channel_t
AudioAmp 8 Click monitor channel object.
Definition: audioamp8.h:220
audioamp8_channel_monitoring
err_t audioamp8_channel_monitoring(audioamp8_t *ctx, uint8_t mon_ch, audioamp8_monitor_channel_t *ch_mon)
AudioAmp 8 monitors the status of the channel's function.
audioamp8_cfg_t
AudioAmp 8 Click configuration object.
Definition: audioamp8.h:173
application_task
void application_task(void)
Definition: main.c:161
AUDIOAMP8_SET_DISABLE
#define AUDIOAMP8_SET_DISABLE
Definition: audioamp8.h:107
AUDIOAMP8_PM_PROFILE_3
@ AUDIOAMP8_PM_PROFILE_3
Definition: audioamp8.h:282
audioamp8_set_config_power_mode_profile
err_t audioamp8_set_config_power_mode_profile(audioamp8_t *ctx, audioamp8_pwr_mod_profile_cfg_t pm_profile)
AudioAmp 8 set power mode profile configuration function.
AUDIOAMP8_SET_MTHR_1TO2_DEFAULT
#define AUDIOAMP8_SET_MTHR_1TO2_DEFAULT
Definition: audioamp8.h:103
AUDIOAMP8_SET_MTHR_2TO3_DEFAULT
#define AUDIOAMP8_SET_MTHR_2TO3_DEFAULT
Definition: audioamp8.h:105
AUDIOAMP8_SET_MTHR_3TO2_DEFAULT
#define AUDIOAMP8_SET_MTHR_3TO2_DEFAULT
Definition: audioamp8.h:106
audioamp8_pwr_mod_profile_cfg_t
AudioAmp 8 Click power mode profile configuration object.
Definition: audioamp8.h:207
audioamp8_set_config_power_mode
err_t audioamp8_set_config_power_mode(audioamp8_t *ctx, audioamp8_pwr_mon_cfg_t pwr_mode)
AudioAmp 8 set power mode configuration function.
AUDIOAMP8_SCHEME_C
@ AUDIOAMP8_SCHEME_C
Definition: audioamp8.h:295
audioamp8_btl_config
err_t audioamp8_btl_config(audioamp8_t *ctx)
AudioAmp 8 BTL configuration function.
audioamp8_t
AudioAmp 8 Click context object.
Definition: audioamp8.h:153
application_init
void application_init(void)
Definition: main.c:112
AUDIOAMP8_SET_MANUAL_PWR_MODE
#define AUDIOAMP8_SET_MANUAL_PWR_MODE
Definition: audioamp8.h:102
AUDIOAMP8_SET_MON_CH_0
#define AUDIOAMP8_SET_MON_CH_0
AudioAmp 8 description setting.
Definition: audioamp8.h:99
audioamp8_set_mute
err_t audioamp8_set_mute(audioamp8_t *ctx, uint8_t en_mute)
AudioAmp 8 mute function.
audioamp8_cfg_setup
void audioamp8_cfg_setup(audioamp8_cfg_t *cfg)
AudioAmp 8 configuration object setup function.
audioamp8_pwr_mon_cfg_t
AudioAmp 8 Click power mode configuration object.
Definition: audioamp8.h:192
audioamp8_init
err_t audioamp8_init(audioamp8_t *ctx, audioamp8_cfg_t *cfg)
AudioAmp 8 initialization function.
audioamp8_default_cfg
err_t audioamp8_default_cfg(audioamp8_t *ctx)
AudioAmp 8 default configuration function.
AUDIOAMP8_SET_MTHR_2TO1_DEFAULT
#define AUDIOAMP8_SET_MTHR_2TO1_DEFAULT
Definition: audioamp8.h:104