buckboost4 2.1.0.0
buckboost4.h File Reference

This file contains API for Buck-Boost 4 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  buckboost4_t
 Buck-Boost 4 Click context object. More...
 
struct  buckboost4_cfg_t
 Buck-Boost 4 Click configuration object. More...
 

Macros

#define BUCKBOOST4_REG_REF_MSB   0x00
 Buck-Boost 4 description register.
 
#define BUCKBOOST4_REG_REF_LSB   0x01
 
#define BUCKBOOST4_REG_IOUT_LIMIT   0x02
 
#define BUCKBOOST4_REG_VOUT_SR   0x03
 
#define BUCKBOOST4_REG_VOUT_FS   0x04
 
#define BUCKBOOST4_REG_CDC   0x05
 
#define BUCKBOOST4_REG_MODE   0x06
 
#define BUCKBOOST4_REG_STATUS   0x07
 
#define BUCKBOOST4_VREF_MV_MIN   45.0f
 Buck-Boost 4 internal reference voltage data values.
 
#define BUCKBOOST4_VREF_MV_MAX   1200.0f
 
#define BUCKBOOST4_VREF_MV_STEP   0.5645f
 
#define BUCKBOOST4_IOUT_LIMIT_CT_DIS   0x00
 Buck-Boost 4 current limit target voltage data values.
 
#define BUCKBOOST4_IOUT_LIMIT_CT_EN   0x01
 
#define BUCKBOOST4_IOUT_LIMIT_CLTV_MIN   0.0f
 
#define BUCKBOOST4_IOUT_LIMIT_CLTV_MAX   63.5f
 
#define BUCKBOOST4_IOUT_LIMIT_CLTV_STEP   0.5f
 
#define BUCKBOOST4_VOUT_SR_OCP_DELAY_128_US   0x00
 Buck-Boost 4 overcurrent response time data values.
 
#define BUCKBOOST4_VOUT_SR_OCP_DELAY_3_S   0x01
 
#define BUCKBOOST4_VOUT_SR_OCP_DELAY_6_S   0x02
 
#define BUCKBOOST4_VOUT_SR_OCP_DELAY_12_S   0x03
 
#define BUCKBOOST4_VOUT_SR_OCP_DELAY_BIT_MASK   0xCF
 
#define BUCKBOOST4_VOUT_SR_SR_MV_US_1_25   0x00
 Buck-Boost 4 slew rate for output voltage change data values.
 
#define BUCKBOOST4_VOUT_SR_SR_MV_US_2_5   0x01
 
#define BUCKBOOST4_VOUT_SR_SR_MV_US_5   0x02
 
#define BUCKBOOST4_VOUT_SR_SR_MV_US_10   0x03
 
#define BUCKBOOST4_VOUT_SR_SR_BIT_MASK   0xFC
 
#define BUCKBOOST4_VOUT_FS_FB_EXT   0x80
 Buck-Boost 4 output feedback voltage and ratio data values.
 
#define BUCKBOOST4_VOUT_FS_INTFB_0_2256   0x00
 
#define BUCKBOOST4_VOUT_FS_INTFB_0_1128   0x01
 
#define BUCKBOOST4_VOUT_FS_INTFB_0_0752   0x02
 
#define BUCKBOOST4_VOUT_FS_INTFB_0_0564   0x03
 
#define BUCKBOOST4_VOUT_FS_INTFB_BIT_MASK   0xFC
 
#define BUCKBOOST4_MODE_OE_EN   0x80
 Buck-Boost 4 mode configuration data values.
 
#define BUCKBOOST4_MODE_FSWDBL_DIS   0x00
 
#define BUCKBOOST4_MODE_FSWDBL_EN   0x01
 
#define BUCKBOOST4_MODE_HICCUP_DIS   0x00
 
#define BUCKBOOST4_MODE_HICCUP_EN   0x01
 
#define BUCKBOOST4_MODE_DISCHG_DIS   0x00
 
#define BUCKBOOST4_MODE_DISCHG_EN   0x01
 
#define BUCKBOOST4_MODE_FPWM_DIS   0x00
 
#define BUCKBOOST4_MODE_FPWM_EN   0x01
 
#define BUCKBOOST4_MODE_BIT_MASK   0x8D
 
#define BUCKBOOST4_VOUT_LIM_MIN   0.8f
 Buck-Boost 4 output voltage limits data values.
 
#define BUCKBOOST4_VOUT_LIM_5_V   5.0f
 
#define BUCKBOOST4_VOUT_LIM_10_V   10.0f
 
#define BUCKBOOST4_VOUT_LIM_15_V   15.0f
 
#define BUCKBOOST4_VOUT_LIM_20_V   20.0f
 
#define BUCKBOOST4_VOUT_LIM_MAX   21.286f
 
#define BUCKBOOST4_INTFB_STEP_MAX   0.2256f
 
#define BUCKBOOST4_CONVERT_V_TO_MV   1000.0f
 
#define BUCKBOOST4_DEVICE_ADDRESS_0   0x75
 Buck-Boost 4 device address setting.
 
#define BUCKBOOST4_DEVICE_ADDRESS_1   0x74
 
#define BUCKBOOST4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  buckboost4_return_value_t { BUCKBOOST4_OK = 0 , BUCKBOOST4_ERROR = -1 }
 Buck-Boost 4 Click return value data. More...
 

Functions

void buckboost4_cfg_setup (buckboost4_cfg_t *cfg)
 Buck-Boost 4 configuration object setup function.
 
err_t buckboost4_init (buckboost4_t *ctx, buckboost4_cfg_t *cfg)
 Buck-Boost 4 initialization function.
 
err_t buckboost4_default_cfg (buckboost4_t *ctx)
 Buck-Boost 4 default configuration function.
 
err_t buckboost4_generic_write (buckboost4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Buck-Boost 4 I2C writing function.
 
err_t buckboost4_generic_read (buckboost4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Buck-Boost 4 I2C reading function.
 
void buckboost4_enable_device (buckboost4_t *ctx)
 Buck-Boost 4 enable the device function.
 
void buckboost4_disable_device (buckboost4_t *ctx)
 Buck-Boost 4 disable the device function.
 
err_t buckboost4_set_vref (buckboost4_t *ctx, float vref_mv)
 Buck-Boost 4 set internal reference voltage function.
 
err_t buckboost4_current_limit_cfg (buckboost4_t *ctx, uint8_t cl_en, float cltv_mv)
 Buck-Boost 4 current limit config function.
 
err_t buckboost4_set_ocp_delay (buckboost4_t *ctx, uint8_t ocp_delay)
 Buck-Boost 4 sets the output overcurrent response time function.
 
err_t buckboost4_set_slew_rate (buckboost4_t *ctx, uint8_t slew_rate)
 Buck-Boost 4 sets the slew rate for output voltage change function.
 
err_t buckboost4_en_ext_output_vtg (buckboost4_t *ctx)
 Buck-Boost 4 enable external output voltage feedback function.
 
err_t buckboost4_set_int_fb_ratio (buckboost4_t *ctx, uint8_t int_fb_ratio)
 Buck-Boost 4 set the internal feedback ratio function.
 
err_t buckboost4_output_enable (buckboost4_t *ctx)
 Buck-Boost 4 enable output voltage function.
 
err_t buckboost4_output_disable (buckboost4_t *ctx)
 Buck-Boost 4 disable output voltage function.
 
err_t buckboost4_set_mode (buckboost4_t *ctx, uint8_t fswdbl, uint8_t hiccup, uint8_t dischg, uint8_t fpwm)
 Buck-Boost 4 set mode function.
 
err_t buckboost4_get_status (buckboost4_t *ctx, uint8_t *status)
 Buck-Boost 4 get status function.
 
err_t buckboost4_set_vout (buckboost4_t *ctx, float vout_v)
 Buck-Boost 4 set the output voltage function.
 
uint8_t buckboost4_fault_indicator (buckboost4_t *ctx)
 Buck-Boost 4 check fault indicator function.
 

Detailed Description

This file contains API for Buck-Boost 4 Click Driver.

Enumeration Type Documentation

◆ buckboost4_return_value_t

Buck-Boost 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCKBOOST4_OK 
BUCKBOOST4_ERROR