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 ADC14_MEASURE_NUM 100
75#define ADC14_RESOLUTION_12BIT 0x0FFFu
76#define ADC14_RES_DIVIDER 4096.0f
77#define ADC14_CONVERT_V_T_MV 1000.0f
83#define ADC14_INT_VREF_2_048V 2.048f
89#define ADC14_EXT_VREF_0V 0.0f
90#define ADC14_EXT_VREF_3_3V 3.3f
97#define ADC14_MEASURE_NUM 100
107#define ADC14_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
108#define ADC14_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
126#define ADC14_MAP_MIKROBUS( cfg, mikrobus ) \
127 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
128 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
129 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
130 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
131 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_PWM )
adc14_return_value_t
ADC 14 Click return value data.
Definition adc14.h:183
@ ADC14_ERROR
Definition adc14.h:185
@ ADC14_OK
Definition adc14.h:184
err_t adc14_read_conversion_data(adc14_t *ctx, uint16_t *adc_data)
ADC 14 read conversion data function.
err_t adc14_get_voltage(adc14_t *ctx, float *voltage)
ADC 14 get voltage function.
err_t adc14_init(adc14_t *ctx, adc14_cfg_t *cfg)
ADC 14 initialization function.
void adc14_cfg_setup(adc14_cfg_t *cfg)
ADC 14 configuration object setup function.
err_t adc14_set_vref(adc14_t *ctx, float vref)
ADC 14 set voltage reference function.
void adc14_device_shutdown(adc14_t *ctx)
ADC 14 device shutdown function.
void adc14_device_power_up(adc14_t *ctx)
ADC 14 device shutdown function.
This file contains SPI specific macros, functions, etc.
ADC 14 Click configuration object.
Definition adc14.h:159
float vref
Definition adc14.h:174
spi_master_chip_select_polarity_t cs_polarity
Definition adc14.h:172
pin_name_t sck
Definition adc14.h:163
spi_master_mode_t spi_mode
Definition adc14.h:171
pin_name_t mosi
Definition adc14.h:162
uint32_t spi_speed
Definition adc14.h:170
pin_name_t shd
Definition adc14.h:167
pin_name_t miso
Definition adc14.h:161
pin_name_t cs
Definition adc14.h:164
ADC 14 Click context object.
Definition adc14.h:141
spi_master_t spi
Definition adc14.h:146
float vref
Definition adc14.h:150
pin_name_t chip_select
Definition adc14.h:148
digital_out_t shd
Definition adc14.h:143