stereoamp 2.0.0.0
stereoamp.h File Reference

This file contains API for StereoAmp Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  stereoamp_t
 Click ctx object definition. More...
 
struct  stereoamp_cfg_t
 Click configuration structure definition. More...
 

Macros

#define STEREOAMP_MAP_MIKROBUS(cfg, mikrobus)
 
#define STEREOAMP_RETVAL   uint8_t
 
#define STEREOAMP_OK   0x00
 
#define STEREOAMP_INIT_ERROR   0xFF
 
#define STEREOAMP_I2C_ADDRESS_0   0x7C
 
#define STEREOAMP_I2C_ADDRESS_1   0x7D
 
#define STEREOAMP_CTRL_REG_MODE_CONTROL   0x00
 
#define STEREOAMP_CTRL_REG_DIAGNOSTIC_CONTROL   0x20
 
#define STEREOAMP_CTRL_REG_FAULT_DETECTION   0x40
 
#define STEREOAMP_CTRL_REG_VOLUME_CONTROL1   0x60
 
#define STEREOAMP_CTRL_REG_VOLUME_CONTROL2   0x80
 
#define STEREOAMP_DIAG_REG_FIX_ILIMIT   0x00
 
#define STEREOAMP_DIAG_REG_ILIMIT   0x02
 
#define STEREOAMP_DIAG_REG_DG_RESET   0x04
 
#define STEREOAMP_DIAG_REG_DG_ONE_SHOT   0x00
 
#define STEREOAMP_DIAG_REG_DG_CONT   0x08
 
#define STEREOAMP_DIAG_REG_DG_DISABLE   0x00
 
#define STEREOAMP_DIAG_REG_DG_EN   0x10
 
#define STEREOAMP_MODE_POWER_OFF   0x00
 
#define STEREOAMP_MODE_POWER_ON   0x10
 
#define STEREOAMP_MODE_INPUT1   0x04
 
#define STEREOAMP_MODE_INPUT1_OFF   0x00
 
#define STEREOAMP_MODE_INPUT2   0x08
 
#define STEREOAMP_MODE_INPUT2_OFF   0x00
 
#define STEREOAMP_MODE_BOTH_CHANNELS   0x0C
 
#define STEREOAMP_FLT_DET_REG_OUTPUT_SHT   0x01
 
#define STEREOAMP_FLT_DET_REG_OUTPUT_OPEN   0x02
 
#define STEREOAMP_FLT_DET_REG_RAIL_SHT   0x04
 
#define STEREOAMP_FLT_DET_REG_OVF   0x08
 
#define STEREOAMP_FLT_DET_REG_TSD   0x10
 
#define STEREOAMP_MASK_DATA   0x1F
 
#define STEREOAMP_MASK_ADDR   0xE0
 
#define STEREOAMP_MASK_CHANNEL   0x01
 
#define STEREOAMP_OUTPUT_LEFT_SPEAKER   0x01
 
#define STEREOAMP_OUTPUT_RIGHT_SPEAKER   0x00
 
#define STEREOAMP_GAIN_NEG_80dB   0x00
 
#define STEREOAMP_GAIN_NEG_54dB   0x01
 
#define STEREOAMP_GAIN_NEG_40_5dB   0x02
 
#define STEREOAMP_GAIN_NEG_34_5dB   0x03
 
#define STEREOAMP_GAIN_NEG_30dB   0x04
 
#define STEREOAMP_GAIN_NEG_27dB   0x05
 
#define STEREOAMP_GAIN_NEG_24dB   0x06
 
#define STEREOAMP_GAIN_NEG_21dB   0x07
 
#define STEREOAMP_GAIN_NEG_18dB   0x08
 
#define STEREOAMP_GAIN_NEG_15dB   0x09
 
#define STEREOAMP_GAIN_NEG_13_5dB   0x0A
 
#define STEREOAMP_GAIN_NEG_12dB   0x0B
 
#define STEREOAMP_GAIN_NEG_10_5dB   0x0C
 
#define STEREOAMP_GAIN_NEG_9dB   0x0D
 
#define STEREOAMP_GAIN_NEG_7_5dB   0x0E
 
#define STEREOAMP_GAIN_NEG_6dB   0x0F
 
#define STEREOAMP_GAIN_NEG_4_5dB   0x10
 
#define STEREOAMP_GAIN_NEG_3dB   0x11
 
#define STEREOAMP_GAIN_NEG_1_5dB   0x12
 
#define STEREOAMP_GAIN_NEG_0dB   0x13
 
#define STEREOAMP_GAIN_1_5dB   0x14
 
#define STEREOAMP_GAIN_3dB   0x15
 
#define STEREOAMP_GAIN_4_5dB   0x16
 
#define STEREOAMP_GAIN_6dB   0x17
 
#define STEREOAMP_GAIN_7_5dB   0x18
 
#define STEREOAMP_GAIN_9dB   0x19
 
#define STEREOAMP_GAIN_10_5dB   0x1A
 
#define STEREOAMP_GAIN_12dB   0x1B
 
#define STEREOAMP_GAIN_13_5dB   0x1C
 
#define STEREOAMP_GAIN_15dB   0x1D
 
#define STEREOAMP_GAIN_16_5dB   0x1E
 
#define STEREOAMP_GAIN_18dB   0x1F
 

Functions

void stereoamp_cfg_setup (stereoamp_cfg_t *cfg)
 Config Object Initialization function.
 
STEREOAMP_RETVAL stereoamp_init (stereoamp_t *ctx, stereoamp_cfg_t *cfg)
 Initialization function.
 
void stereoamp_default_cfg (stereoamp_t *ctx)
 Click Default Configuration function.
 
void stereoamp_generic_write (stereoamp_t *ctx, uint8_t ch_addr, uint8_t reg_addr, uint8_t tx_data)
 Generic write function.
 
void stereoamp_set_volume (stereoamp_t *ctx, uint8_t volume)
 Set the volume function.
 
void stereoamp_mute (stereoamp_t *ctx)
 Set the mute mode function.
 
void stereoamp_soft_reset (stereoamp_t *ctx)
 Soft reset function.
 
void stereoamp_enable_diagnostic (stereoamp_t *ctx)
 Enable the diagnostic function.
 
void stereoamp_set_power_on (stereoamp_t *ctx)
 Set the power On by channel function.
 
void stereoamp_enable_fault (stereoamp_t *ctx)
 Enable the fault function.
 
uint8_t stereoamp_check_fault_left (stereoamp_t *ctx)
 Check the fault of the left speaker function.
 
uint8_t stereoamp_check_fault_right (stereoamp_t *ctx)
 Check the fault of the right speaker function.
 

Detailed Description

This file contains API for StereoAmp Click driver.