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_i2c_master.h"
73#define BATTMON4_REG_A 0x01
74#define BATTMON4_REG_B 0x02
75#define BATTMON4_REG_C 0x03
76#define BATTMON4_REG_D 0x04
77#define BATTMON4_REG_E 0x05
78#define BATTMON4_REG_F 0x06
79#define BATTMON4_REG_G 0x07
80#define BATTMON4_REG_H 0x08
98#define BATTMON4_TEMPERATURE_LSB 0.784
99#define BATTMON4_TEMPERATURE_OFFSET 41.0
100#define BATTMON4_TEMPERATURE_RESOLUTION 0x00FF
101#define BATTMON4_VOLTAGE_LSB 1.465
102#define BATTMON4_VOLTAGE_RESOLUTION 0x0FFF
109#define BATTMON4_DEVICE_ADDRESS 0x64
127#define BATTMON4_MAP_MIKROBUS( cfg, mikrobus ) \
128 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
129 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
130 cfg.bok = MIKROBUS( mikrobus, MIKROBUS_AN ); \
131 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
battmon4_return_value_t
BATT-MON 4 Click return value data.
Definition battmon4.h:176
@ BATTMON4_ERROR
Definition battmon4.h:178
@ BATTMON4_OK
Definition battmon4.h:177
uint8_t battmon4_get_int_pin(battmon4_t *ctx)
BATT-MON 4 get int pin function.
err_t battmon4_read_register(battmon4_t *ctx, uint8_t reg, uint16_t *data_out)
BATT-MON 4 read register function.
err_t battmon4_get_batt_in_voltage(battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off)
BATT-MON 4 get batt in voltage function.
err_t battmon4_init(battmon4_t *ctx, battmon4_cfg_t *cfg)
BATT-MON 4 initialization function.
err_t battmon4_write_register(battmon4_t *ctx, uint8_t reg, uint16_t data_in)
BATT-MON 4 write register function.
void battmon4_cfg_setup(battmon4_cfg_t *cfg)
BATT-MON 4 configuration object setup function.
err_t battmon4_get_batt_out_voltage(battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off)
BATT-MON 4 get batt out voltage function.
err_t battmon4_get_die_temperature(battmon4_t *ctx, float *temperature)
BATT-MON 4 get die temperature function.
uint8_t battmon4_get_bok_pin(battmon4_t *ctx)
BATT-MON 4 get bok pin function.
BATT-MON 4 Click configuration object.
Definition battmon4.h:159
uint32_t i2c_speed
Definition battmon4.h:166
pin_name_t scl
Definition battmon4.h:160
pin_name_t int_pin
Definition battmon4.h:164
pin_name_t bok
Definition battmon4.h:163
pin_name_t sda
Definition battmon4.h:161
uint8_t i2c_address
Definition battmon4.h:167
BATT-MON 4 Click context object.
Definition battmon4.h:141
digital_in_t bok
Definition battmon4.h:143
digital_in_t int_pin
Definition battmon4.h:144
i2c_master_t i2c
Definition battmon4.h:147
uint8_t slave_address
Definition battmon4.h:150