39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define VOLUME2_REG_VOLUME_1A_2A 0x00
79#define VOLUME2_REG_VOLUME_1B_ZERO1 0x01
85#define VOLUME2_REG_VOLUME_2B_ZERO2 0x02
103#define VOLUME2_GAIN_OPT_0_DB 0x00
109#define VOLUME2_GAIN_OPT_3_DB 0x01
115#define VOLUME2_GAIN_OPT_6_DB 0x02
121#define VOLUME2_GAIN_OPT_9_DB 0x03
127#define VOLUME2_ZERO_CROSS_DET_OPT_OFF 0x00
133#define VOLUME2_ZERO_CROSS_DET_OPT_ON 0x01
140#define VOLUME2_SET_DEV_ADDR 0x44
158#define VOLUME2_DEVICE_MUTE_ON 0x00
164#define VOLUME2_DEVICE_MUTE_OFF 0x01
182#define VOLUME2_MAP_MIKROBUS( cfg, mikrobus ) \
183 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
184 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
185 cfg.mte = MIKROBUS( mikrobus, MIKROBUS_PWM )
err_t volume2_device_mute(volume2_t *ctx, uint8_t mte_state)
Volume 2 device mute function.
err_t volume2_init(volume2_t *ctx, volume2_cfg_t *cfg)
Volume 2 initialization function.
err_t volume2_generic_write(volume2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Volume 2 I2C writing function.
err_t volume2_update_vol_data(volume2_t *ctx, volume2_vol_data_t update_data)
Volume 2 update volume data function.
void volume2_cfg_setup(volume2_cfg_t *cfg)
Volume 2 configuration object setup function.
err_t volume2_default_cfg(volume2_t *ctx)
Volume 2 default configuration function.
err_t volume2_generic_read(volume2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Volume 2 I2C reading function.
Volume 2 Click configuration object.
Definition volume2.h:215
pin_name_t mte
Definition volume2.h:219
uint32_t i2c_speed
Definition volume2.h:221
pin_name_t scl
Definition volume2.h:216
pin_name_t sda
Definition volume2.h:217
uint8_t i2c_address
Definition volume2.h:222
Volume 2 Click context object.
Definition volume2.h:195
digital_out_t mte
Definition volume2.h:198
i2c_master_t i2c
Definition volume2.h:202
uint8_t slave_address
Definition volume2.h:206
Volume 2 Vol data structure.
Definition volume2.h:242
uint8_t gain_ch2
Definition volume2.h:244
uint8_t attenuation_ch1
Definition volume2.h:245
uint8_t zero_cross_det_ch2
Definition volume2.h:248
uint8_t attenuation_ch2
Definition volume2.h:246
uint8_t gain_ch1
Definition volume2.h:243
uint8_t zero_cross_det_ch1
Definition volume2.h:247
volume2_return_value_t
Volume 2 Click return value data.
Definition volume2.h:231
@ VOLUME2_ERROR
Definition volume2.h:233
@ VOLUME2_OK
Definition volume2.h:232