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_analog_in.h"
52#include "drv_i2c_master.h"
74#define CURRENT9_SENSITIVITY_V_TO_A 0.1333
75#define CURRENT9_ZERO_CURRENT_OFFSET 0.500
76#define CURRENT9_NUM_CONVERSIONS 200
77#define CURRENT9_SENSOR_OUT_DIVIDER_2 2.0
78#define CURRENT9_90PCT_VCC 4.5
84#define CURRENT9_ADC_RESOLUTION 0x0FFF
85#define CURRENT9_VREF_3V3 3.3
86#define CURRENT9_VREF_5V 5.0
93#define CURRENT9_SET_DEV_ADDR 0x4D
111#define CURRENT9_MAP_MIKROBUS( cfg, mikrobus ) \
112 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
113 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
114 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
current9_drv_t
Current 9 Click driver selector.
Definition current9.h:124
@ CURRENT9_DRV_SEL_I2C
Definition current9.h:126
@ CURRENT9_DRV_SEL_ADC
Definition current9.h:125
current9_return_value_t
Current 9 Click return value data.
Definition current9.h:171
@ CURRENT9_ERROR
Definition current9.h:173
@ CURRENT9_OK
Definition current9.h:172
void current9_cfg_setup(current9_cfg_t *cfg)
Current 9 configuration object setup function.
err_t current9_init(current9_t *ctx, current9_cfg_t *cfg)
Current 9 initialization function.
err_t current9_set_vref(current9_t *ctx, float vref)
Current 9 set vref function.
err_t current9_read_current(current9_t *ctx, float *current)
Current 9 read current function.
err_t current9_read_raw_adc(current9_t *ctx, uint16_t *raw_adc)
Current 9 read raw ADC value function.
void current9_drv_interface_selection(current9_cfg_t *cfg, current9_drv_t drv_sel)
Current 9 driver interface setup function.
err_t current9_read_voltage(current9_t *ctx, float *voltage)
Current 9 read voltage level function.
Current 9 Click configuration object.
Definition current9.h:151
analog_in_resolution_t resolution
Definition current9.h:156
float vref
Definition current9.h:157
uint32_t i2c_speed
Definition current9.h:159
pin_name_t scl
Definition current9.h:153
pin_name_t sda
Definition current9.h:154
pin_name_t an
Definition current9.h:152
current9_drv_t drv_sel
Definition current9.h:162
uint8_t i2c_address
Definition current9.h:160
Current 9 Click context object.
Definition current9.h:135
float vref
Definition current9.h:141
i2c_master_t i2c
Definition current9.h:137
uint8_t slave_address
Definition current9.h:139
pin_name_t chip_select
Definition current9.h:140
analog_in_t adc
Definition current9.h:136
current9_drv_t drv_sel
Definition current9.h:142