28#ifndef HALLCURRENT13_H
29#define HALLCURRENT13_H
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 HALLCURRENT13_SENSITIVITY_V_TO_A 0.1
75#define HALLCURRENT13_ZERO_CURRENT_OFFSET 0.1
76#define HALLCURRENT13_NUM_CONVERSIONS 100
82#define HALLCURRENT13_ADC_RESOLUTION 0x0FFF
83#define HALLCURRENT13_VREF_3V3 3.3
84#define HALLCURRENT13_VREF_5V 5.0
91#define HALLCURRENT13_SET_DEV_ADDR 0x4D
109#define HALLCURRENT13_MAP_MIKROBUS( cfg, mikrobus ) \
110 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
111 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
112 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
err_t hallcurrent13_read_raw_adc(hallcurrent13_t *ctx, uint16_t *raw_adc)
Hall Current 13 read raw ADC value function.
err_t hallcurrent13_read_current(hallcurrent13_t *ctx, float *current)
Hall Current 13 read current function.
void hallcurrent13_drv_interface_selection(hallcurrent13_cfg_t *cfg, hallcurrent13_drv_t drv_sel)
Hall Current 13 driver interface setup function.
err_t hallcurrent13_set_vref(hallcurrent13_t *ctx, float vref)
Hall Current 13 set vref function.
void hallcurrent13_cfg_setup(hallcurrent13_cfg_t *cfg)
Hall Current 13 configuration object setup function.
err_t hallcurrent13_init(hallcurrent13_t *ctx, hallcurrent13_cfg_t *cfg)
Hall Current 13 initialization function.
err_t hallcurrent13_read_voltage(hallcurrent13_t *ctx, float *voltage)
Hall Current 13 read voltage level function.
hallcurrent13_return_value_t
Hall Current 13 Click return value data.
Definition hallcurrent13.h:169
@ HALLCURRENT13_OK
Definition hallcurrent13.h:170
@ HALLCURRENT13_ERROR
Definition hallcurrent13.h:171
hallcurrent13_drv_t
Hall Current 13 Click driver selector.
Definition hallcurrent13.h:122
@ HALLCURRENT13_DRV_SEL_I2C
Definition hallcurrent13.h:124
@ HALLCURRENT13_DRV_SEL_ADC
Definition hallcurrent13.h:123
Hall Current 13 Click configuration object.
Definition hallcurrent13.h:149
analog_in_resolution_t resolution
Definition hallcurrent13.h:154
float vref
Definition hallcurrent13.h:155
uint32_t i2c_speed
Definition hallcurrent13.h:157
pin_name_t scl
Definition hallcurrent13.h:151
hallcurrent13_drv_t drv_sel
Definition hallcurrent13.h:160
pin_name_t sda
Definition hallcurrent13.h:152
pin_name_t an
Definition hallcurrent13.h:150
uint8_t i2c_address
Definition hallcurrent13.h:158
Hall Current 13 Click context object.
Definition hallcurrent13.h:133
float vref
Definition hallcurrent13.h:139
i2c_master_t i2c
Definition hallcurrent13.h:135
uint8_t slave_address
Definition hallcurrent13.h:137
hallcurrent13_drv_t drv_sel
Definition hallcurrent13.h:140
pin_name_t chip_select
Definition hallcurrent13.h:138
analog_in_t adc
Definition hallcurrent13.h:134