42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
67#define POT3_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.vo = MIKROBUS( mikrobus, MIKROBUS_AN )
79#define POT3_RETVAL uint8_t
82#define POT3_INIT_ERROR 0xFF
90#define POT3_VREF_3V3 1
#define POT3_RETVAL
Definition pot3.h:79
uint16_t pot3_get_vout(pot3_t *ctx, uint8_t vref_sel, uint16_t n_samples)
ADC Averaged Read function.
uint16_t pot3_read_adc(pot3_t *ctx)
ADC Read function
uint16_t pot3_read_avg_adc(pot3_t *ctx, uint16_t n_samples)
ADC Averaged Read function.
POT3_RETVAL pot3_init(pot3_t *ctx, pot3_cfg_t *cfg)
Initialization function.
void pot3_cfg_setup(pot3_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition pot3.h:123
uint8_t spi_mode
Definition pot3.h:138
spi_master_chip_select_polarity_t cs_polarity
Definition pot3.h:139
pin_name_t sck
Definition pot3.h:128
pin_name_t mosi
Definition pot3.h:127
uint32_t spi_speed
Definition pot3.h:137
pin_name_t vo
Definition pot3.h:133
pin_name_t miso
Definition pot3.h:126
pin_name_t cs
Definition pot3.h:129
Click ctx object definition.
Definition pot3.h:105
digital_out_t cs
Definition pot3.h:106
digital_in_t vo
Definition pot3.h:110
spi_master_t spi
Definition pot3.h:114
pin_name_t chip_select
Definition pot3.h:115