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 AMRCURENT_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
76#define AMRCURENT_RETVAL uint8_t
78#define AMRCURENT_OK 0x00
79#define AMRCURENT_INIT_ERROR 0xFF
86#define AMRCURRENT_PIN_STATE_HIGH 1
87#define AMRCURRENT_PIN_STATE_LOW 0
#define AMRCURENT_RETVAL
Definition amrcurrent.h:76
void amrcurrent_set_rst_pin_state(amrcurent_t *ctx, uint8_t pin_state)
Sets state of the reset pin.
void amrcurent_generic_read(amrcurent_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
float amrcurrent_get_current(amrcurent_t *ctx)
Reads current data in mA.
void amrcurent_cfg_setup(amrcurent_cfg_t *cfg)
Config Object Initialization function.
void amrcurrent_hw_reset(amrcurent_t *ctx)
Hardware reset device.
uint8_t amrcurrent_get_int_pin_state(amrcurent_t *ctx)
Gets state of the FLTB pin on int.
uint16_t amrcurrent_read_value(amrcurent_t *ctx)
Reads ADC current data.
AMRCURENT_RETVAL amrcurent_init(amrcurent_t *ctx, amrcurent_cfg_t *cfg)
Initialization function.
void amrcurent_default_cfg(amrcurent_t *ctx)
Click Default Configuration function.
void amrcurent_generic_write(amrcurent_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition amrcurrent.h:125
uint32_t i2c_speed
Definition amrcurrent.h:139
pin_name_t flt
Definition amrcurrent.h:135
pin_name_t scl
Definition amrcurrent.h:128
pin_name_t sda
Definition amrcurrent.h:129
pin_name_t an
Definition amrcurrent.h:133
pin_name_t voc
Definition amrcurrent.h:134
uint8_t i2c_address
Definition amrcurrent.h:140
Click ctx object definition.
Definition amrcurrent.h:101
digital_out_t voc
Definition amrcurrent.h:104
digital_in_t flt
Definition amrcurrent.h:109
i2c_master_t i2c
Definition amrcurrent.h:113
digital_in_t an
Definition amrcurrent.h:108
uint8_t slave_address
Definition amrcurrent.h:117