buck22 2.1.0.0
buck22.h File Reference

This file contains API for Buck 22 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  buck22_t
 Buck 22 Click context object. More...
 
struct  buck22_cfg_t
 Buck 22 Click configuration object. More...
 

Macros

#define BUCK22_REG_VOUT   0x01
 Buck 22 register list.
 
#define BUCK22_REG_CONTROL   0x03
 
#define BUCK22_REG_STATUS   0x05
 
#define BUCK22_VOUT_MIN   800
 Buck 22 VOUT setting.
 
#define BUCK22_VOUT_MAX   3350
 
#define BUCK22_VOLTAGE_FACTOR   2
 
#define BUCK22_VOUT_RESOLUTION   ( 5 * BUCK22_VOLTAGE_FACTOR )
 
#define BUCK22_CONTROL_RESET   0x80
 Buck 22 CONTROL setting.
 
#define BUCK22_CONTROL_FPWM_VOUT_CHANGE   0x40
 
#define BUCK22_CONTROL_SOFT_EN   0x20
 
#define BUCK22_CONTROL_FPWM_EN   0x10
 
#define BUCK22_CONTROL_DISCHARGE_EN   0x08
 
#define BUCK22_CONTROL_HICCUP_EN   0x04
 
#define BUCK22_CONTROL_VRAMP_SPEED_20   0x00
 
#define BUCK22_CONTROL_VRAMP_SPEED_10   0x01
 
#define BUCK22_CONTROL_VRAMP_SPEED_5   0x02
 
#define BUCK22_CONTROL_VRAMP_SPEED_1   0x03
 
#define BUCK22_CONTROL_VRAMP_SPEED_MASK   0x03
 
#define BUCK22_CONTROL_DEFAULT_SETTING
 
#define BUCK22_STATUS_THERMAL_WARNING   0x10
 Buck 22 STATUS setting.
 
#define BUCK22_STATUS_HICCUP   0x08
 
#define BUCK22_STATUS_UVLO   0x01
 
#define BUCK22_DEVICE_ADDRESS   0x42
 Buck 22 device address setting.
 
#define BUCK22_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  buck22_return_value_t { BUCK22_OK = 0 , BUCK22_ERROR = -1 }
 Buck 22 Click return value data. More...
 

Functions

void buck22_cfg_setup (buck22_cfg_t *cfg)
 Buck 22 configuration object setup function.
 
err_t buck22_init (buck22_t *ctx, buck22_cfg_t *cfg)
 Buck 22 initialization function.
 
err_t buck22_set_vout (buck22_t *ctx, uint16_t vout_mv)
 Buck 22 set vout function.
 
err_t buck22_read_vout (buck22_t *ctx, uint16_t *vout_mv)
 Buck 22 read vout function.
 
err_t buck22_set_control (buck22_t *ctx, uint8_t control)
 Buck 22 set control function.
 
err_t buck22_read_status (buck22_t *ctx, uint8_t *status)
 Buck 22 read status function.
 
uint8_t buck22_get_pg_pin (buck22_t *ctx)
 Buck 22 get pg pin function.
 

Detailed Description

This file contains API for Buck 22 Click Driver.

Enumeration Type Documentation

◆ buck22_return_value_t

Buck 22 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCK22_OK 
BUCK22_ERROR