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"
74#define ADC19_INPUT_CHANNEL_1 1
75#define ADC19_INPUT_CHANNEL_2 2
81#define ADC19_RESOLUTION_12BIT 0x0FFF
82#define ADC19_VREF_3V3 3.3
83#define ADC19_VREF_5V 5.0
93#define ADC19_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
94#define ADC19_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
112#define ADC19_MAP_MIKROBUS( cfg, mikrobus ) \
113 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
114 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
115 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
116 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
adc19_return_value_t
ADC 19 Click return value data.
Definition adc19.h:160
@ ADC19_OK
Definition adc19.h:161
@ ADC19_ERROR
Definition adc19.h:162
void adc19_cfg_setup(adc19_cfg_t *cfg)
ADC 19 configuration object setup function.
err_t adc19_init(adc19_t *ctx, adc19_cfg_t *cfg)
ADC 19 initialization function.
err_t adc19_get_voltage(adc19_t *ctx, float *voltage)
ADC 19 get voltage function.
err_t adc19_set_input_channel(adc19_t *ctx, uint8_t input_ch)
ADC 19 set input channel function.
void adc19_set_vref(adc19_t *ctx, float vref)
ADC 19 set vref function.
This file contains SPI specific macros, functions, etc.
ADC 19 Click configuration object.
Definition adc19.h:141
spi_master_chip_select_polarity_t cs_polarity
Definition adc19.h:151
pin_name_t sck
Definition adc19.h:145
spi_master_mode_t spi_mode
Definition adc19.h:150
pin_name_t mosi
Definition adc19.h:144
uint32_t spi_speed
Definition adc19.h:149
pin_name_t miso
Definition adc19.h:143
pin_name_t cs
Definition adc19.h:146
ADC 19 Click context object.
Definition adc19.h:126
spi_master_t spi
Definition adc19.h:128
float vref
Definition adc19.h:132
pin_name_t chip_select
Definition adc19.h:130