smartbuck3 2.1.0.0
smartbuck3.h File Reference

This file contains API for Smart Buck 3 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  smartbuck3_t
 Smart Buck 3 Click context object. More...
 
struct  smartbuck3_cfg_t
 Smart Buck 3 Click configuration object. More...
 

Macros

#define SMARTBUCK3_REG_SET0   0x00
 Smart Buck 3 description register.
 
#define SMARTBUCK3_REG_SET1   0x01
 
#define SMARTBUCK3_REG_CTRL   0x04
 
#define SMARTBUCK3_REG_TEMP   0x05
 
#define SMARTBUCK3_REG_RMPCTRL   0x06
 
#define SMARTBUCK3_REG_CHIP_ID_0   0x08
 
#define SMARTBUCK3_REG_CHIP_ID_1   0x09
 
#define SMARTBUCK3_MOD_BIT_MASK   0x80
 Smart Buck 3 description setting.
 
#define SMARTBUCK3_OP_MODE_FORCED_PWM   0x80
 
#define SMARTBUCK3_OP_MODE_PFM   0x00
 
#define SMARTBUCK3_OV_BIT_MASK   0x7F
 
#define SMARTBUCK3_CTRL_PD_EN   0x80
 
#define SMARTBUCK3_CTRL_PD_VSEL   0x40
 
#define SMARTBUCK3_TEMP_DIS_BIT_MASK   0xFB
 
#define SMARTBUCK3_TEMP_TS_ENABLE   0x00
 
#define SMARTBUCK3_TEMP_TS_DISABLE   0x04
 
#define SMARTBUCK3_TEMP_TJEW   0x02
 
#define SMARTBUCK3_TEMP_TJEW_BIT_MASK   0xFD
 
#define SMARTBUCK3_TEMP_LT_120_C   0x00
 
#define SMARTBUCK3_TEMP_GT_120_C   0x01
 
#define SMARTBUCK3_TEMP_ERROR   0x02
 
#define SMARTBUCK3_TEMP_TJTS   0x01
 
#define SMARTBUCK3_RMP_SET   0xE0
 
#define SMARTBUCK3_RMP_EN_DISC   0x04
 
#define SMARTBUCK3_RMP_PFM   0x02
 
#define SMARTBUCK3_ID_VENDOR   0xF0
 
#define SMARTBUCK3_ID_PART   0x0C
 
#define SMARTBUCK3_ID_REV   0x03
 
#define SMARTBUCK3_VTG_RAMP_T_32mVns   0x00
 
#define SMARTBUCK3_VTG_RAMP_T_16mVns   0x01
 
#define SMARTBUCK3_VTG_RAMP_T_8mVns   0x02
 
#define SMARTBUCK3_VTG_RAMP_T_4mVns   0x03
 
#define SMARTBUCK3_VTG_RAMP_T_2mVns   0x04
 
#define SMARTBUCK3_VTG_RAMP_T_1mVns   0x05
 
#define SMARTBUCK3_VTG_RAMP_T_0_5mVns   0x06
 
#define SMARTBUCK3_VTG_RAMP_T_0_25mVns   0x07
 
#define SMARTBUCK3_VTG_RAMP_T_BIT_MASK   0xE0
 
#define SMARTBUCK3_VOUT_MAX   1770
 
#define SMARTBUCK3_VOUT_MIN   500
 
#define SMARTBUCK3_DEVICE_ID   0x91
 
#define SMARTBUCK3_DEVICE_ADDRESS   0x60
 Smart Buck 3 device address setting.
 
#define SMARTBUCK3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  smartbuck3_return_value_t { SMARTBUCK3_OK = 0 , SMARTBUCK3_ERROR = -1 }
 Smart Buck 3 Click return value data. More...
 

Functions

void smartbuck3_cfg_setup (smartbuck3_cfg_t *cfg)
 Smart Buck 3 configuration object setup function.
 
err_t smartbuck3_init (smartbuck3_t *ctx, smartbuck3_cfg_t *cfg)
 Smart Buck 3 initialization function.
 
err_t smartbuck3_default_cfg (smartbuck3_t *ctx)
 Smart Buck 3 default configuration function.
 
err_t smartbuck3_generic_write (smartbuck3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Smart Buck 3 I2C writing function.
 
err_t smartbuck3_generic_read (smartbuck3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Smart Buck 3 I2C reading function.
 
err_t smartbuck3_set_voltage (smartbuck3_t *ctx, uint16_t vout_mv)
 Smart Buck 3 set voltage function.
 
err_t smartbuck3_get_voltage (smartbuck3_t *ctx, uint16_t *vout_mv)
 Smart Buck 3 get voltage function.
 
err_t smartbuck3_set_operation_mode (smartbuck3_t *ctx, uint8_t op_mode)
 Smart Buck 3 set operation mode function.
 
err_t smartbuck3_get_operation_mode (smartbuck3_t *ctx, uint8_t *op_mode)
 Smart Buck 3 get operation mode function.
 
err_t smartbuck3_set_temperature_shutdown (smartbuck3_t *ctx, uint8_t temp_enable)
 Smart Buck 3 set temperature shutdown function.
 
uint8_t smartbuck3_check_temperature_warning (smartbuck3_t *ctx)
 Smart Buck 3 check temperature warning function.
 
err_t smartbuck3_set_voltage_ramp_timing (smartbuck3_t *ctx, uint8_t slope)
 Smart Buck 3 set voltage ramp timing function.
 
err_t smartbuck3_get_device_id (smartbuck3_t *ctx, uint8_t *device_id)
 Smart Buck 3 get device ID function.
 

Detailed Description

This file contains API for Smart Buck 3 Click Driver.

Enumeration Type Documentation

◆ smartbuck3_return_value_t

Smart Buck 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
SMARTBUCK3_OK 
SMARTBUCK3_ERROR