audioamp3 2.0.0.0
audioamp3.h File Reference

This file contains API for AudioAmp 3 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  audioamp3_t
 Click ctx object definition. More...
 
struct  audioamp3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AUDIOAMP3_MAP_MIKROBUS(cfg, mikrobus)
 
#define AUDIOAMP3_RETVAL   uint8_t
 
#define AUDIOAMP3_STATUS_T   uint8_t
 
#define AUDIOAMP3_OK   0x00
 
#define AUDIOAMP3_INIT_ERROR   0xFF
 
#define AUDIOAMP3_I2C_SLAVE_ADDRESS   0x6C
 
#define AUDIOAMP3_DIAG_LATCHED_FAULT_REG_1   0x00
 
#define AUDIOAMP3_DIAG_LATCHED_FAULT_REG_2   0x01
 
#define AUDIOAMP3_DIAG_LATCHED_REG_1   0x02
 
#define AUDIOAMP3_DIAG_LATCHED_REG_2   0x03
 
#define AUDIOAMP3_EXT_STATUS_REG_1   0x04
 
#define AUDIOAMP3_EXT_STATUS_REG_2   0x05
 
#define AUDIOAMP3_EXT_STATUS_REG_3   0x06
 
#define AUDIOAMP3_EXT_STATUS_REG_4   0x07
 
#define AUDIOAMP3_EXT_STATUS_REG_5   0x11
 
#define AUDIOAMP3_EXT_CTRL_REG_1   0x08
 
#define AUDIOAMP3_EXT_CTRL_REG_2   0x09
 
#define AUDIOAMP3_EXT_CTRL_REG_3   0x0A
 
#define AUDIOAMP3_EXT_CTRL_REG_4   0x0B
 
#define AUDIOAMP3_EXT_CTRL_REG_5   0x0C
 
#define AUDIOAMP3_EXT_CTRL_REG_6   0x0D
 
#define AUDIOAMP3_EXT_CTRL_REG_7   0x10
 
#define AUDIOAMP3_SEL_CH_1_GAIN_12dB   0x00
 
#define AUDIOAMP3_SEL_CH_1_GAIN_20dB   0x01
 
#define AUDIOAMP3_SEL_CH_1_GAIN_32dB   0x03
 
#define AUDIOAMP3_SEL_CH_2_GAIN_12dB   0x00
 
#define AUDIOAMP3_SEL_CH_2_GAIN_20dB   0x04
 
#define AUDIOAMP3_SEL_CH_2_GAIN_32dB   0x0C
 
#define AUDIOAMP3_SEL_CH_3_GAIN_12dB   0x00
 
#define AUDIOAMP3_SEL_CH_3_GAIN_20dB   0x10
 
#define AUDIOAMP3_SEL_CH_3_GAIN_32dB   0x30
 
#define AUDIOAMP3_SEL_CH_4_GAIN_12dB   0x00
 
#define AUDIOAMP3_SEL_CH_4_GAIN_20dB   0x40
 
#define AUDIOAMP3_SEL_CH_4_GAIN_32dB   0xC0
 
#define AUDIOAMP3_SEL_ALL_CH_GAIN_26dB   0xAA
 
#define AUDIOAMP3_OVERCURR_CH_1_LIMIT_LVL_1   0x00
 
#define AUDIOAMP3_OVERCURR_CH_1_LIMIT_LVL_2   0x10
 
#define AUDIOAMP3_OVERCURR_CH_2_LIMIT_LVL_1   0x00
 
#define AUDIOAMP3_OVERCURR_CH_2_LIMIT_LVL_2   0x20
 
#define AUDIOAMP3_OVERCURR_CH_3_LIMIT_LVL_1   0x00
 
#define AUDIOAMP3_OVERCURR_CH_3_LIMIT_LVL_2   0x40
 
#define AUDIOAMP3_OVERCURR_CH_4_LIMIT_LVL_1   0x00
 
#define AUDIOAMP3_OVERCURR_CH_4_LIMIT_LVL_2   0x80
 
#define AUDIOAMP3_CURRENT_LIMIT_LVL_2_ALL_CH   0xF0
 
#define AUDIOAMP3_DIS_THERMAL_FOLDBACK   0x01
 
#define AUDIOAMP3_FREQ_SEL_417_kHZ_45_PHASE_CLIP_OTWT   0x0D
 
#define AUDIOAMP3_FREQ_SEL_500_kHZ   0x00
 
#define AUDIOAMP3_FREQ_SEL_357_kHZ   0x02
 
#define AUDIOAMP3_CONFIG_CLIP_OTW_TWEETER_DETECT   0x00
 
#define AUDIOAMP3_CONFIG_CLIP_OTW_CLIP_DETECT   0x04
 
#define AUDIOAMP3_CONFIG_CLIP_OTW_OVERTEMP_WARNING   0x08
 
#define AUDIOAMP3_ENABLE_HARD_STOP_MODE   0x10
 
#define AUDIOAMP3_SET_FS_357_kHZ_180_PHASE_CLIP_OTWT   0x20
 
#define AUDIOAMP3_SEND_SYNC_PULSE_OSC_SYNC   0x40
 
#define AUDIOAMP3_CONFIG_CLIP_OTW_THERMAL_FOLDBACK   0x80
 
#define AUDIOAMP3_LOAD_DIAG_RUN_CH_1   0x01
 
#define AUDIOAMP3_LOAD_DIAG_RUN_CH_2   0x02
 
#define AUDIOAMP3_LOAD_DIAG_RUN_CH_3   0x04
 
#define AUDIOAMP3_LOAD_DIAG_RUN_CH_4   0x08
 
#define AUDIOAMP3_SET_CLOCK_OUTPUT_DISABLED   0x50
 
#define AUDIOAMP3_DIS_DC_DETECTION_ALL_CH   0x00
 
#define AUDIOAMP3_EN_TWEETER_DETECT_MODE   0x20
 
#define AUDIOAMP3_EN_CLOCK_OUTPUT_OSC_SYNC   0x80
 
#define AUDIOAMP3_OUT_CTRL_ALL_CH_HI_Z_MUTE_RST_DIS_DC_EN   0x1F
 
#define AUDIOAMP3_OUT_CTRL_SET_CH_1_2_3_4_MUTE   0x00
 
#define AUDIOAMP3_OUT_CTRL_SET_PLAY_MODE   0x20
 
#define AUDIOAMP3_OUT_CTRL_DC_DET_SHUTDOWN_DIS   0x40
 
#define AUDIOAMP3_OUT_CTRL_RST_DEVICE   0x80
 
#define AUDIOAMP3_OUT_CTRL_L_LOW_STATE_DIS_ALL_CH   0x00
 
#define AUDIOAMP3_OUT_CTRL_SET_CH_1_L_LOW_STATE   0xC1
 
#define AUDIOAMP3_OUT_CTRL_SET_CH_2_L_LOW_STATE   0xC2
 
#define AUDIOAMP3_OUT_CTRL_SET_CH_3_L_LOW_STATE   0xC4
 
#define AUDIOAMP3_OUT_CTRL_SET_CH_4_L_LOW_STATE   0xC8
 
#define AUDIOAMP3_OUT_CTRL_CONN_CH_1_2_BTL_MODE   0xD0
 
#define AUDIOAMP3_OUT_CTRL_CONN_CH_3_4_BTL_MODE   0xE0
 
#define AUDIOAMP3_MISCELL_NORMAL_SPEED_S2P_S2G_TIMING   0x01
 
#define AUDIOAMP3_MISCELL_MIN_DC_DET_VAL_0_8_V   0x00
 
#define AUDIOAMP3_MISCELL_MIN_DC_DET_VAL_2_4_V   0x02
 
#define AUDIOAMP3_MISCELL_EN_CROSSTALK_ENHANCEMENT   0x04
 
#define AUDIOAMP3_MISCELL_N_LOAD_DIAG_PHASES   0x08
 
#define AUDIOAMP3_MISCELL_S2P_S2G_LOAD_DIAG   0x10
 
#define AUDIOAMP3_MISCELL_SLOW_COMMON_MODE_RAMP   0x20
 
#define AUDIOAMP3_MISCELL_SLOWER_CM_RAMP_DOWN_MUTE_MODE   0x80
 
#define AUDIOAMP3_MASK_BIT_SEL_NO_CH   0x00
 
#define AUDIOAMP3_MASK_BIT_SEL_CH_1   0x01
 
#define AUDIOAMP3_MASK_BIT_SEL_CH_2   0x02
 
#define AUDIOAMP3_MASK_BIT_SEL_ALL_CH   0x03
 
#define AUDIOAMP3_MASK_BIT_SEL_GAIN_12dB   0x0C
 
#define AUDIOAMP3_MASK_BIT_SEL_GAIN_20dB   0x14
 
#define AUDIOAMP3_MASK_BIT_SEL_GAIN_26dB   0x1A
 
#define AUDIOAMP3_MASK_BIT_SEL_GAIN_32dB   0x20
 
#define AUDIOAMP3_MASK_BIT_CH_1   0xFC
 
#define AUDIOAMP3_MASK_BIT_MUTE_NO_CH   0x10
 
#define AUDIOAMP3_MASK_BIT_MUTE_CH_1   0xFE
 
#define AUDIOAMP3_MASK_BIT_MUTE_CH_2   0xFD
 
#define AUDIOAMP3_GAIN_VAL_MAX   0x04
 
#define AUDIOAMP3_GAIN_VAL_MEDIUM   0x03
 
#define AUDIOAMP3_GAIN_VAL_MIN   0x01
 
#define AUDIOAMP3_GAIN_VAL_0   0x00
 
#define AUDIOAMP3_GAIN_VAL_5   0x05
 
#define AUDIOAMP3_GAIN_VAL_LVL_1_12dB   0x01
 
#define AUDIOAMP3_GAIN_VAL_LVL_2_20dB   0x02
 
#define AUDIOAMP3_GAIN_VAL_LVL_3_26dB   0x03
 
#define AUDIOAMP3_GAIN_VAL_LVL_4_32dB   0x04
 
#define AUDIOAMP3_STATUS_ERR   0x00
 
#define AUDIOAMP3_STATUS_OK   0x01
 

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

This file contains API for AudioAmp 3 Click driver.