Go to the documentation of this file.
35 #ifndef HALLCURRENT4_H
36 #define HALLCURRENT4_H
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"
67 #define HALLCURRENT4_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
76 #define HALLCURRENT4_RETVAL uint8_t
78 #define HALLCURRENT4_OK 0x00
79 #define HALLCURRENT4_INIT_ERROR 0xFF
86 #define HALLCURRENT4_DEVICE_SLAVE_ADDRESS 0x4D
208 #endif // _HALLCURRENT4_H_
float hallcurrent4_get_current_data(hallcurrent4_t *ctx)
Reads current in mA.
#define HALLCURRENT4_RETVAL
Definition: hallcurrent4.h:76
uint8_t slave_address
Definition: hallcurrent4.h:107
void hallcurrent4_cfg_setup(hallcurrent4_cfg_t *cfg)
Config Object Initialization function.
uint32_t i2c_speed
Definition: hallcurrent4.h:123
pin_name_t scl
Definition: hallcurrent4.h:118
void hallcurrent4_generic_read(hallcurrent4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
uint8_t i2c_address
Definition: hallcurrent4.h:124
i2c_master_t i2c
Definition: hallcurrent4.h:103
pin_name_t sda
Definition: hallcurrent4.h:119
HALLCURRENT4_RETVAL hallcurrent4_init(hallcurrent4_t *ctx, hallcurrent4_cfg_t *cfg)
Initialization function.
void hallcurrent4_generic_write(hallcurrent4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition: hallcurrent4.h:115
uint16_t hallcurrent4_get_raw_data(hallcurrent4_t *ctx)
Reads raw (ADC) current data.
Click ctx object definition.
Definition: hallcurrent4.h:100