42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_analog_in.h"
55#include "drv_i2c_master.h"
68#define MIC2_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
70 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
71 cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN )
86#define MIC2_DEVICE_SLAVE_ADDRESS 0x2C
void mic2_generic_write(mic2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Click Default Configuration function.
void mic2_cfg_setup(mic2_cfg_t *cfg)
Config Object Initialization function.
void mic2_set_potentiometer(mic2_t *ctx, uint8_t ptt_value)
Set potentiometer value.
err_t mic2_init(mic2_t *ctx, mic2_cfg_t *cfg)
Initialization function.
err_t mic2_read_an_pin_value(mic2_t *ctx, uint16_t *data_out)
MIC 2 read AN pin value function.
err_t mic2_read_an_pin_voltage(mic2_t *ctx, float *data_out)
MIC 2 read AN pin voltage level function.
uint16_t mic2_data_t
Analog data type.
Definition mic2.h:99
Click configuration structure definition.
Definition mic2.h:120
analog_in_resolution_t resolution
Definition mic2.h:131
float vref
Definition mic2.h:132
uint32_t i2c_speed
Definition mic2.h:128
pin_name_t an_pin
Definition mic2.h:124
pin_name_t scl
Definition mic2.h:122
pin_name_t sda
Definition mic2.h:123
uint8_t i2c_address
Definition mic2.h:129
Click ctx object definition.
Definition mic2.h:105
i2c_master_t i2c
Definition mic2.h:107
uint8_t slave_address
Definition mic2.h:110
analog_in_t adc
Definition mic2.h:112