audiomux 2.0.0.0
Public function

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

Function Documentation

◆ audiomux_cfg_setup()

void audiomux_cfg_setup ( audiomux_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.

◆ audiomux_default_cfg()

void audiomux_default_cfg ( audiomux_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for AudioMUX click.

Note
User may change click configuration as he wishes by using provided functions.

◆ audiomux_generic_read()

void audiomux_generic_read ( audiomux_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.

◆ audiomux_generic_write()

void audiomux_generic_write ( audiomux_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.

◆ audiomux_init()

AUDIOMUX_RETVAL audiomux_init ( audiomux_t * ctx,
audiomux_cfg_t * cfg )

Initialization function.

Parameters
audiomuxClick object.
cfgClick configuration structure.

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

◆ audiomux_mute_ouput()

T_AUDIOMUX_RETVAL audiomux_mute_ouput ( audiomux_t * ctx,
uint8_t state )

Output Mute function.

Parameters
ctxClick object
state0 - Output Mute ON, 1 - Output Mute OFF
Returns
0 - OK, 5 - Parameter State Error

@description This function performs a control of the output to be Mute ON or Mute OFF.

◆ audiomux_read_bytes()

T_AUDIOMUX_RETVAL audiomux_read_bytes ( audiomux_t * ctx,
uint8_t start_addr,
uint8_t * data_out,
uint8_t n_bytes )

Multiple Read function.

Parameters
ctxClick object
start_addrAddress which from data read be started
data_outMemory where data be stored
n_bytesNumber of bytes to be read
Returns
0 - OK, 1 - Wrong address, 2 - Number of bytes is out of range

@description This function reads the desired number of bytes from the registers.

◆ audiomux_read_single_byte()

T_AUDIOMUX_RETVAL audiomux_read_single_byte ( audiomux_t * ctx,
uint8_t reg_addr,
uint8_t * data_out )

Single Read function.

Parameters
ctxClick object
reg_addrAddress which from data be read
data_outMemory where data be stored
Returns
0 - OK, 1 - Wrong address

@description This function reads one byte data from the register.

◆ audiomux_select_input()

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.

Parameters
ctxClick object
input_selInput channel selection, from 0 (IN1) to 3 (IN4)
mute_in1 - Input Mute ON, 0 - Input Mute OFF
mic_gainFrom 0 (14dB) to 3 (0dB)
mic_state0 - MIC ON, 1 - MIC OFF
Returns
0 - OK, 3 - Input Selection Error, 4 - Gain Error, 5 - State Error

@description This function performs a input selection and control.

◆ audiomux_set_input_gain()

T_AUDIOMUX_RETVAL audiomux_set_input_gain ( audiomux_t * ctx,
uint8_t input_gain )

Input Gain Control function.

Parameters
ctxClick object
input_gainFrom 0 (0dB) to 7 (14dB)
Returns
0 - OK, 4 - Gain Error

@description This function performs a input gain selection.

◆ audiomux_set_treble_bass()

T_AUDIOMUX_RETVAL audiomux_set_treble_bass ( audiomux_t * ctx,
uint8_t treble,
uint8_t bass )

Treble and Bass Control function.

Parameters
ctxClick object
trebleTreble selection from -14dB to 14dB
bassBass selection from -14dB to 14dB
Returns
0 - OK, 7 - Treble or Bass Selection Error

@description This function performs a control of the treble and bass for EQ section.

◆ audiomux_set_volume()

T_AUDIOMUX_RETVAL audiomux_set_volume ( audiomux_t * ctx,
uint8_t volume1,
uint8_t volume2,
uint8_t side_sel )

Volume Control function.

Parameters
ctxClick object
volume1Pre-EQ section volume, 0x00 is highest volume and 0x3F is lowest volume
volume2Post-EQ section volume, 0x00 is highest and 0x03 is lowest volume
side_sel0x03 - Left volume control, 0x04 - Right volume control
Returns
0 - OK, 1 - Wrong side address, 6 - Wrong volume selection

@description This function performs a left or right volume control.

◆ audiomux_write_bytes()

T_AUDIOMUX_RETVAL audiomux_write_bytes ( audiomux_t * ctx,
uint8_t start_addr,
uint8_t * data_in,
uint8_t n_bytes )

Multiple Write function.

Parameters
ctxClick object
start_addrAddress which from data writing be started
data_inData to be written to register
n_bytesNumber of bytes to be written
Returns
0 - OK, 1 - Wrong address, 2 - Number of bytes is out of range

#description This function writes the desired number of bytes to the registers.

◆ audiomux_write_single_byte()

T_AUDIOMUX_RETVAL audiomux_write_single_byte ( audiomux_t * ctx,
uint8_t reg_addr,
uint8_t data_in )

Single Write function.

Parameters
ctxClick object
reg_addrAddress where data be written
data_inData to be written
Returns
0 - OK, 1 - Wrong address

@description This function writes one byte data to the register.