buck24 2.2.0
Loading...
Searching...
No Matches
buck24.h File Reference

This file contains API for Buck 24 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  buck24_data_t
 Buck 24 Click data object. More...
struct  buck24_t
 Buck 24 Click context object. More...
struct  buck24_cfg_t
 Buck 24 Click configuration object. More...

Macros

#define BUCK24_REG_CONFIGURATION   0x00
 Buck 24 register list.
#define BUCK24_REG_SHUNT_VOLTAGE   0x01
#define BUCK24_REG_BUS_VOLTAGE   0x02
#define BUCK24_REG_POWER   0x03
#define BUCK24_REG_CURRENT   0x04
#define BUCK24_REG_CALIBRATION   0x05
#define BUCK24_CONFIGURATION_RST   0x8000
 Buck 24 CONFIGURATION register setting.
#define BUCK24_CONFIGURATION_BRNG_16V   0x0000
#define BUCK24_CONFIGURATION_BRNG_32V   0x2000
#define BUCK24_CONFIGURATION_BRNG_MASK   0x2000
#define BUCK24_CONFIGURATION_PGA_DIV_1   0x0000
#define BUCK24_CONFIGURATION_PGA_DIV_2   0x0800
#define BUCK24_CONFIGURATION_PGA_DIV_4   0x1000
#define BUCK24_CONFIGURATION_PGA_DIV_8   0x1800
#define BUCK24_CONFIGURATION_PGA_MASK   0x1800
#define BUCK24_CONFIGURATION_BADC_84_US   0x0000
#define BUCK24_CONFIGURATION_BADC_148_US   0x0080
#define BUCK24_CONFIGURATION_BADC_276_US   0x0100
#define BUCK24_CONFIGURATION_BADC_532_US   0x0180
#define BUCK24_CONFIGURATION_BADC_1_06_MS   0x0480
#define BUCK24_CONFIGURATION_BADC_2_13_MS   0x0500
#define BUCK24_CONFIGURATION_BADC_4_26_MS   0x0580
#define BUCK24_CONFIGURATION_BADC_8_51_MS   0x0600
#define BUCK24_CONFIGURATION_BADC_17_02_MS   0x0680
#define BUCK24_CONFIGURATION_BADC_34_05_MS   0x0700
#define BUCK24_CONFIGURATION_BADC_68_10_MS   0x0780
#define BUCK24_CONFIGURATION_BADC_MASK   0x0780
#define BUCK24_CONFIGURATION_SADC_84_US   0x0000
#define BUCK24_CONFIGURATION_SADC_148_US   0x0008
#define BUCK24_CONFIGURATION_SADC_276_US   0x0010
#define BUCK24_CONFIGURATION_SADC_532_US   0x0018
#define BUCK24_CONFIGURATION_SADC_1_06_MS   0x0048
#define BUCK24_CONFIGURATION_SADC_2_13_MS   0x0050
#define BUCK24_CONFIGURATION_SADC_4_26_MS   0x0058
#define BUCK24_CONFIGURATION_SADC_8_51_MS   0x0060
#define BUCK24_CONFIGURATION_SADC_17_02_MS   0x0068
#define BUCK24_CONFIGURATION_SADC_34_05_MS   0x0070
#define BUCK24_CONFIGURATION_SADC_68_10_MS   0x0078
#define BUCK24_CONFIGURATION_SADC_MASK   0x0078
#define BUCK24_CONFIGURATION_MODE_PDOWN   0x0000
#define BUCK24_CONFIGURATION_MODE_SHT_V_TRG   0x0001
#define BUCK24_CONFIGURATION_MODE_BUS_V_TRG   0x0002
#define BUCK24_CONFIGURATION_MODE_SHT_BUS_V_TRG   0x0003
#define BUCK24_CONFIGURATION_MODE_ADC_OFF   0x0004
#define BUCK24_CONFIGURATION_MODE_SHT_V_CONT   0x0005
#define BUCK24_CONFIGURATION_MODE_BUS_V_CONT   0x0006
#define BUCK24_CONFIGURATION_MODE_SHT_BUS_V_CONT   0x0007
#define BUCK24_CONFIGURATION_MODE_MASK   0x0007
#define BUCK24_BUS_VOLTAGE_CNVR   0x0002
 Buck 24 BUS_VOLTAGE register setting.
#define BUCK24_BUS_VOLTAGE_OVF   0x0001
#define BUCK24_SHUNT_LSB_MV   0.01f
 Buck 24 calculation setting.
#define BUCK24_BUS_V_LSB_V   0.004f
#define BUCK24_POWER_LSB_W   0.02f
#define BUCK24_CURRENT_LSB_A   0.001f
#define BUCK24_CALIBRATION_FOR_SHUNT_0_01_OHM   4096
#define BUCK24_DEFAULT_NUM_CONV   20
#define BUCK24_DEVICE_ADDRESS_0   0x40
 Buck 24 device address setting.
#define BUCK24_DEVICE_ADDRESS_1   0x41
#define BUCK24_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  buck24_return_value_t { BUCK24_OK = 0 , BUCK24_ERROR = -1 }
 Buck 24 Click return value data. More...

Functions

void buck24_cfg_setup (buck24_cfg_t *cfg)
 Buck 24 configuration object setup function.
err_t buck24_init (buck24_t *ctx, buck24_cfg_t *cfg)
 Buck 24 initialization function.
err_t buck24_default_cfg (buck24_t *ctx)
 Buck 24 default configuration function.
void buck24_enable_device (buck24_t *ctx)
 Buck 24 enable device function.
void buck24_disable_device (buck24_t *ctx)
 Buck 24 disable device function.
uint8_t buck24_get_pg_pin (buck24_t *ctx)
 Buck 24 get power-good pin function.
err_t buck24_write_reg (buck24_t *ctx, uint8_t reg, uint16_t data_in)
 Buck 24 write register function.
err_t buck24_read_reg (buck24_t *ctx, uint8_t reg, uint16_t *data_out)
 Buck 24 read register function.
err_t buck24_read_data (buck24_t *ctx, buck24_data_t *data_out)
 Buck 24 read measurement data function.
err_t buck24_read_data_avg (buck24_t *ctx, uint16_t num_conv, buck24_data_t *data_out)
 Buck 24 read averaged measurement data function.

Detailed Description

This file contains API for Buck 24 Click Driver.

Enumeration Type Documentation

◆ buck24_return_value_t

Buck 24 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCK24_OK 
BUCK24_ERROR