42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_spi_master.h"
65#define ADC_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
67 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
68 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
69 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
82#define ADC_RETVAL uint8_t
85#define ADC_INIT_ERROR 0xFF
90#define ADC_VREF_3300MV 3300
91#define ADC_VREF_4096MV 4096
92#define ADC_VREF_5000MV 5000
97#define ADC_CH0_OR_CH01 0x00
98#define ADC_CH1_OR_CH10 0x01
99#define ADC_CH2_OR_CH23 0x02
100#define ADC_CH3_OR_CH32 0x03
uint16_t adc_get_single_ended_ch(adc_t *ctx, uint8_t channel)
Get Single-Ended Channel function.
uint16_t adc_get_differential_ch(adc_t *ctx, uint8_t channel)
Get Pseudo-Differential Pair function.
void adc_cfg_setup(adc_cfg_t *cfg)
Configuration Object Setup function.
ADC_RETVAL adc_init(adc_t *ctx, adc_cfg_t *cfg)
Click Initialization function.
#define ADC_RETVAL
Click error code definition.
Definition adc.h:82
Click configuration structure definition.
Definition adc.h:134
spi_master_chip_select_polarity_t cs_polarity
Definition adc.h:144
pin_name_t sck
Definition adc.h:138
spi_master_mode_t spi_mode
Definition adc.h:143
uint16_t vref
Definition adc.h:147
pin_name_t mosi
Definition adc.h:137
uint32_t spi_speed
Definition adc.h:142
pin_name_t miso
Definition adc.h:136
pin_name_t cs
Definition adc.h:139
Click context object definition.
Definition adc.h:106
digital_out_t cs
Definition adc.h:107
spi_master_t spi
Definition adc.h:110
uint16_t ch2
Definition adc.h:116
uint16_t ch3
Definition adc.h:117
uint16_t ch10
Definition adc.h:121
uint16_t ch23
Definition adc.h:122
uint16_t ch1
Definition adc.h:115
uint16_t vref
Definition adc.h:126
uint16_t ch01
Definition adc.h:120
uint16_t ch0
Definition adc.h:114
pin_name_t chip_select
Definition adc.h:111
uint16_t ch32
Definition adc.h:123