buck18  2.1.0.0
Data Structures | Macros | Enumerations | Functions
buck18.h File Reference

This file contains API for Buck 18 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  buck18_t
 Buck 18 Click context object. More...
 
struct  buck18_cfg_t
 Buck 18 Click configuration object. More...
 

Macros

#define BUCK18_CMD_RDAC   0x00
 Buck 18 description register. More...
 
#define BUCK18_CMD_RDAC_OTP   0x80
 
#define BUCK18_OTP_VALID_PRG_RDY   0x00
 Buck 18 RDAC wiper position. More...
 
#define BUCK18_OTP_VALID_TEST   0x40
 
#define BUCK18_OTP_VALID_ERROR   0x80
 
#define BUCK18_OTP_VALID_PRG_OK   0xC0
 
#define BUCK18_WIPER_POS_MAX   0x3F
 Buck 18 wiper and resistance data values. More...
 
#define BUCK18_RES_5_KOHM   5.0f
 
#define BUCK18_RES_50_KOHM   50.0f
 
#define BUCK18_RES_55_KOHM   55.0f
 
#define BUCK18_RDAC_WIPER_POSITION   6, 9, 19, 26, 34, 39, 55, 48, 52, 54, 57, 59, 60, 62, 63
 
#define BUCK18_ADC_RESOLUTION   0x0FFF
 Buck 18 ADC setting. More...
 
#define BUCK18_VREF_3V3   3.3
 
#define BUCK18_VREF_5V   5.0
 
#define BUCK18_SET_DEV_ADDR_0   0x2C
 Buck 18 device address setting. More...
 
#define BUCK18_SET_DEV_ADDR_1   0x2D
 
#define BUCK18_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  buck18_vout_t {
  BUCK18_VOUT_3V3 = 0, BUCK18_VOUT_3V, BUCK18_VOUT_2V8, BUCK18_VOUT_2V75,
  BUCK18_VOUT_2V5, BUCK18_VOUT_2V0, BUCK18_VOUT_1V8, BUCK18_VOUT_1V5,
  BUCK18_VOUT_1V25, BUCK18_VOUT_1V2, BUCK18_VOUT_1V15, BUCK18_VOUT_1V1,
  BUCK18_VOUT_1V, BUCK18_VOUT_0V95, BUCK18_VOUT_0V9
}
 Buck 18 Click output voltage selection. More...
 
enum  buck18_return_value_t { BUCK18_OK = 0, BUCK18_ERROR = -1 }
 Buck 18 Click return value data. More...
 

Functions

void buck18_cfg_setup (buck18_cfg_t *cfg)
 Buck 18 configuration object setup function. More...
 
err_t buck18_init (buck18_t *ctx, buck18_cfg_t *cfg)
 Buck 18 initialization function. More...
 
err_t buck18_default_cfg (buck18_t *ctx)
 Buck 18 default configuration function. More...
 
err_t buck18_read_raw_adc (buck18_t *ctx, uint16_t *raw_adc)
 Buck 18 read raw ADC value function. More...
 
err_t buck18_read_voltage (buck18_t *ctx, float *voltage)
 Buck 18 read voltage level function. More...
 
err_t buck18_set_vref (buck18_t *ctx, float vref)
 Buck 18 set vref function. More...
 
void buck18_enable (buck18_t *ctx)
 Buck 18 enable the device function. More...
 
void buck18_disable (buck18_t *ctx)
 Buck 18 disable the device function. More...
 
err_t buck18_write_data (buck18_t *ctx, uint8_t cmd, uint8_t data_in)
 Buck 18 data writing function. More...
 
err_t buck18_read_data (buck18_t *ctx, uint8_t *data_out)
 Buck 18 data reading function. More...
 
err_t buck18_write_rdac (buck18_t *ctx, uint8_t wiper_pos)
 Buck 18 data writing function. More...
 
err_t buck18_set_resistance (buck18_t *ctx, float res_kohm)
 Buck 18 sets the resistance function. More...
 
err_t buck18_set_vout (buck18_t *ctx, buck18_vout_t vout)
 Buck 18 sets the VOUT function. More...
 

Detailed Description

This file contains API for Buck 18 Click Driver.

Enumeration Type Documentation

◆ buck18_return_value_t

Buck 18 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCK18_OK 
BUCK18_ERROR 

◆ buck18_vout_t

Buck 18 Click output voltage selection.

Cutput voltage selection of Buck 18 Click driver.

Enumerator
BUCK18_VOUT_3V3 
BUCK18_VOUT_3V 
BUCK18_VOUT_2V8 
BUCK18_VOUT_2V75 
BUCK18_VOUT_2V5 
BUCK18_VOUT_2V0 
BUCK18_VOUT_1V8 
BUCK18_VOUT_1V5 
BUCK18_VOUT_1V25 
BUCK18_VOUT_1V2 
BUCK18_VOUT_1V15 
BUCK18_VOUT_1V1 
BUCK18_VOUT_1V 
BUCK18_VOUT_0V95 
BUCK18_VOUT_0V9