39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_i2c_master.h"
50#include "drv_analog_in.h"
72#define CURRENT7_NUM_CONVERSIONS 100
73#define CURRENT7_SENSITIVITY_V_TO_A 0.8f
79#define CURRENT7_ADC_RESOLUTION 0x0FFF
80#define CURRENT7_VREF_3V3 3.3
81#define CURRENT7_VREF_5V 5.0
88#define CURRENT7_SET_DEV_ADDR 0x4D
106#define CURRENT7_MAP_MIKROBUS( cfg, mikrobus ) \
107 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
108 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
109 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN )
current7_return_value_t
Current 7 Click return value data.
Definition current7.h:165
@ CURRENT7_OK
Definition current7.h:166
@ CURRENT7_ERROR
Definition current7.h:167
current7_drv_t
Current 7 Click driver selector.
Definition current7.h:119
@ CURRENT7_DRV_SEL_ADC
Definition current7.h:120
@ CURRENT7_DRV_SEL_I2C
Definition current7.h:121
struct current7_s current7_t
Current 7 Click context object.
err_t current7_read_voltage(current7_t *ctx, float *voltage)
Current 7 read voltage level function.
err_t current7_init(current7_t *ctx, current7_cfg_t *cfg)
Current 7 initialization function.
void current7_drv_interface_selection(current7_cfg_t *cfg, current7_drv_t drv_sel)
Current 7 driver interface setup function.
err_t current7_get_current(current7_t *ctx, float *current)
Current 7 get current function.
err_t current7_read_raw_adc(current7_t *ctx, uint16_t *raw_adc)
Current 7 read raw ADC value function.
err_t current7_set_vref(current7_t *ctx, float vref)
Current 7 set vref function.
void current7_cfg_setup(current7_cfg_t *cfg)
Current 7 configuration object setup function.
Current 7 Click configuration object.
Definition current7.h:145
analog_in_resolution_t resolution
Definition current7.h:150
float vref
Definition current7.h:151
uint32_t i2c_speed
Definition current7.h:153
current7_drv_t drv_sel
Definition current7.h:156
pin_name_t scl
Definition current7.h:147
pin_name_t sda
Definition current7.h:148
pin_name_t an
Definition current7.h:146
uint8_t i2c_address
Definition current7.h:154
Current 7 Click context object.
Definition current7.h:130
float vref
Definition current7.h:135
i2c_master_t i2c
Definition current7.h:132
current7_drv_t drv_sel
Definition current7.h:136
uint8_t slave_address
Definition current7.h:134
analog_in_t adc
Definition current7.h:131