audioamp11 2.1.0.0
audioamp11.h File Reference

This file contains API for AudioAMP 11 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  audioamp11_t
 AudioAMP 11 Click context object. More...
 
struct  audioamp11_cfg_t
 AudioAMP 11 Click configuration object. More...
 

Macros

#define AUDIOAMP11_REG_REGGAIN   0x04
 AudioAMP 11 description register.
 
#define AUDIOAMP11_REG_VOLCTRL   0x1B
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_0dB   0x00
 AudioAMP 11 description setting.
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m2dB   0x01
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m4dB   0x02
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m6dB   0x03
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m8dB   0x04
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m10dB   0x05
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m12dB   0x06
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m14dB   0x07
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m16dB   0x08
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m18dB   0x09
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m20dB   0x0A
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m22dB   0x0B
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m24dB   0x0C
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m26dB   0x0D
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m28dB   0x0E
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m30dB   0x0F
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m32dB   0x10
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m34dB   0x11
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m36dB   0x12
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m38dB   0x13
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m40dB   0x14
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m42dB   0x15
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m44dB   0x16
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m46dB   0x17
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m48dB   0x18
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m50dB   0x19
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m52dB   0x1A
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m54dB   0x1B
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m56dB   0x1C
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m58dB   0x1D
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m60dB   0x1E
 
#define AUDIOAMP11_GS_0dB_VOLCTRL_m62dB   0x1F
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_6dB   0x00
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_4_1dB   0x01
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_2_2dB   0x02
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_0_4dB   0x03
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m1_6dB   0x04
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m3_5dB   0x05
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m5_6dB   0x06
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m7_5dB   0x07
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m9_5dB   0x08
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m11_4dB   0x09
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m13_4dB   0x0A
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m15_4dB   0x0B
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m17_3dB   0x0C
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m19_3dB   0x0D
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m21_3dB   0x0E
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m23_3dB   0x0F
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m25_3dB   0x10
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m27_3dB   0x11
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m29_1dB   0x12
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m30_7dB   0x13
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m32_2dB   0x14
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m33_7dB   0x15
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m35_1dB   0x16
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m36_6dB   0x17
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m36dB   0x18
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m35_2dB   0x19
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m34_6dB   0x1A
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m33_9dB   0x1B
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m33_5dB   0x1D
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m33_4dB   0x1E
 
#define AUDIOAMP11_GS_6dB_VOLCTRL_m62dB   0x1F
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_12dB   0x00
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_10_4dB   0x01
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_8_8dB   0x02
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_7_1dB   0x03
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_5_4dB   0x04
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_3_6dB   0x05
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_1_7dB   0x06
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m0_2dB   0x07
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m2dB   0x08
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m3_9dB   0x09
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m5_8dB   0x0A
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m7_8dB   0x0B
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m9_7dB   0x0C
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m11_7dB   0x0D
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m13_6dB   0x0E
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m15_6dB   0x0F
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m17_6dB   0x10
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_3dB   0x11
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m20_4dB   0x12
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m20_5dB   0x13
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m20_2dB   0x14
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m20dB   0x15
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_8dB   0x16
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_7dB   0x17
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_6dB   0x18
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_5dB   0x19
 
#define AUDIOAMP11_GS_12dB_VOLCTRL_m19_4dB   0x1B
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_18dB   0x00
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_17dB   0x01
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_16dB   0x02
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_15dB   0x03
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_13_7dB   0x04
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_12_4dB   0x05
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_10_9dB   0x06
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_9_4dB   0x07
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_7_9dB   0x08
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_6_2dB   0x09
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_4_5dB   0x0A
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_2_7dB   0x0B
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_0_9dB   0x0C
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m0_9dB   0x0D
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m2_8dB   0x0E
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m4_7dB   0x0F
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m6_6dB   0x10
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m7_3dB   0x11
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m7_1dB   0x14
 
#define AUDIOAMP11_GS_18dB_VOLCTRL_m7_0dB   0x18
 
#define AUDIOAMP11_GS_24dB_VOLCTRL_24dB   0x00
 
#define AUDIOAMP11_VOLUME_LEVEL_31   0x00
 
#define AUDIOAMP11_VOLUME_LEVEL_30   0x01
 
#define AUDIOAMP11_VOLUME_LEVEL_29   0x02
 
#define AUDIOAMP11_VOLUME_LEVEL_28   0x03
 
#define AUDIOAMP11_VOLUME_LEVEL_27   0x04
 
#define AUDIOAMP11_VOLUME_LEVEL_26   0x05
 
#define AUDIOAMP11_VOLUME_LEVEL_25   0x06
 
#define AUDIOAMP11_VOLUME_LEVEL_24   0x07
 
#define AUDIOAMP11_VOLUME_LEVEL_23   0x08
 
#define AUDIOAMP11_VOLUME_LEVEL_22   0x09
 
#define AUDIOAMP11_VOLUME_LEVEL_21   0x0A
 
#define AUDIOAMP11_VOLUME_LEVEL_20   0x0B
 
#define AUDIOAMP11_VOLUME_LEVEL_19   0x0C
 
#define AUDIOAMP11_VOLUME_LEVEL_18   0x0D
 
#define AUDIOAMP11_VOLUME_LEVEL_17   0x0E
 
#define AUDIOAMP11_VOLUME_LEVEL_16   0x0F
 
#define AUDIOAMP11_VOLUME_LEVEL_15   0x10
 
#define AUDIOAMP11_VOLUME_LEVEL_14   0x11
 
#define AUDIOAMP11_VOLUME_LEVEL_13   0x12
 
#define AUDIOAMP11_VOLUME_LEVEL_12   0x13
 
#define AUDIOAMP11_VOLUME_LEVEL_11   0x14
 
#define AUDIOAMP11_VOLUME_LEVEL_10   0x15
 
#define AUDIOAMP11_VOLUME_LEVEL_9   0x16
 
#define AUDIOAMP11_VOLUME_LEVEL_8   0x17
 
#define AUDIOAMP11_VOLUME_LEVEL_7   0x18
 
#define AUDIOAMP11_VOLUME_LEVEL_6   0x19
 
#define AUDIOAMP11_VOLUME_LEVEL_5   0x1A
 
#define AUDIOAMP11_VOLUME_LEVEL_4   0x1B
 
#define AUDIOAMP11_VOLUME_LEVEL_3   0x1C
 
#define AUDIOAMP11_VOLUME_LEVEL_2   0x1D
 
#define AUDIOAMP11_VOLUME_LEVEL_1   0x1E
 
#define AUDIOAMP11_VOLUME_LEVEL_0   0x1F
 
#define AUDIOAMP11_VOLUME_MUTE   0x3F
 
#define AUDIOAMP11_GAINDEC_0dB   0x01
 
#define AUDIOAMP11_GAINDEC_6dB   0x02
 
#define AUDIOAMP11_GAINDEC_12dB   0x04
 
#define AUDIOAMP11_GAINDEC_18dB   0x08
 
#define AUDIOAMP11_GAINDEC_24dB   0x10
 
#define AUDIOAMP11_DEVICE_ADDRESS   0x2A
 AudioAMP 11 device address setting.
 
#define AUDIOAMP11_CALC_GAIN_CONFIG(GAINDEC)   (GAINDEC==1?0:(GAINDEC==2?6:(GAINDEC==4?12:(GAINDEC==8 ? 18:24))))
 AudioAMP 11 description volume control.
 
#define OUTPUT_VOLUME_0dB
 
#define OUTPUT_VOLUME_6dB
 
#define OUTPUT_VOLUME_12dB
 
#define OUTPUT_VOLUME_18dB
 
#define OUTPUT_VOLUME_24dB   24.0
 
#define AUDIOAMP11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  audioamp11_return_value_t { AUDIOAMP11_OK = 0 , AUDIOAMP11_ERROR = -1 }
 AudioAMP 11 Click return value data. More...
 

Functions

void audioamp11_cfg_setup (audioamp11_cfg_t *cfg)
 AudioAMP 11 configuration object setup function.
 
err_t audioamp11_init (audioamp11_t *ctx, audioamp11_cfg_t *cfg)
 AudioAMP 11 initialization function.
 
err_t audioamp11_default_cfg (audioamp11_t *ctx)
 AudioAMP 11 default configuration function.
 
err_t audioamp11_generic_write (audioamp11_t *ctx, uint8_t reg, uint8_t data_in)
 AudioAMP 11 I2C writing function.
 
err_t audioamp11_generic_read (audioamp11_t *ctx, uint8_t reg, uint8_t *data_out)
 AudioAMP 11 I2C reading function.
 
void audioamp11_enable_device (audioamp11_t *ctx)
 AudioAMP 11 enable device function.
 
void audioamp11_disable_device (audioamp11_t *ctx)
 AudioAMP 11 enable device function.
 
err_t audioamp11_check_gain (audioamp11_t *ctx, uint8_t *gain)
 AudioAMP 11 check gain function.
 
err_t audioamp11_get_output_volume_level (audioamp11_t *ctx, uint8_t *volume_data)
 AudioAMP 11 get output volume level function.
 
err_t audioamp11_set_output_volume_level (audioamp11_t *ctx, uint8_t volume_data)
 AudioAMP 11 set output volume level function.
 

Detailed Description

This file contains API for AudioAMP 11 Click Driver.

Enumeration Type Documentation

◆ audioamp11_return_value_t

AudioAMP 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
AUDIOAMP11_OK 
AUDIOAMP11_ERROR