Go to the documentation of this file.
35 #ifndef HALLCURRENT4_H
36 #define HALLCURRENT4_H
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_i2c_master.h"
53 #define HALLCURRENT4_MAP_MIKROBUS( cfg, mikrobus ) \
54 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
55 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
62 #define HALLCURRENT4_RETVAL uint8_t
64 #define HALLCURRENT4_OK 0x00
65 #define HALLCURRENT4_INIT_ERROR 0xFF
72 #define HALLCURRENT4_DEVICE_SLAVE_ADDRESS 0x4D
194 #endif // _HALLCURRENT4_H_
float hallcurrent4_get_current_data(hallcurrent4_t *ctx)
Reads current in mA.
#define HALLCURRENT4_RETVAL
Definition: hallcurrent4.h:62
uint8_t slave_address
Definition: hallcurrent4.h:93
void hallcurrent4_cfg_setup(hallcurrent4_cfg_t *cfg)
Config Object Initialization function.
uint32_t i2c_speed
Definition: hallcurrent4.h:109
pin_name_t scl
Definition: hallcurrent4.h:104
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:110
i2c_master_t i2c
Definition: hallcurrent4.h:89
pin_name_t sda
Definition: hallcurrent4.h:105
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:100
uint16_t hallcurrent4_get_raw_data(hallcurrent4_t *ctx)
Reads raw (ADC) current data.
Click ctx object definition.
Definition: hallcurrent4.h:85