28#ifndef HALLCURRENT18_H
29#define HALLCURRENT18_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"
75#define HALLCURRENT18_ADC_RESOLUTION 0x0FFFu
76#define HALLCURRENT18_VREF_3V3 3.3f
77#define HALLCURRENT18_VREF_5V 5.0f
78#define HALLCURRENT18_HALF_SCALE_3V3 1.65f
84#define HALLCURRENT18_SENSITIVITY_MV_A 33.0f
85#define HALLCURRENT18_CONV_TO_MILI 1000.0f
86#define HALLCURRENT18_ADC_NUM_OF_MEASURE 500u
93#define HALLCURRENT18_SET_DEV_ADDR 0x4D
111#define HALLCURRENT18_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 )
err_t hallcurrent18_read_voltage(hallcurrent18_t *ctx, float *voltage)
Hall Current 18 read voltage level function.
err_t hallcurrent18_read_raw_adc(hallcurrent18_t *ctx, uint16_t *raw_adc)
Hall Current 18 read raw ADC value function.
void hallcurrent18_drv_interface_selection(hallcurrent18_cfg_t *cfg, hallcurrent18_drv_t drv_sel)
Hall Current 18 driver interface setup function.
err_t hallcurrent18_init(hallcurrent18_t *ctx, hallcurrent18_cfg_t *cfg)
Hall Current 18 initialization function.
err_t hallcurrent18_default_cfg(hallcurrent18_t *ctx)
Hall Current 18 default configuration function.
err_t hallcurrent18_set_vref(hallcurrent18_t *ctx, float vref)
Hall Current 18 set vref function.
err_t hallcurrent18_set_zero_ref(hallcurrent18_t *ctx)
Hall Current 18 set zero reference function.
err_t hallcurrent18_read_current(hallcurrent18_t *ctx, float *current)
Hall Current 18 get current function.
void hallcurrent18_cfg_setup(hallcurrent18_cfg_t *cfg)
Hall Current 18 configuration object setup function.
hallcurrent18_drv_t
Hall Current 18 Click driver selector.
Definition hallcurrent18.h:124
@ HALLCURRENT18_DRV_SEL_I2C
Definition hallcurrent18.h:126
@ HALLCURRENT18_DRV_SEL_ADC
Definition hallcurrent18.h:125
hallcurrent18_return_value_t
Hall Current 18 Click return value data.
Definition hallcurrent18.h:172
@ HALLCURRENT18_OK
Definition hallcurrent18.h:173
@ HALLCURRENT18_ERROR
Definition hallcurrent18.h:174
Hall Current 18 Click configuration object.
Definition hallcurrent18.h:151
analog_in_resolution_t resolution
Definition hallcurrent18.h:156
float vref
Definition hallcurrent18.h:157
uint32_t i2c_speed
Definition hallcurrent18.h:160
float zero_vref
Definition hallcurrent18.h:158
hallcurrent18_drv_t drv_sel
Definition hallcurrent18.h:163
pin_name_t scl
Definition hallcurrent18.h:153
pin_name_t sda
Definition hallcurrent18.h:154
pin_name_t an
Definition hallcurrent18.h:152
uint8_t i2c_address
Definition hallcurrent18.h:161
Hall Current 18 Click context object.
Definition hallcurrent18.h:135
float vref
Definition hallcurrent18.h:140
float zero_vref
Definition hallcurrent18.h:141
i2c_master_t i2c
Definition hallcurrent18.h:137
hallcurrent18_drv_t drv_sel
Definition hallcurrent18.h:142
uint8_t slave_address
Definition hallcurrent18.h:139
analog_in_t adc
Definition hallcurrent18.h:136