buck23 2.1.0.0
buck23.h File Reference

This file contains API for Buck 23 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  buck23_t
 Buck 23 Click context object. More...
 
struct  buck23_cfg_t
 Buck 23 Click configuration object. More...
 

Macros

#define BUCK23_REG_ID   0x00
 Buck 23 register map.
 
#define BUCK23_REG_VIDMAX   0x02
 
#define BUCK23_REG_STATUS   0x04
 
#define BUCK23_REG_CONFIG   0x05
 
#define BUCK23_REG_SLEW   0x06
 
#define BUCK23_REG_VID   0x07
 
#define BUCK23_DEVICE_ID   0x03
 Buck 23 device ID setting.
 
#define BUCK23_VIDMAX_UNCAPPED   0x4E
 Buck 23 VIDMAX register setting.
 
#define BUCK23_CONFIG_VSTEP_10   0x00
 Buck 23 CONFIG register setting.
 
#define BUCK23_CONFIG_VSTEP_12_5   0x80
 
#define BUCK23_CONFIG_VSTEP_MASK   0x80
 
#define BUCK23_CONFIG_MODE_SYNC   0x00
 
#define BUCK23_CONFIG_MODE_FPWM   0x08
 
#define BUCK23_CONFIG_MODE_MASK   0x08
 
#define BUCK23_CONFIG_SS_DIS   0x00
 
#define BUCK23_CONFIG_SS_3_PCT_SPREAD   0x04
 
#define BUCK23_CONFIG_SS_MASK   0x04
 
#define BUCK23_CONFIG_SYNC_IO_IN_RISE   0x00
 
#define BUCK23_CONFIG_SYNC_IO_IN_FALL   0x01
 
#define BUCK23_CONFIG_SYNC_IO_OUT_FALL   0x02
 
#define BUCK23_CONFIG_SYNC_IO_MASK   0x03
 
#define BUCK23_STATUS_INTERR   0x80
 Buck 23 STATUS register setting.
 
#define BUCK23_STATUS_VRHOT   0x20
 
#define BUCK23_STATUS_UV   0x10
 
#define BUCK23_STATUS_OV   0x08
 
#define BUCK23_STATUS_OC   0x04
 
#define BUCK23_STATUS_VMERR   0x02
 
#define BUCK23_SLEW_SS_22_DVS_22   0x00
 Buck 23 SLEW register setting.
 
#define BUCK23_SLEW_SS_11_DVS_22   0x01
 
#define BUCK23_SLEW_SS_5_5_DVS_22   0x02
 
#define BUCK23_SLEW_SS_11_DVS_11   0x03
 
#define BUCK23_SLEW_SS_5_5_DVS_11   0x04
 
#define BUCK23_SLEW_SS_44_DVS_44   0x05
 
#define BUCK23_SLEW_SS_22_DVS_44   0x06
 
#define BUCK23_SLEW_SS_11_DVS_44   0x07
 
#define BUCK23_SLEW_SS_5_5_DVS_44   0x08
 
#define BUCK23_SLEW_SS_5_5_DVS_5_5   0x09
 
#define BUCK23_SLEW_MASK   0x0F
 
#define BUCK23_VSTEP_10   0
 Buck 23 voltage output step setting.
 
#define BUCK23_VSTEP_12_5   1
 
#define BUCK23_VID_MIN   0x01
 Buck 23 voltage output setting.
 
#define BUCK23_VID_MAX   0x4E
 
#define BUCK23_VOUT_MIN_VSTEP_10   500u
 
#define BUCK23_VOUT_MAX_VSTEP_10   1270u
 
#define BUCK23_VOUT_MIN_VSTEP_12_5   625u
 
#define BUCK23_VOUT_MAX_VSTEP_12_5   1587u
 
#define BUCK23_VOUT_RES_VSTEP_10   10.0f
 
#define BUCK23_VOUT_RES_VSTEP_12_5   12.5f
 
#define BUCK23_DEVICE_ADDRESS_0   0x38
 Buck 23 device address setting.
 
#define BUCK23_DEVICE_ADDRESS_1   0x39
 
#define BUCK23_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  buck23_return_value_t { BUCK23_OK = 0 , BUCK23_ERROR = -1 }
 Buck 23 Click return value data. More...
 

Functions

void buck23_cfg_setup (buck23_cfg_t *cfg)
 Buck 23 configuration object setup function.
 
err_t buck23_init (buck23_t *ctx, buck23_cfg_t *cfg)
 Buck 23 initialization function.
 
err_t buck23_default_cfg (buck23_t *ctx)
 Buck 23 default configuration function.
 
err_t buck23_write_register (buck23_t *ctx, uint8_t reg, uint8_t data_in)
 Buck 23 write register function.
 
err_t buck23_read_register (buck23_t *ctx, uint8_t reg, uint8_t *data_out)
 Buck 23 read register function.
 
void buck23_enable_device (buck23_t *ctx)
 Buck 23 enable device function.
 
void buck23_disable_device (buck23_t *ctx)
 Buck 23 disable device function.
 
void buck23_restart_device (buck23_t *ctx)
 Buck 23 restart device function.
 
void buck23_set_sync_pin (buck23_t *ctx, uint8_t state)
 Buck 23 set sync pin function.
 
uint8_t buck23_get_pg_pin (buck23_t *ctx)
 Buck 23 get pg pin function.
 
err_t buck23_check_communication (buck23_t *ctx)
 Buck 23 check communication function.
 
err_t buck23_set_vstep (buck23_t *ctx, uint8_t vstep)
 Buck 23 set vstep function.
 
err_t buck23_set_vout (buck23_t *ctx, uint16_t vout_mv)
 Buck 23 set vout function.
 

Detailed Description

This file contains API for Buck 23 Click Driver.

Enumeration Type Documentation

◆ buck23_return_value_t

Buck 23 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCK23_OK 
BUCK23_ERROR