28#ifndef HALLCURRENT12_H
29#define HALLCURRENT12_H
39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_i2c_master.h"
50#include "drv_analog_in.h"
68#define HALLCURRENT12_SET_DEV_ADDR 0x4D
86#define HALLCURRENT12_MAP_MIKROBUS( cfg, mikrobus ) \
87 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
88 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
89 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN )
err_t hallcurrent12_init(hallcurrent12_t *ctx, hallcurrent12_cfg_t *cfg)
Hall Current 12 initialization function.
err_t hallcurrent12_get_adc(hallcurrent12_t *ctx, float *adc_vtg)
Hall Current 12 get ADC function.
err_t hallcurrent12_get_pin_voltage(hallcurrent12_t *ctx, float *adc_vtg)
Hall Current 12 read AN pin voltage level function.
err_t hallcurrent12_calibration(hallcurrent12_t *ctx)
Hall Current 12 calibration function.
err_t hallcurrent12_get_adc_voltage(hallcurrent12_t *ctx, float *adc_vtg)
Hall Current 12 get ADC voltage function.
err_t hallcurrent12_get_current(hallcurrent12_t *ctx, float *current)
Hall Current 12 get current function.
void hallcurrent12_cfg_setup(hallcurrent12_cfg_t *cfg)
Hall Current 12 configuration object setup function.
struct hallcurrent12_s hallcurrent12_t
Hall Current 12 Click context object.
hallcurrent12_return_value_t
Hall Current 12 Click return value data.
Definition hallcurrent12.h:157
@ HALLCURRENT12_ERROR
Definition hallcurrent12.h:159
@ HALLCURRENT12_OK
Definition hallcurrent12.h:158
err_t(* hallcurrent12_master_io_t)(struct hallcurrent12_s *, float *)
Hall Current 12 Click driver interface.
Definition hallcurrent12.h:109
hallcurrent12_drv_t
Hall Current 12 Click driver selector.
Definition hallcurrent12.h:99
@ HALLCURRENT12_DRV_SEL_I2C
Definition hallcurrent12.h:101
@ HALLCURRENT12_DRV_SEL_AN
Definition hallcurrent12.h:100
Hall Current 12 Click configuration object.
Definition hallcurrent12.h:136
analog_in_resolution_t resolution
Definition hallcurrent12.h:139
float vref
Definition hallcurrent12.h:140
hallcurrent12_drv_t drv_sel
Definition hallcurrent12.h:148
uint32_t i2c_speed
Definition hallcurrent12.h:145
pin_name_t scl
Definition hallcurrent12.h:142
pin_name_t sda
Definition hallcurrent12.h:143
pin_name_t an
Definition hallcurrent12.h:137
uint8_t i2c_address
Definition hallcurrent12.h:146
Hall Current 12 Click context object.
Definition hallcurrent12.h:116
float offset
Definition hallcurrent12.h:127
hallcurrent12_drv_t drv_sel
Definition hallcurrent12.h:123
hallcurrent12_master_io_t read_adc_f
Definition hallcurrent12.h:125
i2c_master_t i2c
Definition hallcurrent12.h:119
uint8_t slave_address
Definition hallcurrent12.h:121
analog_in_t adc
Definition hallcurrent12.h:117