28#ifndef HALLCURRENT15_H
29#define HALLCURRENT15_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 HALLCURRENT15_REG_CONVERSION_RESULT 0x00
75#define HALLCURRENT15_REG_ALERT_STATUS 0x01
76#define HALLCURRENT15_REG_CONFIGURATION 0x02
77#define HALLCURRENT15_REG_LOW_LIMIT 0x03
78#define HALLCURRENT15_REG_HIGH_LIMIT 0x04
79#define HALLCURRENT15_REG_HYSTERESIS 0x05
80#define HALLCURRENT15_REG_LOWEST_CONVERSION 0x06
81#define HALLCURRENT15_REG_HIGHEST_CONVERSION 0x07
99#define HALLCURRENT15_SENSITIVITY_V_TO_A 0.05
100#define HALLCURRENT15_ZERO_CURRENT_OFFSET 0.1
101#define HALLCURRENT15_NUM_CONVERSIONS 1000
107#define HALLCURRENT15_ADC_RESOLUTION 0x03FF
108#define HALLCURRENT15_VREF_3V3 3.3
109#define HALLCURRENT15_VREF_5V 5.0
116#define HALLCURRENT15_SET_DEV_ADDR 0x54
134#define HALLCURRENT15_MAP_MIKROBUS( cfg, mikrobus ) \
135 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
136 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
137 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
138 cfg.alr = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t hallcurrent15_read_current(hallcurrent15_t *ctx, float *current)
Hall Current 15 read current function.
void hallcurrent15_drv_interface_selection(hallcurrent15_cfg_t *cfg, hallcurrent15_drv_t drv_sel)
Hall Current 15 driver interface setup function.
err_t hallcurrent15_write_register(hallcurrent15_t *ctx, uint8_t reg, uint16_t data_in)
Hall Current 15 write register function.
void hallcurrent15_cfg_setup(hallcurrent15_cfg_t *cfg)
Hall Current 15 configuration object setup function.
uint8_t hallcurrent15_get_alert_pin(hallcurrent15_t *ctx)
Hall Current 15 get alert pin function.
err_t hallcurrent15_read_register(hallcurrent15_t *ctx, uint8_t reg, uint16_t *data_out)
Hall Current 15 read register function.
err_t hallcurrent15_set_vref(hallcurrent15_t *ctx, float vref)
Hall Current 15 set vref function.
err_t hallcurrent15_read_voltage(hallcurrent15_t *ctx, float *voltage)
Hall Current 15 read voltage level function.
err_t hallcurrent15_read_raw_adc(hallcurrent15_t *ctx, uint16_t *raw_adc)
Hall Current 15 read raw ADC value function.
err_t hallcurrent15_init(hallcurrent15_t *ctx, hallcurrent15_cfg_t *cfg)
Hall Current 15 initialization function.
hallcurrent15_drv_t
Hall Current 15 Click driver selector.
Definition hallcurrent15.h:148
@ HALLCURRENT15_DRV_SEL_I2C
Definition hallcurrent15.h:150
@ HALLCURRENT15_DRV_SEL_ADC
Definition hallcurrent15.h:149
hallcurrent15_return_value_t
Hall Current 15 Click return value data.
Definition hallcurrent15.h:198
@ HALLCURRENT15_OK
Definition hallcurrent15.h:199
@ HALLCURRENT15_ERROR
Definition hallcurrent15.h:200
Hall Current 15 Click configuration object.
Definition hallcurrent15.h:177
analog_in_resolution_t resolution
Definition hallcurrent15.h:183
float vref
Definition hallcurrent15.h:184
pin_name_t alr
Definition hallcurrent15.h:181
uint32_t i2c_speed
Definition hallcurrent15.h:186
hallcurrent15_drv_t drv_sel
Definition hallcurrent15.h:189
pin_name_t scl
Definition hallcurrent15.h:179
pin_name_t sda
Definition hallcurrent15.h:180
pin_name_t an
Definition hallcurrent15.h:178
uint8_t i2c_address
Definition hallcurrent15.h:187
Hall Current 15 Click context object.
Definition hallcurrent15.h:159
digital_in_t alr
Definition hallcurrent15.h:160
float vref
Definition hallcurrent15.h:167
hallcurrent15_drv_t drv_sel
Definition hallcurrent15.h:168
i2c_master_t i2c
Definition hallcurrent15.h:163
uint8_t slave_address
Definition hallcurrent15.h:165
pin_name_t chip_select
Definition hallcurrent15.h:166
analog_in_t adc
Definition hallcurrent15.h:162