42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define HALLCURRENT2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
77#define HALLCURRENT2_RETVAL uint8_t
79#define HALLCURRENT2_OK 0x00
80#define HALLCURRENT2_INIT_ERROR 0xFF
void hallcurrent2_reset(hallcurrent2_t *ctx)
Functions for reset chip.
int16_t hallcurrent2_get_current(hallcurrent2_t *ctx)
Reads current in mV.
#define HALLCURRENT2_RETVAL
Definition hallcurrent2.h:77
HALLCURRENT2_RETVAL hallcurrent2_init(hallcurrent2_t *ctx, hallcurrent2_cfg_t *cfg)
Initialization function.
uint16_t hallcurrent2_generic_read(hallcurrent2_t *ctx)
Generic read function.
void hallcurrent2_cfg_setup(hallcurrent2_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition hallcurrent2.h:117
uint32_t i2c_speed
Definition hallcurrent2.h:130
pin_name_t scl
Definition hallcurrent2.h:120
pin_name_t int_pin
Definition hallcurrent2.h:126
pin_name_t sda
Definition hallcurrent2.h:121
pin_name_t rst
Definition hallcurrent2.h:125
uint8_t i2c_address
Definition hallcurrent2.h:131
Click ctx object definition.
Definition hallcurrent2.h:94
digital_in_t int_pin
Definition hallcurrent2.h:101
i2c_master_t i2c
Definition hallcurrent2.h:105
digital_out_t rst
Definition hallcurrent2.h:97
uint8_t slave_address
Definition hallcurrent2.h:109