39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define STEPDOWN8_PFM_PWM_MODE 0x00
74#define STEPDOWN8_FORCED_PWM_MODE 0x01
75#define STEPDOWN8_R1_RPROG_ADDRESS 0x00
94#define STEPDOWN8_R1_VALUE 200000ul
95#define STEPDOWN8_DIGIPOT_MAX_VALUE 100000ul
96#define STEPDOWN8_DIGIPOT_RESOLUTION 257
97#define STEPDOWN8_ROUND_TO_NEAREST_INT 0.5
98#define STEPDOWN8_R10_VALUE 10000u
99#define STEPDOWN8_MAX_OUTPUT 18
100#define STEPDOWN8_MIN_OUTPUT 3
106#define STEPDOWN8_PIN_STATE_HIGH 0x01
107#define STEPDOWN8_PIN_STATE_LOW 0x00
114#define STEPDOWN8_ADDR_A2A1A0_000 0x28
115#define STEPDOWN8_ADDR_A2A1A0_001 0x29
116#define STEPDOWN8_ADDR_A2A1A0_010 0x2A
117#define STEPDOWN8_ADDR_A2A1A0_011 0x2B
118#define STEPDOWN8_ADDR_A2A1A0_100 0x2C
119#define STEPDOWN8_ADDR_A2A1A0_101 0x2D
120#define STEPDOWN8_ADDR_A2A1A0_110 0x2E
121#define STEPDOWN8_ADDR_A2A1A0_111 0x2F
139#define STEPDOWN8_MAP_MIKROBUS( cfg, mikrobus ) \
140 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
141 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
142 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
143 cfg.sps = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
144 cfg.pg = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t stepdown8_set_wiper_pos(stepdown8_t *ctx, uint16_t wiper_pos)
Step Down 8 set wiper position.
err_t stepdown8_default_cfg(stepdown8_t *ctx)
Step Down 8 default configuration function.
void stepdown8_set_sps_pin(stepdown8_t *ctx, uint8_t pin_state)
Step Down 8 set SPS pin state function.
void stepdown8_set_en_pin(stepdown8_t *ctx, uint8_t pin_state)
Step Down 8 set EN pin state function.
err_t stepdown8_set_r2_resistance(stepdown8_t *ctx, uint32_t resistance)
Step Down 8 set potentiometer resistance.
uint8_t stepdown8_get_pg_state(stepdown8_t *ctx)
Step Down 8 get PG pin state function.
err_t stepdown8_init(stepdown8_t *ctx, stepdown8_cfg_t *cfg)
Step Down 8 initialization function.
err_t stepdown8_set_output(stepdown8_t *ctx, float voltage)
Step Down 8 set output voltage.
void stepdown8_cfg_setup(stepdown8_cfg_t *cfg)
Step Down 8 configuration object setup function.
stepdown8_return_value_t
Step Down 8 Click return value data.
Definition stepdown8.h:193
@ STEPDOWN8_OK
Definition stepdown8.h:194
@ STEPDOWN8_ERROR
Definition stepdown8.h:195
Step Down 8 Click configuration object.
Definition stepdown8.h:175
uint32_t i2c_speed
Definition stepdown8.h:183
pin_name_t scl
Definition stepdown8.h:176
pin_name_t en
Definition stepdown8.h:179
pin_name_t sps
Definition stepdown8.h:180
pin_name_t sda
Definition stepdown8.h:177
pin_name_t pg
Definition stepdown8.h:181
uint8_t i2c_address
Definition stepdown8.h:184
Step Down 8 Click context object.
Definition stepdown8.h:154
i2c_master_t i2c
Definition stepdown8.h:163
digital_out_t en
Definition stepdown8.h:156
uint8_t slave_address
Definition stepdown8.h:166
digital_out_t sps
Definition stepdown8.h:157
digital_in_t pg
Definition stepdown8.h:160