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 STEPDOWN7_PFM_PWM_MODE 0x00
74#define STEPDOWN7_FORCED_PWM_MODE 0x01
75#define STEPDOWN7_R1_RPROG_ADDRESS 0x00
81#define STEPDOWN7_PIN_STATE_HIGH 0x01
82#define STEPDOWN7_PIN_STATE_LOW 0x00
88#define STEPDOWN7_DIGIPOT_MAX_VALUE 100000ul
89#define STEPDOWN7_DIGIPOT_RESOLUTION 257
90#define STEPDOWN7_ROUND_TO_NEAREST_INT 0.5
91#define STEPDOWN7_R8_VALUE 15000u
92#define STEPDOWN7_1V5_RESISTANCE 17500u
93#define STEPDOWN7_2V5_RESISTANCE 42500u
94#define STEPDOWN7_3V3_RESISTANCE 62500u
101#define STEPDOWN7_OUTPUT_1V5 0
102#define STEPDOWN7_OUTPUT_2V5 1
103#define STEPDOWN7_OUTPUT_3V3 2
110#define STEPDOWN7_ADDR_A2A1A0_000 0x28
111#define STEPDOWN7_ADDR_A2A1A0_001 0x29
112#define STEPDOWN7_ADDR_A2A1A0_010 0x2A
113#define STEPDOWN7_ADDR_A2A1A0_011 0x2B
114#define STEPDOWN7_ADDR_A2A1A0_100 0x2C
115#define STEPDOWN7_ADDR_A2A1A0_101 0x2D
116#define STEPDOWN7_ADDR_A2A1A0_110 0x2E
117#define STEPDOWN7_ADDR_A2A1A0_111 0x2F
135#define STEPDOWN7_MAP_MIKROBUS( cfg, mikrobus ) \
136 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
137 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
138 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
139 cfg.md = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
140 cfg.pg = MIKROBUS( mikrobus, MIKROBUS_INT )
void stepdown7_set_mode(stepdown7_t *ctx, uint8_t mode)
Step Down 5 mode selection function.
err_t stepdown7_set_r1_resistance(stepdown7_t *ctx, uint32_t resistance)
Step Down 7 set potentiometer resistance.
err_t stepdown7_generic_read(stepdown7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Step Down 7 I2C reading function.
err_t stepdown7_set_output(stepdown7_t *ctx, uint8_t voltage)
Step Down 7 set output voltage.
err_t stepdown7_generic_write(stepdown7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Step Down 7 I2C writing function.
err_t stepdown7_init(stepdown7_t *ctx, stepdown7_cfg_t *cfg)
Step Down 7 initialization function.
void stepdown7_set_en(stepdown7_t *ctx, uint8_t en_state)
Step Down 5 set EN pin state function.
uint8_t stepdown7_get_pg_state(stepdown7_t *ctx)
Step Down 5 get PG pin state function.
err_t stepdown7_set_wiper_pos(stepdown7_t *ctx, uint16_t wiper_pos)
Step Down 5 set wiper 1 position.
err_t stepdown7_default_cfg(stepdown7_t *ctx)
Step Down 7 default configuration function.
void stepdown7_cfg_setup(stepdown7_cfg_t *cfg)
Step Down 7 configuration object setup function.
stepdown7_return_value_t
Step Down 7 Click return value data.
Definition stepdown7.h:189
@ STEPDOWN7_OK
Definition stepdown7.h:190
@ STEPDOWN7_ERROR
Definition stepdown7.h:191
Step Down 7 Click configuration object.
Definition stepdown7.h:171
uint32_t i2c_speed
Definition stepdown7.h:179
pin_name_t md
Definition stepdown7.h:176
pin_name_t scl
Definition stepdown7.h:172
pin_name_t en
Definition stepdown7.h:175
pin_name_t sda
Definition stepdown7.h:173
pin_name_t pg
Definition stepdown7.h:177
uint8_t i2c_address
Definition stepdown7.h:180
Step Down 7 Click context object.
Definition stepdown7.h:150
digital_out_t md
Definition stepdown7.h:153
i2c_master_t i2c
Definition stepdown7.h:159
digital_out_t en
Definition stepdown7.h:152
uint8_t slave_address
Definition stepdown7.h:162
digital_in_t pg
Definition stepdown7.h:156