audioamp3 2.0.0.0

Functions

void audioamp3_cfg_setup (audioamp3_cfg_t *cfg)
 Config Object Initialization function.
 
AUDIOAMP3_RETVAL audioamp3_init (audioamp3_t *ctx, audioamp3_cfg_t *cfg)
 Initialization function.
 
void audioamp3_generic_write (audioamp3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void audioamp3_generic_read (audioamp3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void audioamp3_power_up (audioamp3_t *ctx)
 Power Up function.
 
void audioamp3_hw_reset (audioamp3_t *ctx)
 Hardware reset function.
 
void audioamp3_read_all_diagnostics (audioamp3_t *ctx, uint8_t *p_all_diagnostics)
 Read all diagnostics function.
 
AUDIOAMP3_STATUS_T audioamp3_set_channel_low_to_low (audioamp3_t *ctx, uint8_t s_channel)
 Set the channel to low-low state function.
 
AUDIOAMP3_STATUS_T audioamp3_set_channel_mute_mode (audioamp3_t *ctx, uint8_t s_channel)
 Set the mute mode of channel function.
 
AUDIOAMP3_STATUS_T audioamp3_run_channel_diagnostics (audioamp3_t *ctx, uint8_t rc_channel)
 Run channel diagnostics function.
 
AUDIOAMP3_STATUS_T audioamp3_set_play_mode (audioamp3_t *ctx)
 Set the play mode for all channels function.
 
AUDIOAMP3_STATUS_T audioamp3_set_gain_lvl (audioamp3_t *ctx, uint8_t gain_lvl)
 Set the gain lvl function.
 

Detailed Description

Function Documentation

◆ audioamp3_cfg_setup()

void audioamp3_cfg_setup ( audioamp3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ audioamp3_generic_read()

void audioamp3_generic_read ( audioamp3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read.

@description This function reads data from the desired register.

◆ audioamp3_generic_write()

void audioamp3_generic_write ( audioamp3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ audioamp3_hw_reset()

void audioamp3_hw_reset ( audioamp3_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description This function hardware reset the TAS5414C-Q1 four channel digital audio amplifier on AudioAmp 3 click by cleared to '0' state of the STB pin, wait the 100 ms, sets to '1' state of the STB pin and wait another the 100 ms.

Note
Delay is 200 ms.

◆ audioamp3_init()

AUDIOAMP3_RETVAL audioamp3_init ( audioamp3_t * ctx,
audioamp3_cfg_t * cfg )

Initialization function.

Parameters
audioamp3Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ audioamp3_power_up()

void audioamp3_power_up ( audioamp3_t * ctx)

Power Up function.

Parameters
ctxClick object.

@description This function power up the audio amplifier by sets to '1' state of the STB pin of the AudioAmp 3 click board.

◆ audioamp3_read_all_diagnostics()

void audioamp3_read_all_diagnostics ( audioamp3_t * ctx,
uint8_t * p_all_diagnostics )

Read all diagnostics function.

Parameters
ctxClick object.
p_read_dataPointer to the memory location where the diagnostics data be stored.

@description This function read all diagnostics from the targeted registers address starting from the AUDIOAMP3_DIAG_LATCHED_FAULT_REG_1 registers of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.

◆ audioamp3_run_channel_diagnostics()

AUDIOAMP3_STATUS_T audioamp3_run_channel_diagnostics ( audioamp3_t * ctx,
uint8_t rc_channel )

Run channel diagnostics function.

Parameters
ctxClick object.
rc_channelChannel on which is gonna be performed diagnostics.
Returns
Status check.

Flag state:

0 : ERROR; 1 : OK; pre

@description This function run channel diagnostics by writing the appropriate value to the target AUDIOAMP3_EXT_CTRL_REG_4 ( 0x0B ) register of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.

◆ audioamp3_set_channel_low_to_low()

AUDIOAMP3_STATUS_T audioamp3_set_channel_low_to_low ( audioamp3_t * ctx,
uint8_t s_channel )

Set the channel to low-low state function.

Parameters
ctxClick object.

@param s_channel Channel which is gonna be set to low-low state.

0x01 : Set channel 1 to low-low state; 0x02 : Set channel 2 to low-low state; pre

Returns
Status check.

Flag state:

0 : ERROR; 1 : OK; pre

@description This function the channel to low-low state by writing the appropriate value to the target AUDIOAMP3_EXT_CTRL_REG_6 ( 0x0D ) register of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.

◆ audioamp3_set_channel_mute_mode()

AUDIOAMP3_STATUS_T audioamp3_set_channel_mute_mode ( audioamp3_t * ctx,
uint8_t s_channel )

Set the mute mode of channel function.

Parameters
ctxClick object.

@param s_channel Channel which is gonna be set to low-low state.

0x00 : Set non-Hi-Z channels to play mode ( unmute ); 0x01 : Set channel 1 to mute mode, non-Hi-Z; 0x02 : Set channel 2 to mute mode, non-Hi-Z; 0x03 : All channels, Hi-Z, mute, reset disabled, dc detect is enabled; pre

Returns
Status check.

Flag state:

0 : ERROR; 1 : OK; pre

@description This function set the mute mode of target channel by writing the appropriate value to the target AUDIOAMP3_EXT_CTRL_REG_5 ( 0x0C ) register of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.

◆ audioamp3_set_gain_lvl()

AUDIOAMP3_STATUS_T audioamp3_set_gain_lvl ( audioamp3_t * ctx,
uint8_t gain_lvl )

Set the gain lvl function.

Parameters
ctxClick object.

@param gain_lvl Choose channel and set channel gain.

0x01 : Set channel 2 gain to 12 dB; 0x02 : Set channel 2 gain to 20 dB; 0x03 : Set all channels gain to 26 dB; 0x04 : Set channel 2 gain to 32 dB; pre

Returns
Status check.

Flag state:

0 : ERROR; 1 : OK; pre

@description This function set the gain level for all channels by writing the appropriate value to the target AUDIOAMP3_EXT_CTRL_REG_1 ( 0x08 ) register of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.

◆ audioamp3_set_play_mode()

AUDIOAMP3_STATUS_T audioamp3_set_play_mode ( audioamp3_t * ctx)

Set the play mode for all channels function.

Parameters
ctxClick object.
Returns
Status check.

Flag state:

0 : ERROR; 1 : OK; pre

@description This function set the play mode for all channels by writing the appropriate value to the target AUDIOAMP3_EXT_CTRL_REG_5 ( 0x0C ) register of TAS5414C-Q1 four channel digital audio amplifiers on AudioAmp 3 click board.