stepdown11 2.1.0.0
stepdown11.h File Reference

This file contains API for Step Down 11 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  stepdown11_t
 Step Down 11 Click context object. More...
 
struct  stepdown11_cfg_t
 Step Down 11 Click configuration object. More...
 

Macros

#define STEPDOWN11_ADDR_BIT_READ_INPUT_REG   0x00
 Step Down 11 description register.
 
#define STEPDOWN11_ADDR_BIT_READ_EEPROM   0x01
 
#define STEPDOWN11_ADDR_BIT_READ_CTRL_REG   0x02
 
#define STEPDOWN11_ADDR_BIT_READ_RDAC   0x03
 
#define STEPDOWN11_ADDR_BIT_RDAC_DECR   0x00
 
#define STEPDOWN11_ADDR_BIT_RDAC_INCR   0x01
 
#define STEPDOWN11_ADDR_BIT_COPY_TO_RDAC   0x00
 
#define STEPDOWN11_ADDR_BIT_COPY_TO_EEPROM   0x01
 
#define STEPDOWN11_ADDR_BIT_SCALE_MODE_NORMAL   0x80
 
#define STEPDOWN11_ADDR_BIT_SCALE_MODE_SHDN   0x81
 
#define STEPDOWN11_ADDR_BIT_SCALE_EXIT   0x00
 
#define STEPDOWN11_ADDR_BIT_SCALE_ENTER   0x01
 
#define STEPDOWN11_ADDR_BIT_SW_SHDN_MODE_NORMAL   0x00
 
#define STEPDOWN11_ADDR_BIT_SW_SHDN_MODE_SHDN   0x01
 
#define STEPDOWN11_CTRL_BIT_NOP   0x00
 Step Down 11 description setting.
 
#define STEPDOWN11_CTRL_BIT_WRITE_RDAC   0x10
 
#define STEPDOWN11_CTRL_BIT_WRITE_SHIFT_REG   0x20
 
#define STEPDOWN11_CTRL_BIT_READ   0x30
 
#define STEPDOWN11_CTRL_BIT_LIN_RDAC   0x40
 
#define STEPDOWN11_CTRL_BIT_6_DB_RDAC   0x50
 
#define STEPDOWN11_CTRL_BIT_COPY_LRDAC   0x60
 
#define STEPDOWN11_CTRL_BIT_COPY_RDAC_EEPROM   0x70
 
#define STEPDOWN11_CTRL_BIT_WRITE_EEPROM   0x80
 
#define STEPDOWN11_CTRL_BIT_SCALE   0x90
 
#define STEPDOWN11_CTRL_BIT_SW_RST   0xB0
 
#define STEPDOWN11_CTRL_BIT_SW_SHDN   0xC0
 
#define STEPDOWN11_CTRL_BIT_REG_CTRL   0xD0
 
#define STEPDOWN11_CTRL_BIT_MASK   0xF0
 
#define STEPDOWN11_WIPER_SEL_1   0x00
 Step Down 11 description of the wiper selection.
 
#define STEPDOWN11_WIPER_SEL_2   0x01
 
#define STEPDOWN11_WIPER_SEL_BOTH   0x08
 
#define STEPDOWN11_S_CONF_1MHZ_SPREAD_OFF   0
 Step Down 11 S-CONF Device Configuration Modes.
 
#define STEPDOWN11_S_CONF_2_2MHZ_SPREAD_OFF   4870
 
#define STEPDOWN11_S_CONF_2_2MHZ_SPREAD_TRIANGLE   6040
 
#define STEPDOWN11_S_CONF_2_2MHZ_SPREAD_RANDOM   7500
 
#define STEPDOWN11_WIPER_POS_MAX   255
 Step Down 11 wiper and resistance data values.
 
#define STEPDOWN11_WIPER_POS_MIN   0
 
#define STEPDOWN11_WIPER_POS_MIDDLE   127
 
#define STEPDOWN11_RES_10_KOHM   10000
 
#define STEPDOWN11_RES_0_KOHM   0
 
#define STEPDOWN11_R_5_RESISTANCE   2700
 
#define STEPDOWN11_R_9_RESISTANCE   10
 
#define STEPDOWN11_VFB_VALUE   0.8f
 
#define STEPDOWN11_ENABLE_OUTPUT   0x01
 Step Down 11 pin states setting.
 
#define STEPDOWN11_DISABLE_OUTPUT   0x00
 
#define STEPDOWN11_DEVICE_ADDRESS_0   0x2F
 Step Down 11 device address setting.
 
#define STEPDOWN11_DEVICE_ADDRESS_1   0x2C
 
#define STEPDOWN11_DEVICE_ADDRESS_2   0x23
 
#define STEPDOWN11_DEVICE_ADDRESS_3   0x20
 
#define STEPDOWN11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepdown11_return_value_t { STEPDOWN11_OK = 0 , STEPDOWN11_ERROR = -1 }
 Step Down 11 Click return value data. More...
 

Functions

void stepdown11_cfg_setup (stepdown11_cfg_t *cfg)
 Step Down 11 configuration object setup function.
 
err_t stepdown11_init (stepdown11_t *ctx, stepdown11_cfg_t *cfg)
 Step Down 11 initialization function.
 
err_t stepdown11_default_cfg (stepdown11_t *ctx)
 Step Down 11 default configuration function.
 
err_t stepdown11_generic_write (stepdown11_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Step Down 11 I2C writing function.
 
err_t stepdown11_generic_read (stepdown11_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Step Down 11 I2C reading function.
 
void stepdown11_set_en_pin (stepdown11_t *ctx, uint8_t pin_state)
 Step Down 11 set EN pin state function.
 
uint8_t stepdown11_get_pg_pin (stepdown11_t *ctx)
 Step Down 11 get PG pin state function.
 
void stepdown11_reset_digi_pot (stepdown11_t *ctx)
 Step Down 11 reset digi pot function.
 
err_t stepdown11_write_data (stepdown11_t *ctx, uint8_t ctrl, uint8_t addr, uint8_t data_in)
 Step Down 11 I2C writing function.
 
err_t stepdown11_read_data (stepdown11_t *ctx, uint8_t addr, uint8_t mask, uint8_t *data_out)
 Step Down 11 I2C reading function.
 
err_t stepdown11_write_rdac (stepdown11_t *ctx, uint8_t addr, uint8_t data_in)
 Step Down 11 write the RDAC function.
 
err_t stepdown11_read_rdac (stepdown11_t *ctx, uint8_t addr, uint8_t *data_out)
 Step Down 11 read the RDAC function.
 
err_t stepdown11_set_resistance (stepdown11_t *ctx, uint8_t wiper_sel, float res_kohm)
 Step Down 11 set the resistance function.
 
err_t stepdown11_get_resistance (stepdown11_t *ctx, uint8_t wiper_sel, float *res_kohm)
 Step Down 11 get the resistance function.
 
err_t stepdown11_set_voltage (stepdown11_t *ctx, float v_out)
 Step Down 11 set voltage output function.
 
err_t stepdown11_set_mode (stepdown11_t *ctx, float sconf_mode)
 Step Down 11 set S-CONF device configuration mode function.
 

Detailed Description

This file contains API for Step Down 11 Click Driver.

Enumeration Type Documentation

◆ stepdown11_return_value_t

Step Down 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPDOWN11_OK 
STEPDOWN11_ERROR