audiomux 2.0.0.0
audiomux.h File Reference

This file contains API for AudioMUX 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  audiomux_t
 Click ctx object definition. More...
 
struct  audiomux_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AUDIOMUX_MAP_MIKROBUS(cfg, mikrobus)
 
#define AUDIOMUX_RETVAL   uint8_t
 
#define AUDIOMUX_OK   0x00
 
#define AUDIOMUX_INIT_ERROR   0xFF
 
#define AUDIOMUX_DEVICE_ADDR   0x44
 
#define AUDIOMUX_AUTO_INCR   0x10
 
#define AUDIOMUX_INPUT_SEL_ADDR   0x00
 
#define AUDIOMUX_INPUT_GAIN_ADDR   0x01
 
#define AUDIOMUX_SURROUND_ADDR   0x02
 
#define AUDIOMUX_VOLUME_LEFT_ADDR   0x03
 
#define AUDIOMUX_VOLUME_RIGHT_ADDR   0x04
 
#define AUDIOMUX_TREBLE_BASS_ADDR   0x05
 
#define AUDIOMUX_OUTPUT_ADDR   0x06
 
#define AUDIOMUX_BASS_ALC_ADDR   0x07
 
#define AUDIOMUX_IN1_EN   0x00
 
#define AUDIOMUX_IN2_EN   0x01
 
#define AUDIOMUX_IN3_EN   0x02
 
#define AUDIOMUX_IN4_EN   0x03
 
#define AUDIOMUX_MIC_GAIN_14DB   0x00
 
#define AUDIOMUX_MIC_GAIN_10DB   0x01
 
#define AUDIOMUX_MIC_GAIN_6DB   0x02
 
#define AUDIOMUX_MIC_GAIN_0DB   0x03
 
#define AUDIOMUX_MIC_OFF   0x01
 
#define AUDIOMUX_MIC_ON   0x00
 
#define AUDIOMUX_MUTE_INPUT_ON   0x01
 
#define AUDIOMUX_MUTE_INPUT_OFF   0x00
 
#define AUDIOMUX_IN_GAIN_0DB   0x00
 
#define AUDIOMUX_IN_GAIN_2DB   0x01
 
#define AUDIOMUX_IN_GAIN_4DB   0x02
 
#define AUDIOMUX_IN_GAIN_6DB   0x03
 
#define AUDIOMUX_IN_GAIN_8DB   0x04
 
#define AUDIOMUX_IN_GAIN_10DB   0x05
 
#define AUDIOMUX_IN_GAIN_12DB   0x06
 
#define AUDIOMUX_IN_GAIN_14DB   0x07
 
#define AUDIOMUX_SURROUND_MODE_ON   0x01
 
#define AUDIOMUX_SURROUND_MODE_OFF   0x00
 
#define AUDIOMUX_SURROUND_GAIN_0DB   0x00
 
#define AUDIOMUX_SURROUND_GAIN_6DB   0x02
 
#define AUDIOMUX_SURROUND_GAIN_9DB   0x04
 
#define AUDIOMUX_SURROUND_GAIN_12DB   0x06
 
#define AUDIOMUX_MIX_INV_100   0x00
 
#define AUDIOMUX_MIX_INV_50   0x08
 
#define AUDIOMUX_MIX_INV_25   0x10
 
#define AUDIOMUX_MIX_0   0x18
 
#define AUDIOMUX_MIX_NONINV_100   0x20
 
#define AUDIOMUX_MIX_NONINV_75   0x28
 
#define AUDIOMUX_MIX_NONINV_50   0x30
 
#define AUDIOMUX_MIX_MUTE   0x38
 
#define AUDIOMUX_BUFF_GAIN_0   0x40
 
#define AUDIOMUX_BUFF_GAIN_6DB   0x00
 
#define AUDIOMUX_VOL1_0DB   0x00
 
#define AUDIOMUX_VOL1_1DB_NEG   0x01
 
#define AUDIOMUX_VOL1_2DB_NEG   0x02
 
#define AUDIOMUX_VOL1_3DB_NEG   0x03
 
#define AUDIOMUX_VOL1_4DB_NEG   0x04
 
#define AUDIOMUX_VOL1_5DB_NEG   0x05
 
#define AUDIOMUX_VOL1_6DB_NEG   0x06
 
#define AUDIOMUX_VOL1_7DB_NEG   0x07
 
#define AUDIOMUX_VOL1_8DB_NEG   0x08
 
#define AUDIOMUX_VOL1_16DB_NEG   0x10
 
#define AUDIOMUX_VOL1_24DB_NEG   0x18
 
#define AUDIOMUX_VOL1_32DB_NEG   0x20
 
#define AUDIOMUX_VOL1_40DB_NEG   0x28
 
#define AUDIOMUX_VOL1_48DB_NEG   0x30
 
#define AUDIOMUX_VOL1_56DB_NEG   0x38
 
#define AUDIOMUX_VOL2_0DB   0x00
 
#define AUDIOMUX_VOL2_8DB_NEG   0x01
 
#define AUDIOMUX_VOL2_16DB_NEG   0x02
 
#define AUDIOMUX_VOL2_24DB_NEG   0x03
 
#define AUDIOMUX_TRE_BASS_14DB_NEG   0x00
 
#define AUDIOMUX_TRE_BASS_12DB_NEG   0x01
 
#define AUDIOMUX_TRE_BASS_10DB_NEG   0x02
 
#define AUDIOMUX_TRE_BASS_8DB_NEG   0x03
 
#define AUDIOMUX_TRE_BASS_6DB_NEG   0x04
 
#define AUDIOMUX_TRE_BASS_4DB_NEG   0x05
 
#define AUDIOMUX_TRE_BASS_2DB_NEG   0x06
 
#define AUDIOMUX_TRE_BASS_0DB   0x07
 
#define AUDIOMUX_TRE_BASS_14DB   0x08
 
#define AUDIOMUX_TRE_BASS_12DB   0x09
 
#define AUDIOMUX_TRE_BASS_10DB   0x0A
 
#define AUDIOMUX_TRE_BASS_8DB   0x0B
 
#define AUDIOMUX_TRE_BASS_6DB   0x0C
 
#define AUDIOMUX_TRE_BASS_4DB   0x0D
 
#define AUDIOMUX_TRE_BASS_2DB   0x0E
 
#define AUDIOMUX_MUTE_OUTPUT_ON   0x00
 
#define AUDIOMUX_MUTE_OUTPUT_OFF   0x01
 
#define AUDIOMUX_ALC_MODE_ON   0x01
 
#define AUDIOMUX_DETECTOR_ON   0x02
 
#define AUDIOMUX_RELEASE_CURR   0x04
 
#define AUDIOMUX_TIME_RES_12K5   0x00
 
#define AUDIOMUX_TIME_RES_25K   0x08
 
#define AUDIOMUX_TIME_RES_50K   0x10
 
#define AUDIOMUX_TIME_RES_100K   0x18
 
#define AUDIOMUX_THRSH_700MVRMS   0x00
 
#define AUDIOMUX_THRSH_485MVRMS   0x20
 
#define AUDIOMUX_THRSH_320MVRMS   0x40
 
#define AUDIOMUX_THRSH_170MVRMS   0x60
 
#define AUDIOMUX_MODE1_FIXED_RES   0x00
 
#define AUDIOMUX_MODE2_ADAPTIVE   0x80
 
#define AUDIOMUX_OK   0x00
 
#define AUDIOMUX_ADDR_ERR   0x01
 
#define AUDIOMUX_NBYTES_ERR   0x02
 
#define AUDIOMUX_IN_SEL_ERR   0x03
 
#define AUDIOMUX_GAIN_ERR   0x04
 
#define AUDIOMUX_STATE_ERR   0x05
 
#define AUDIOMUX_VOL_ERR   0x06
 
#define AUDIOMUX_TRE_BASS_ERR   0x07
 
#define T_AUDIOMUX_P   const uint8_t*
 
#define T_AUDIOMUX_RETVAL   uint8_t
 

Functions

void audiomux_cfg_setup (audiomux_cfg_t *cfg)
 Config Object Initialization function.
 
AUDIOMUX_RETVAL audiomux_init (audiomux_t *ctx, audiomux_cfg_t *cfg)
 Initialization function.
 
void audiomux_default_cfg (audiomux_t *ctx)
 Click Default Configuration function.
 
void audiomux_generic_write (audiomux_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void audiomux_generic_read (audiomux_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
T_AUDIOMUX_RETVAL audiomux_write_single_byte (audiomux_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Single Write function.
 
T_AUDIOMUX_RETVAL audiomux_write_bytes (audiomux_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
 Multiple Write function.
 
T_AUDIOMUX_RETVAL audiomux_read_single_byte (audiomux_t *ctx, uint8_t reg_addr, uint8_t *data_out)
 Single Read function.
 
T_AUDIOMUX_RETVAL audiomux_read_bytes (audiomux_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
 Multiple Read function.
 
T_AUDIOMUX_RETVAL audiomux_select_input (audiomux_t *ctx, uint8_t input_sel, uint8_t mute_in, uint8_t mic_gain, uint8_t mic_state)
 Input Selection function.
 
T_AUDIOMUX_RETVAL audiomux_set_input_gain (audiomux_t *ctx, uint8_t input_gain)
 Input Gain Control function.
 
T_AUDIOMUX_RETVAL audiomux_set_volume (audiomux_t *ctx, uint8_t volume1, uint8_t volume2, uint8_t side_sel)
 Volume Control function.
 
T_AUDIOMUX_RETVAL audiomux_set_treble_bass (audiomux_t *ctx, uint8_t treble, uint8_t bass)
 Treble and Bass Control function.
 
T_AUDIOMUX_RETVAL audiomux_mute_ouput (audiomux_t *ctx, uint8_t state)
 Output Mute function.
 

Detailed Description

This file contains API for AudioMUX Click driver.