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"
68#define ADC2_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
79#define ADC2_RETVAL uint8_t
82#define ADC2_INIT_ERROR 0xFF
86#define ADC2_VCC_3v3 3300.0
87#define ADC2_VCC_5V 5000.0
88#define ADC2_VCC_4v096 4096.0
94#define ADC2_INTERRUPT_FLAG -4000000
95#define ADC2_OVERFLOW_HIGH_FLAG 3000000
96#define ADC2_OVERFLOW_LOW_FLAG -3000000
#define ADC2_RETVAL
Definition adc2.h:79
void adc2_set_vref(adc2_t *ctx, float vref)
Setting reference voltage.
float adc2_read_adc_data(adc2_t *ctx)
Read adc data function.
void adc2_cfg_setup(adc2_cfg_t *cfg)
Config Object Initialization function.
ADC2_RETVAL adc2_init(adc2_t *ctx, adc2_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition adc2.h:128
spi_master_chip_select_polarity_t cs_polarity
Definition adc2.h:140
pin_name_t sck
Definition adc2.h:133
spi_master_mode_t spi_mode
Definition adc2.h:139
pin_name_t mosi
Definition adc2.h:132
uint32_t spi_speed
Definition adc2.h:138
pin_name_t miso
Definition adc2.h:131
pin_name_t cs
Definition adc2.h:134
Click ctx object definition.
Definition adc2.h:110
digital_out_t cs
Definition adc2.h:111
uint8_t ovf_l
Definition adc2.h:120
spi_master_t spi
Definition adc2.h:115
float vref
Definition adc2.h:118
uint8_t ovf_h
Definition adc2.h:119
pin_name_t chip_select
Definition adc2.h:116