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 BOOSTINV3_REG_P_OUT_VOLTAGE 0x00
74#define BOOSTINV3_REG_N_OUT_VOLTAGE 0x01
75#define BOOSTINV3_REG_CONFIG 0x03
76#define BOOSTINV3_REG_CONTROL 0xFF
95#define BOOSTINV3_APPS_VALUE_40_MA 0x00
96#define BOOSTINV3_APPS_VALUE_80_MA 0x40
97#define BOOSTINV3_VPOS_NO_DISCHARGE 0x00
98#define BOOSTINV3_VPOS_DISCHARGE_EN 0x02
99#define BOOSTINV3_VPON_NO_DISCHARGE 0x00
100#define BOOSTINV3_VPON_DISCHARGE_EN 0x01
106#define BOOSTINV3_PIN_STATE_LOW 0x00
107#define BOOSTINV3_PIN_STATE_HIGH 0x01
113#define BOOSTINV3_OUT_VOLTAGE_4V 0x00
114#define BOOSTINV3_OUT_VOLTAGE_4V1 0x01
115#define BOOSTINV3_OUT_VOLTAGE_4V2 0x02
116#define BOOSTINV3_OUT_VOLTAGE_4V3 0x03
117#define BOOSTINV3_OUT_VOLTAGE_4V4 0x04
118#define BOOSTINV3_OUT_VOLTAGE_4V5 0x05
119#define BOOSTINV3_OUT_VOLTAGE_4V6 0x06
120#define BOOSTINV3_OUT_VOLTAGE_4V7 0x07
121#define BOOSTINV3_OUT_VOLTAGE_4V8 0x08
122#define BOOSTINV3_OUT_VOLTAGE_4V9 0x09
123#define BOOSTINV3_OUT_VOLTAGE_5V 0x0A
124#define BOOSTINV3_OUT_VOLTAGE_5V1 0x0B
125#define BOOSTINV3_OUT_VOLTAGE_5V2 0x0C
126#define BOOSTINV3_OUT_VOLTAGE_5V3 0x0D
127#define BOOSTINV3_OUT_VOLTAGE_5V4 0x0E
128#define BOOSTINV3_OUT_VOLTAGE_5V5 0x0F
129#define BOOSTINV3_OUT_VOLTAGE_5V6 0x10
130#define BOOSTINV3_OUT_VOLTAGE_5V7 0x11
131#define BOOSTINV3_OUT_VOLTAGE_5V8 0x12
132#define BOOSTINV3_OUT_VOLTAGE_5V9 0x13
133#define BOOSTINV3_OUT_VOLTAGE_6V 0x14
139#define BOOSTINV3_CMD_WRITE_EEPROM 0x80
140#define BOOSTINV3_CMD_READ_EEPROM 0x01
141#define BOOSTINV3_CMD_READ_REG 0x00
148#define BOOSTINV3_DEVICE_ADDRESS 0x3E
166#define BOOSTINV3_MAP_MIKROBUS( cfg, mikrobus ) \
167 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
168 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
169 cfg.enp = MIKROBUS( mikrobus, MIKROBUS_RST ); \
170 cfg.enn = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
boostinv3_return_value_t
Boost-INV 3 Click return value data.
Definition boostinv3.h:215
@ BOOSTINV3_ERROR
Definition boostinv3.h:217
@ BOOSTINV3_OK
Definition boostinv3.h:216
void boostinv3_cfg_setup(boostinv3_cfg_t *cfg)
Boost-INV 3 configuration object setup function.
err_t boostinv3_init(boostinv3_t *ctx, boostinv3_cfg_t *cfg)
Boost-INV 3 initialization function.
err_t boostinv3_set_pos_out(boostinv3_t *ctx, uint8_t out_val)
Boost-INV 3 set positive output voltage function.
err_t boostinv3_set_neg_out(boostinv3_t *ctx, uint8_t out_val)
Boost-INV 3 set negative output voltage function.
err_t boostinv3_write_reg(boostinv3_t *ctx, uint8_t reg, uint8_t data_in)
Boost-INV 3 register write function.
void boostinv3_set_enp(boostinv3_t *ctx, uint8_t out_state)
Boost-INV 3 set ENP pin state function.
err_t boostinv3_generic_write(boostinv3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Boost-INV 3 I2C writing function.
void boostinv3_set_enn(boostinv3_t *ctx, uint8_t out_state)
Boost-INV 3 set ENN pin state function.
err_t boostinv3_generic_read(boostinv3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Boost-INV 3 I2C reading function.
err_t boostinv3_default_cfg(boostinv3_t *ctx)
Boost-INV 3 default configuration function.
Boost-INV 3 Click configuration object.
Definition boostinv3.h:198
pin_name_t enn
Definition boostinv3.h:203
uint32_t i2c_speed
Definition boostinv3.h:205
pin_name_t enp
Definition boostinv3.h:202
pin_name_t scl
Definition boostinv3.h:199
pin_name_t sda
Definition boostinv3.h:200
uint8_t i2c_address
Definition boostinv3.h:206
Boost-INV 3 Click context object.
Definition boostinv3.h:180
digital_out_t enp
Definition boostinv3.h:182
i2c_master_t i2c
Definition boostinv3.h:186
uint8_t slave_address
Definition boostinv3.h:189
digital_out_t enn
Definition boostinv3.h:183