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_spi_master.h"
52#include "drv_analog_in.h"
74#define DIGIPOT8_REG_RDAC1 0x00
75#define DIGIPOT8_REG_RDAC2 0x01
76#define DIGIPOT8_REG_RDAC3 0x02
77#define DIGIPOT8_REG_RDAC4 0x03
78#define DIGIPOT8_REG_RDAC5 0x04
79#define DIGIPOT8_REG_RDAC6 0x05
97#define DIGIPOT8_WIPER_POSITION_MIN 0x00
98#define DIGIPOT8_WIPER_POSITION_MAX 0xFF
116#define DIGIPOT8_MAP_MIKROBUS( cfg, mikrobus ) \
117 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
118 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
119 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
120 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
121 cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN ); \
digipot8_return_value_t
DIGI POT 8 Click return value data.
Definition digipot8.h:173
@ DIGIPOT8_OK
Definition digipot8.h:174
@ DIGIPOT8_ERROR
Definition digipot8.h:175
err_t digipot8_write_data(digipot8_t *ctx, uint8_t reg, uint8_t data_in)
DIGI POT 8 write data function.
err_t digipot8_set_wiper_6(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 6 function.
float digipot8_read_voltage(digipot8_t *ctx)
Generic read function.
err_t digipot8_set_wiper_1(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 1 function.
uint16_t digipot8_generic_read(digipot8_t *ctx)
Generic read function.
err_t digipot8_set_wiper_5(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 5 function.
err_t digipot8_set_wiper_2(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 2 function.
void digipot8_cfg_setup(digipot8_cfg_t *cfg)
DIGI POT 8 configuration object setup function.
err_t digipot8_set_wiper_3(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 3 function.
err_t digipot8_init(digipot8_t *ctx, digipot8_cfg_t *cfg)
DIGI POT 8 initialization function.
err_t digipot8_set_wiper_4(digipot8_t *ctx, uint8_t data_in)
DIGI POT 8 set wiper 4 function.
DIGI POT 8 Click configuration object.
Definition digipot8.h:146
analog_in_resolution_t resolution
Definition digipot8.h:160
float vref
Definition digipot8.h:161
pin_name_t an_pin
Definition digipot8.h:149
spi_master_chip_select_polarity_t cs_polarity
Definition digipot8.h:164
pin_name_t sck
Definition digipot8.h:155
spi_master_mode_t spi_mode
Definition digipot8.h:163
pin_name_t mosi
Definition digipot8.h:154
uint32_t spi_speed
Definition digipot8.h:162
pin_name_t miso
Definition digipot8.h:153
pin_name_t cs
Definition digipot8.h:156
DIGI POT 8 Click context object.
Definition digipot8.h:131
spi_master_t spi
Definition digipot8.h:134
float vref
Definition digipot8.h:136
pin_name_t chip_select
Definition digipot8.h:137
analog_in_t adc
Definition digipot8.h:133