Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define DIGIPOT13_CMD_VREG 0x11
70 #define DIGIPOT13_CMD_NVREG 0x21
71 #define DIGIPOT13_CMD_VREGxNVREG 0x51
72 #define DIGIPOT13_CMD_NVREGxVREG 0x61
90 #define DIGIPOT13_WIPER_POS_MIN 0
91 #define DIGIPOT13_WIPER_POS_MIDDLE 127
92 #define DIGIPOT13_WIPER_POS_MAX 255
93 #define DIGIPOT13_RES_0_KOHM 0
94 #define DIGIPOT13_RES_50_KOHM 50
95 #define DIGIPOT13_RES_200_KOHM 200
102 #define DIGIPOT13_DEVICE_ADDRESS_GND 0x28
103 #define DIGIPOT13_DEVICE_ADDRESS_VCC 0x29
121 #define DIGIPOT13_MAP_MIKROBUS( cfg, mikrobus ) \
122 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
123 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
304 #endif // DIGIPOT13_H
i2c_master_t i2c
Definition: digipot13.h:134
uint8_t slave_address
Definition: digipot13.h:137
pin_name_t scl
Definition: digipot13.h:147
err_t digipot13_init(digipot13_t *ctx, digipot13_cfg_t *cfg)
DIGI POT 13 initialization function.
@ DIGIPOT13_ERROR
Definition: digipot13.h:162
err_t digipot13_default_cfg(digipot13_t *ctx)
DIGI POT 13 default configuration function.
@ DIGIPOT13_CFG_RES_WL
Definition: digipot13.h:172
err_t digipot13_switch_v_to_nv(digipot13_t *ctx)
DIGI POT 13 data transfers volatile to nonvolatile function.
err_t digipot13_set_wiper_pos(digipot13_t *ctx, uint8_t wiper_pos)
DIGI POT 13 set the wiper position function.
digipot13_cfg_res_t
DIGI POT 13 Click resistance configuration value data.
Definition: digipot13.h:171
err_t digipot13_set_resistance(digipot13_t *ctx, digipot13_cfg_res_t cfg_res, float res_kohm)
DIGI POT 13 set the resistance function.
DIGI POT 13 Click context object.
Definition: digipot13.h:132
@ DIGIPOT13_OK
Definition: digipot13.h:161
@ DIGIPOT13_CFG_RES_WH
Definition: digipot13.h:173
uint32_t i2c_speed
Definition: digipot13.h:150
uint8_t i2c_address
Definition: digipot13.h:151
pin_name_t sda
Definition: digipot13.h:148
err_t digipot13_switch_nv_to_v(digipot13_t *ctx)
DIGI POT 13 data transfers nonvolatile to volatile function.
err_t digipot13_write_data(digipot13_t *ctx, uint8_t cmd, uint8_t data_in)
DIGI POT 13 write data function.
DIGI POT 13 Click configuration object.
Definition: digipot13.h:146
digipot13_return_value_t
DIGI POT 13 Click return value data.
Definition: digipot13.h:160
void digipot13_cfg_setup(digipot13_cfg_t *cfg)
DIGI POT 13 configuration object setup function.