bucknboost 2.0.0.0
bucknboost.h File Reference

This file contains API for Buck n Boost Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  bucknboost_t
 Buck n Boost Click context object. More...
 
struct  bucknboost_cfg_t
 Buck n Boost Click configuration object. More...
 
struct  bucknboost_status_t
 Buck n Boost Click status data structure. More...
 
struct  bucknboost_cfg_buck_t
 Buck n Boost Click buck config data structure. More...
 

Macros

#define BUCKNBOOST_REG_PGOOD1_6   0x00
 Buck n Boost Status Register Map.
 
#define BUCKNBOOST_REG_STATUS   0x01
 
#define BUCKNBOOST_REG_FAULT   0x02
 
#define BUCKNBOOST_REG_STBY_CTRL   0x03
 Buck n Boost Control Register Map.
 
#define BUCKNBOOST_REG_EN   0x04
 
#define BUCKNBOOST_REG_OUT1   0x05
 
#define BUCKNBOOST_REG_OUT2   0x06
 
#define BUCKNBOOST_REG_OUT3   0x07
 
#define BUCKNBOOST_REG_OUT4   0x08
 
#define BUCKNBOOST_REG_OUT5   0x09
 
#define BUCKNBOOST_REG_OUT6   0x0A
 
#define BUCKNBOOST_REG_STBY_OUT1   0x0B
 
#define BUCKNBOOST_REG_STBY_OUT2   0x0C
 
#define BUCKNBOOST_REG_STBY_OUT3   0x0D
 
#define BUCKNBOOST_REG_STBY_OUT4   0x0E
 
#define BUCKNBOOST_REG_STBY_OUT5   0x0F
 
#define BUCKNBOOST_REG_STBY_OUT6   0x10
 
#define BUCKNBOOST_REG_SEQ1   0x11
 
#define BUCKNBOOST_REG_SEQ2   0x12
 
#define BUCKNBOOST_REG_SEQ3   0x13
 
#define BUCKNBOOST_REG_SEQ4   0x14
 
#define BUCKNBOOST_REG_SEQ5   0x15
 
#define BUCKNBOOST_REG_SEQ6   0x16
 
#define BUCKNBOOST_REG_DELAY_CTRL   0x17
 
#define BUCKNBOOST_REG_SS1_2   0x18
 
#define BUCKNBOOST_REG_SS3_4   0x19
 
#define BUCKNBOOST_REG_SS5_6   0x1A
 
#define BUCKNBOOST_REG_ILIMIT_1_2   0x1B
 
#define BUCKNBOOST_REG_ILIMIT_3_4   0x1C
 
#define BUCKNBOOST_REG_ILIMIT_5_6   0x1D
 
#define BUCKNBOOST_REG_STBY_ILIMIT_1_2   0x1E
 
#define BUCKNBOOST_REG_STBY_ILIMIT_3_4   0x1F
 
#define BUCKNBOOST_REG_STBY_ILIMIT_5_6   0x20
 
#define BUCKNBOOST_REG_PORUP_PGOOD_MASK123   0x21
 
#define BUCKNBOOST_REG_PORDN_PGOOD_MASK456   0x22
 
#define BUCKNBOOST_REG_PULLDN1_6   0x23
 
#define BUCKNBOOST_CMD_SAVECONFIG   0x66
 Buck n Boost Command Register Map.
 
#define BUCKNBOOST_CMD_RESET   0x6A
 
#define BUCKNBOOST_CMD_RELOAD   0x6B
 
#define BUCKNBOOST_CMD_REBOOT   0x6C
 
#define BUCKNBOOST_CMD_SEQUENCE   0x6D
 
#define BUCKNBOOST_CURRENT_LIMIT_1100mA   0x0F
 Buck n Boost Current limit setting.
 
#define BUCKNBOOST_CURRENT_LIMIT_1600mA   0x0E
 
#define BUCKNBOOST_CURRENT_LIMIT_2100mA   0x0D
 
#define BUCKNBOOST_CURRENT_LIMIT_2600mA   0x0C
 
#define BUCKNBOOST_CURRENT_LIMIT_3100mA   0x0B
 
#define BUCKNBOOST_CURRENT_LIMIT_3600mA   0x0A
 
#define BUCKNBOOST_CURRENT_LIMIT_4100mA   0x09
 
#define BUCKNBOOST_CURRENT_LIMIT_4600mA   0x08
 
#define BUCKNBOOST_CURRENT_LIMIT_5100mA   0x07
 
#define BUCKNBOOST_CURRENT_LIMIT_5600mA   0x06
 
#define BUCKNBOOST_CURRENT_LIMIT_6100mA   0x05
 
#define BUCKNBOOST_CURRENT_LIMIT_6600mA   0x04
 
#define BUCKNBOOST_CURRENT_LIMIT_7100mA   0x03
 
#define BUCKNBOOST_CURRENT_LIMIT_7600mA   0x02
 
#define BUCKNBOOST_CURRENT_LIMIT_8100mA   0x01
 
#define BUCKNBOOST_CURRENT_LIMIT_8600mA   0x00
 
#define BUCKNBOOST_WAKE_UP   0x00
 Buck n Boost Standby modes setting.
 
#define BUCKNBOOST_STANDBY   0x01
 
#define BUCKNBOOST_ENABLE   0x01
 Buck n Boost Device states setting.
 
#define BUCKNBOOST_DISABLE   0x00
 
#define BUCKNBOOST_NORMAL_MODE_ALL   0x40
 Buck n Boost Standby and Normal Mode setting.
 
#define BUCKNBOOST_OUTPUT_CH_1   0x01
 Buck n Boost Output Channel setting.
 
#define BUCKNBOOST_OUTPUT_CH_2   0x02
 
#define BUCKNBOOST_OUTPUT_CH_3   0x03
 
#define BUCKNBOOST_OUTPUT_CH_4   0x04
 
#define BUCKNBOOST_OUTPUT_CH_5   0x05
 
#define BUCKNBOOST_OUTPUT_CH_6   0x06
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_800mV   0x32
 Buck n Boost Buck Output Voltage setting.
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_850mV   0x31
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_900mV   0x30
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_950mV   0x2F
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1000mV   0x2E
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1050mV   0x2D
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1100mV   0x2C
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1150mV   0x2B
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1200mV   0x2A
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1250mV   0x29
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1300mV   0x28
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1350mV   0x27
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1400mV   0x26
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1450mV   0x25
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1500mV   0x24
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1550mV   0x23
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1600mV   0x22
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1650mV   0x21
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1700mV   0x20
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1750mV   0x1F
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1800mV   0x1E
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1850mV   0x1D
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1900mV   0x1C
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_1950mV   0x1B
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2000mV   0x1A
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2050mV   0x19
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2100mV   0x18
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2150mV   0x17
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2200mV   0x16
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2250mV   0x15
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2300mV   0x14
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2350mV   0x13
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2400mV   0x12
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2450mV   0x11
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2500mV   0x10
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2550mV   0x0F
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2600mV   0x0E
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2650mV   0x0D
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2700mV   0x0C
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2750mV   0x0B
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2800mV   0x0A
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2850mV   0x09
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2900mV   0x08
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_2950mV   0x07
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3000mV   0x06
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3050mV   0x05
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3100mV   0x04
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3150mV   0x03
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3200mV   0x02
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3250mV   0x01
 
#define BUCKNBOOST_BUCK_OUTPUT_VOLTAGE_3300mV   0x00
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_7000mV   0x23
 Buck n Boost Boost Output Voltage setting.
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_7200mV   0x22
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_7400mV   0x21
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_7600mV   0x20
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_7800mV   0x1F
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_8000mV   0x1E
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_8200mV   0x1D
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_8400mV   0x1C
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_8600mV   0x1B
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_8800mV   0x1A
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_9000mV   0x19
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_9200mV   0x18
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_9400mV   0x17
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_9600mV   0x16
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_9800mV   0x15
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_10000mV   0x14
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_10200mV   0x13
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_10400mV   0x12
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_10600mV   0x11
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_10800mV   0x10
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_11000mV   0x0F
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_11200mV   0x0E
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_11400mV   0x0D
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_11600mV   0x0C
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_11800mV   0x0B
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_12000mV   0x0A
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_12200mV   0x09
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_12400mV   0x08
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_12600mV   0x07
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_12800mV   0x06
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_13000mV   0x05
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_13200mV   0x04
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_13400mV   0x03
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_13600mV   0x02
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_13800mV   0x01
 
#define BUCKNBOOST_BOOST_OUTPUT_VOLTAGE_14000mV   0x00
 
#define BUCKNBOOST_PGOOD1_MASK   0x01
 Buck n Boost Power Good status masks.
 
#define BUCKNBOOST_PGOOD2_MASK   0x02
 
#define BUCKNBOOST_PGOOD3_MASK   0x04
 
#define BUCKNBOOST_PGOOD4_MASK   0x08
 
#define BUCKNBOOST_PGOOD5_MASK   0x10
 
#define BUCKNBOOST_PGOOD6_MASK   0x20
 
#define BUCKNBOOST_PGOOD_ALL_MASK   0x3F
 
#define BUCKNBOOST_EEPROM_READY_MASK   0x01
 Buck n Boost EEPROM status masks.
 
#define BUCKNBOOST_EEPROM_CONFIG_MASK   0x02
 
#define BUCKNBOOST_EEPROM_CALIB_MASK   0x04
 
#define BUCKNBOOST_EEPROM_READ_MASK   0x40
 
#define BUCKNBOOST_EEPROM_WRITE_MASK   0x80
 
#define BUCKNBOOST_EEPROM_ALL_MASK   0xC7
 
#define BUCKNBOOST_FAULT_REG1OC_MASK   0x01
 Buck n Boost Overcurrent status fault masks.
 
#define BUCKNBOOST_FAULT_REG2OC_MASK   0x02
 
#define BUCKNBOOST_FAULT_REG3OC_MASK   0x04
 
#define BUCKNBOOST_FAULT_REG4OC_MASK   0x08
 
#define BUCKNBOOST_FAULT_REG5OC_MASK   0x10
 
#define BUCKNBOOST_FAULT_REG6OC_MASK   0x20
 
#define BUCKNBOOST_FAULT_OT_MASK   0x80
 
#define BUCKNBOOST_FAULT_ALL_MASK   0xBF
 
#define BUCKNBOOST_DEV_ADDR   0x30
 Buck n Boost device address setting.
 
#define BUCKNBOOST_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  bucknboost_return_value_t { BUCKNBOOST_OK = 0 , BUCKNBOOST_ERROR = -1 }
 Buck n Boost Click return value data. More...
 

Functions

void bucknboost_cfg_setup (bucknboost_cfg_t *cfg)
 Buck n Boost configuration object setup function.
 
err_t bucknboost_init (bucknboost_t *ctx, bucknboost_cfg_t *cfg)
 Buck n Boost initialization function.
 
err_t bucknboost_default_cfg (bucknboost_t *ctx)
 Buck n Boost default configuration function.
 
err_t bucknboost_generic_write (bucknboost_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Buck n Boost I2C writing function.
 
err_t bucknboost_generic_read (bucknboost_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Buck n Boost I2C reading function.
 
err_t bucknboost_send_cmd (bucknboost_t *ctx, uint8_t cmd)
 Buck n Boost send command function.
 
err_t bucknboost_write_byte (bucknboost_t *ctx, uint8_t reg, uint8_t data_in)
 Buck n Boost Write single byte function.
 
err_t bucknboost_read_byte (bucknboost_t *ctx, uint8_t reg, uint8_t *data_out)
 Buck n Boost read single byte function.
 
void bucknboost_pin_standby_mode (bucknboost_t *ctx, uint8_t state)
 Buck n Boost set STB pin mode function.
 
err_t bucknboost_reg_standby_mode (bucknboost_t *ctx, uint8_t state)
 Buck n Boost set standby mode function.
 
void bucknboost_device_enable (bucknboost_t *ctx, uint8_t state)
 Buck n Boost enable device function.
 
uint8_t bucknboost_check_power_good (bucknboost_t *ctx)
 Buck n Boost check power good function.
 
uint8_t bucknboost_check_por (bucknboost_t *ctx)
 Buck n Boost check power on reset function.
 
err_t bucknboost_read_oc_fault (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost read overcurrent fault function.
 
err_t bucknboost_set_buck_out_voltage (bucknboost_t *ctx, uint8_t ch_num, uint8_t data_in)
 Buck n Boost set buck output voltage function.
 
err_t bucknboost_set_all_buck_out_voltage (bucknboost_t *ctx, uint8_t data_in)
 Buck n Boost set all bucks output voltage function.
 
err_t bucknboost_set_boost_out_voltage (bucknboost_t *ctx, uint8_t data_in)
 Buck n Boost set boost output voltage function.
 
err_t bucknboost_get_status (bucknboost_t *ctx, bucknboost_status_t *st_data)
 Buck n Boost get status data function.
 
err_t bucknboost_update_cfg_out (bucknboost_t *ctx, uint8_t ch_num, bucknboost_cfg_buck_t b_data)
 Buck n Boost update configuration of the output registers function.
 
err_t bucknboost_get_power_good_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get power good status function.
 
err_t bucknboost_check_power_good_status (bucknboost_t *ctx, uint8_t ch_num, uint8_t *data_out)
 Buck n Boost check power good status function.
 
err_t bucknboost_get_eeprom_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get eeprom status function.
 
err_t bucknboost_get_overcurrent_fault_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get overcurrent fault status function.
 
err_t bucknboost_check_overc_fault_status (bucknboost_t *ctx, uint8_t ch_num, uint8_t *data_out)
 Buck n Boost check overcurrent fault status function.
 

Detailed Description

This file contains API for Buck n Boost Click Driver.

Enumeration Type Documentation

◆ bucknboost_return_value_t

Buck n Boost Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCKNBOOST_OK 
BUCKNBOOST_ERROR