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 DIGIPOT13_CMD_VREG 0x11
74#define DIGIPOT13_CMD_NVREG 0x21
75#define DIGIPOT13_CMD_VREGxNVREG 0x51
76#define DIGIPOT13_CMD_NVREGxVREG 0x61
94#define DIGIPOT13_WIPER_POS_MIN 0
95#define DIGIPOT13_WIPER_POS_MIDDLE 127
96#define DIGIPOT13_WIPER_POS_MAX 255
97#define DIGIPOT13_RES_0_KOHM 0
98#define DIGIPOT13_RES_50_KOHM 50
99#define DIGIPOT13_RES_200_KOHM 200
106#define DIGIPOT13_DEVICE_ADDRESS_GND 0x28
107#define DIGIPOT13_DEVICE_ADDRESS_VCC 0x29
125#define DIGIPOT13_MAP_MIKROBUS( cfg, mikrobus ) \
126 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
127 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
digipot13_return_value_t
DIGI POT 13 Click return value data.
Definition digipot13.h:164
@ DIGIPOT13_OK
Definition digipot13.h:165
@ DIGIPOT13_ERROR
Definition digipot13.h:166
digipot13_cfg_res_t
DIGI POT 13 Click resistance configuration value data.
Definition digipot13.h:175
@ DIGIPOT13_CFG_RES_WH
Definition digipot13.h:177
@ DIGIPOT13_CFG_RES_WL
Definition digipot13.h:176
err_t digipot13_set_wiper_pos(digipot13_t *ctx, uint8_t wiper_pos)
DIGI POT 13 set the wiper position function.
err_t digipot13_switch_v_to_nv(digipot13_t *ctx)
DIGI POT 13 data transfers volatile to nonvolatile function.
void digipot13_cfg_setup(digipot13_cfg_t *cfg)
DIGI POT 13 configuration object setup function.
err_t digipot13_set_resistance(digipot13_t *ctx, digipot13_cfg_res_t cfg_res, float res_kohm)
DIGI POT 13 set the resistance function.
err_t digipot13_default_cfg(digipot13_t *ctx)
DIGI POT 13 default configuration function.
err_t digipot13_write_data(digipot13_t *ctx, uint8_t cmd, uint8_t data_in)
DIGI POT 13 write data function.
err_t digipot13_init(digipot13_t *ctx, digipot13_cfg_t *cfg)
DIGI POT 13 initialization function.
err_t digipot13_switch_nv_to_v(digipot13_t *ctx)
DIGI POT 13 data transfers nonvolatile to volatile function.
DIGI POT 13 Click configuration object.
Definition digipot13.h:150
uint32_t i2c_speed
Definition digipot13.h:154
pin_name_t scl
Definition digipot13.h:151
pin_name_t sda
Definition digipot13.h:152
uint8_t i2c_address
Definition digipot13.h:155
DIGI POT 13 Click context object.
Definition digipot13.h:136
i2c_master_t i2c
Definition digipot13.h:138
uint8_t slave_address
Definition digipot13.h:141