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 ADC21_CHANNEL_0 0
75#define ADC21_CHANNEL_1 1
76#define ADC21_CHANNEL_2 2
77#define ADC21_CHANNEL_3 3
78#define ADC21_CHANNEL_4 4
79#define ADC21_CHANNEL_5 5
80#define ADC21_CHANNEL_6 6
81#define ADC21_CHANNEL_7 7
87#define ADC21_DATA_RESOLUTION 0x0FFF
88#define ADC21_AVCC_3V3 3.3
89#define ADC21_AVCC_5V 5.0
99#define ADC21_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
100#define ADC21_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
118#define ADC21_MAP_MIKROBUS( cfg, mikrobus ) \
119 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
120 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
121 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
122 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
adc21_return_value_t
ADC 21 Click return value data.
Definition adc21.h:164
@ ADC21_ERROR
Definition adc21.h:166
@ ADC21_OK
Definition adc21.h:165
err_t adc21_init(adc21_t *ctx, adc21_cfg_t *cfg)
ADC 21 initialization function.
err_t adc21_read_raw_adc(adc21_t *ctx, uint8_t channel, uint16_t *raw_adc)
ADC 21 read raw adc function.
void adc21_cfg_setup(adc21_cfg_t *cfg)
ADC 21 configuration object setup function.
err_t adc21_read_voltage(adc21_t *ctx, uint8_t channel, float avcc, float *voltage)
ADC 21 read voltage function.
This file contains SPI specific macros, functions, etc.
ADC 21 Click configuration object.
Definition adc21.h:145
spi_master_chip_select_polarity_t cs_polarity
Definition adc21.h:155
pin_name_t sck
Definition adc21.h:149
spi_master_mode_t spi_mode
Definition adc21.h:154
pin_name_t mosi
Definition adc21.h:148
uint32_t spi_speed
Definition adc21.h:153
pin_name_t miso
Definition adc21.h:147
pin_name_t cs
Definition adc21.h:150
ADC 21 Click context object.
Definition adc21.h:132
spi_master_t spi
Definition adc21.h:134
pin_name_t chip_select
Definition adc21.h:136