stepdown9 2.1.0.0
stepdown9.h File Reference

This file contains API for Step Down 9 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  stepdown9_t
 Step Down 9 Click context object. More...
 
struct  stepdown9_cfg_t
 Step Down 9 Click configuration object. More...
 

Macros

#define STEPDOWN9_VOUT_10V_RESISTANCE   8700
 Step Down 9 description setting.
 
#define STEPDOWN9_VOUT_9V5_RESISTANCE   11500
 
#define STEPDOWN9_VOUT_9V_RESISTANCE   11700
 
#define STEPDOWN9_VOUT_8V5_RESISTANCE   12500
 
#define STEPDOWN9_VOUT_8V_RESISTANCE   13000
 
#define STEPDOWN9_VOUT_7V5_RESISTANCE   13700
 
#define STEPDOWN9_VOUT_7V_RESISTANCE   14700
 
#define STEPDOWN9_VOUT_6V5_RESISTANCE   15800
 
#define STEPDOWN9_VOUT_6V_RESISTANCE   17000
 
#define STEPDOWN9_VOUT_5V5_RESISTANCE   19000
 
#define STEPDOWN9_VOUT_5V_RESISTANCE   21000
 
#define STEPDOWN9_VOUT_4V5_RESISTANCE   23500
 
#define STEPDOWN9_VOUT_4V_RESISTANCE   27000
 
#define STEPDOWN9_VOUT_3V5_RESISTANCE   32000
 
#define STEPDOWN9_VOUT_3V3_RESISTANCE   34000
 
#define STEPDOWN9_VOUT_3V_RESISTANCE   38000
 
#define STEPDOWN9_VOUT_2V5_RESISTANCE   50000
 
#define STEPDOWN9_VOUT_2V_RESISTANCE   70000
 
#define STEPDOWN9_VOUT_1V6_RESISTANCE   100000
 
#define STEPDOWN9_VOUT_10V   0x12
 Step Down 9 Vout setting.
 
#define STEPDOWN9_VOUT_9V5   0x11
 
#define STEPDOWN9_VOUT_9V   0x10
 
#define STEPDOWN9_VOUT_8V5   0x0F
 
#define STEPDOWN9_VOUT_8V   0x0E
 
#define STEPDOWN9_VOUT_7V5   0x0D
 
#define STEPDOWN9_VOUT_7V   0x0C
 
#define STEPDOWN9_VOUT_6V5   0x0B
 
#define STEPDOWN9_VOUT_6V   0x0A
 
#define STEPDOWN9_VOUT_5V5   0x09
 
#define STEPDOWN9_VOUT_5V   0x08
 
#define STEPDOWN9_VOUT_4V5   0x07
 
#define STEPDOWN9_VOUT_4V   0x06
 
#define STEPDOWN9_VOUT_3V5   0x05
 
#define STEPDOWN9_VOUT_3V3   0x04
 
#define STEPDOWN9_VOUT_3V   0x03
 
#define STEPDOWN9_VOUT_2V5   0x02
 
#define STEPDOWN9_VOUT_2V   0x01
 
#define STEPDOWN9_VOUT_1V6   0x00
 
#define STEPDOWN9_PIN_STATE_HIGH   0x01
 Step Down 9 pin state setting.
 
#define STEPDOWN9_PIN_STATE_LOW   0x00
 
#define STEPDOWN9_RESISTANCE_MIN   8700
 Step Down 9 description digital potentiometer wiper data.
 
#define STEPDOWN9_FULL_SCALE_RES_100_KOHM   100000
 
#define STEPDOWN9_WIPER_POS_MAX   0xFF
 
#define STEPDOWN9_ROUND_TO_NEAREST_INT   0.5
 
#define STEPDOWN9_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define STEPDOWN9_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define STEPDOWN9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepdown9_return_value_t { STEPDOWN9_OK = 0 , STEPDOWN9_ERROR = -1 }
 Step Down 9 Click return value data. More...
 

Functions

void stepdown9_cfg_setup (stepdown9_cfg_t *cfg)
 Step Down 9 configuration object setup function.
 
err_t stepdown9_init (stepdown9_t *ctx, stepdown9_cfg_t *cfg)
 Step Down 9 initialization function.
 
err_t stepdown9_default_cfg (stepdown9_t *ctx)
 Step Down 9 default configuration function.
 
err_t stepdown9_generic_write (stepdown9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Step Down 9 data writing function.
 
err_t stepdown9_generic_read (stepdown9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Step Down 9 data reading function.
 
void stepdown9_set_en_pin (stepdown9_t *ctx, uint8_t pin_state)
 Step Down 9 set EN pin state function.
 
uint8_t stepdown9_get_pg_pin (stepdown9_t *ctx)
 Step Down 9 get PG pin state function.
 
err_t stepdown9_set_wiper_pos (stepdown9_t *ctx, uint8_t wiper_pos)
 Step Down 9 set wiper position.
 
err_t stepdown9_set_resistance (stepdown9_t *ctx, uint32_t res_ohm)
 Step Down 9 set potentiometer resistance.
 
err_t stepdown9_set_output (stepdown9_t *ctx, uint8_t voltage)
 Step Down 9 set output voltage.
 

Detailed Description

This file contains API for Step Down 9 Click Driver.

Enumeration Type Documentation

◆ stepdown9_return_value_t

Step Down 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPDOWN9_OK 
STEPDOWN9_ERROR