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 ADAC3_CONTROL_AOUT_ENABLE 0x40
74#define ADAC3_CONTROL_AIN_SINGLE_ENDED 0x00
75#define ADAC3_CONTROL_AIN_3_DIFFERENTIAL 0x10
76#define ADAC3_CONTROL_AIN_MIXED 0x20
77#define ADAC3_CONTROL_AIN_2_DIFFERENTIAL 0x30
78#define ADAC3_CONTROL_AUTO_INCREMENT 0x04
79#define ADAC3_CONTROL_AD_CH0 0x00
80#define ADAC3_CONTROL_AD_CH1 0x01
81#define ADAC3_CONTROL_AD_CH2 0x02
82#define ADAC3_CONTROL_AD_CH3 0x03
88#define ADAC3_VREF_2048mV 2048.0
89#define ADAC3_VREF_4096mV 4096.0
90#define ADAC3_RESOLUTION 0xFF
97#define ADAC3_DEVICE_ADDRESS_A2A1A0_000 0x48
98#define ADAC3_DEVICE_ADDRESS_A2A1A0_001 0x49
99#define ADAC3_DEVICE_ADDRESS_A2A1A0_010 0x4A
100#define ADAC3_DEVICE_ADDRESS_A2A1A0_011 0x4B
101#define ADAC3_DEVICE_ADDRESS_A2A1A0_100 0x4C
102#define ADAC3_DEVICE_ADDRESS_A2A1A0_101 0x4D
103#define ADAC3_DEVICE_ADDRESS_A2A1A0_110 0x4E
104#define ADAC3_DEVICE_ADDRESS_A2A1A0_111 0x4F
122#define ADAC3_MAP_MIKROBUS( cfg, mikrobus ) \
123 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
124 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
adac3_return_value_t
ADAC 3 Click return value data.
Definition adac3.h:165
@ ADAC3_ERROR
Definition adac3.h:167
@ ADAC3_OK
Definition adac3.h:166
err_t adac3_write_control(adac3_t *ctx, uint8_t control)
ADAC 3 write control function.
err_t adac3_read_adc(adac3_t *ctx, uint8_t *adc)
ADAC 3 read adc function.
err_t adac3_default_cfg(adac3_t *ctx)
ADAC 3 default configuration function.
err_t adac3_init(adac3_t *ctx, adac3_cfg_t *cfg)
ADAC 3 initialization function.
void adac3_cfg_setup(adac3_cfg_t *cfg)
ADAC 3 configuration object setup function.
err_t adac3_write_dac(adac3_t *ctx, uint8_t dac)
ADAC 3 write dac function.
ADAC 3 Click configuration object.
Definition adac3.h:151
uint32_t i2c_speed
Definition adac3.h:155
pin_name_t scl
Definition adac3.h:152
pin_name_t sda
Definition adac3.h:153
uint8_t i2c_address
Definition adac3.h:156
ADAC 3 Click context object.
Definition adac3.h:134
uint8_t dac
Definition adac3.h:142
i2c_master_t i2c
Definition adac3.h:136
uint8_t slave_address
Definition adac3.h:139
uint8_t control
Definition adac3.h:141