buck20 2.1.0.0
buck20.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  buck20_t
 Buck 20 Click context object. More...
 
struct  buck20_cfg_t
 Buck 20 Click configuration object. More...
 

Macros

#define BUCK20_CMD_NOP   0
 Buck 20 digipot command bits list.
 
#define BUCK20_CMD_RESTORE_EEMEM   1
 
#define BUCK20_CMD_STORE_RDAC   2
 
#define BUCK20_CMD_STORE_USER_DATA   3
 
#define BUCK20_CMD_DECREMENT_6DB   4
 
#define BUCK20_CMD_DECREMENT_ALL_6DB   5
 
#define BUCK20_CMD_DECREMENT_ONE_STEP   6
 
#define BUCK20_CMD_DECREMENT_ALL_ONE_STEP   7
 
#define BUCK20_CMD_RESET_EEMEM   8
 
#define BUCK20_CMD_READ_EEMEM   9
 
#define BUCK20_CMD_READ_RDAC   10
 
#define BUCK20_CMD_WRITE_DATA   11
 
#define BUCK20_CMD_INCREMENT_6DB   12
 
#define BUCK20_CMD_INCREMENT_ALL_6DB   13
 
#define BUCK20_CMD_INCREMENT_ONE_STEP   14
 
#define BUCK20_CMD_INCREMENT_ALL_ONE_STEP   15
 
#define BUCK20_ADDRESS_RDAC1   0
 Buck 20 digipot address bits list.
 
#define BUCK20_ADDRESS_RDAC2   1
 
#define BUCK20_ADDRESS_USER_DATA_0   2
 
#define BUCK20_ADDRESS_USER_DATA_1   3
 
#define BUCK20_ADDRESS_USER_DATA_2   4
 
#define BUCK20_ADDRESS_USER_DATA_3   5
 
#define BUCK20_ADDRESS_USER_DATA_4   6
 
#define BUCK20_ADDRESS_USER_DATA_5   7
 
#define BUCK20_ADDRESS_USER_DATA_6   8
 
#define BUCK20_ADDRESS_USER_DATA_7   9
 
#define BUCK20_ADDRESS_USER_DATA_8   10
 
#define BUCK20_ADDRESS_USER_DATA_9   11
 
#define BUCK20_ADDRESS_USER_DATA_10   12
 
#define BUCK20_ADDRESS_USER_DATA_11   13
 
#define BUCK20_ADDRESS_USER_DATA_12   14
 
#define BUCK20_ADDRESS_FACTORY_USAGE   15
 
#define BUCK20_WIPER_FULL_SCALE   1023
 Buck 20 digipot wiper setting.
 
#define BUCK20_WIPER_MID_SCALE   512
 
#define BUCK20_WIPER_ZERO_SCALE   0
 
#define BUCK20_RESISTOR_R6_KOHM   47.0f
 Buck 20 voltage calculation values.
 
#define BUCK20_DIGIPOT_MAX_KOHM   250.0f
 
#define BUCK20_BUCK_R2_KOHM   40.2f
 
#define BUCK20_BUCK_VREF   0.6f
 
#define BUCK20_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define BUCK20_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define BUCK20_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  buck20_return_value_t { BUCK20_OK = 0 , BUCK20_ERROR = -1 }
 Buck 20 Click return value data. More...
 

Functions

void buck20_cfg_setup (buck20_cfg_t *cfg)
 Buck 20 configuration object setup function.
 
err_t buck20_init (buck20_t *ctx, buck20_cfg_t *cfg)
 Buck 20 initialization function.
 
err_t buck20_generic_write (buck20_t *ctx, uint8_t command, uint8_t address, uint16_t data_in)
 Buck 20 data writing function.
 
err_t buck20_generic_read (buck20_t *ctx, uint8_t command, uint8_t address, uint16_t *data_out)
 Buck 20 data reading function.
 
err_t buck20_set_wiper_1 (buck20_t *ctx, uint16_t data_in)
 Buck 20 Set wiper 1 function.
 
err_t buck20_write_user_data (buck20_t *ctx, uint8_t address, uint16_t data_in)
 Buck 20 write user data function.
 
err_t buck20_read_user_data (buck20_t *ctx, uint8_t address, uint16_t *data_out)
 Buck 20 read user data function.
 
uint8_t buck20_get_rdy_pin (buck20_t *ctx)
 Buck 20 get rdy pin function.
 
void buck20_enable_device (buck20_t *ctx)
 Buck 20 enable device function.
 
void buck20_disable_device (buck20_t *ctx)
 Buck 20 disable device function.
 

Detailed Description

This file contains API for Buck 20 Click Driver.

Enumeration Type Documentation

◆ buck20_return_value_t

Buck 20 Click return value data.

Predefined enum values for driver return values.

Enumerator
BUCK20_OK 
BUCK20_ERROR