42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_analog_in.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
66#define AMMONIA_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN )
79#define AMMONIA_INIT_ERROR (-1)
218 // End click Driver group
err_t ammonia_read_signal_voltage(ammonia_t *ctx, float *data_out)
Measurement Voltage Read function.
void ammonia_cfg_setup(ammonia_cfg_t *cfg)
Config Object Initialization function.
err_t ammonia_init(ammonia_t *ctx, ammonia_cfg_t *cfg)
Initialization function.
err_t ammonia_read_measurement(ammonia_t *ctx, uint16_t *data_out)
Measurement Read function.
ammonia_adc_sel_t
Click AD conversion type selectors.
Definition ammonia.h:93
@ AMMONIA_ADC_SEL_SPI
Definition ammonia.h:95
@ AMMONIA_ADC_SEL_AN
Definition ammonia.h:94
spi_master_t spi
Definition ammonia.h:111
analog_in_resolution_t resolution
Definition ammonia.h:144
float vref
Definition ammonia.h:145
digital_in_t miso
Definition ammonia.h:107
spi_master_chip_select_polarity_t cs_polarity
Definition ammonia.h:140
pin_name_t sck
Definition ammonia.h:129
spi_master_mode_t spi_mode
Definition ammonia.h:139
pin_name_t mosi
Definition ammonia.h:128
uint32_t spi_speed
Definition ammonia.h:138
pin_name_t miso
Definition ammonia.h:127
analog_in_t an
Definition ammonia.h:106
pin_name_t chip_select
Definition ammonia.h:112
ammonia_adc_sel_t adc_sel
Definition ammonia.h:116
pin_name_t an
Definition ammonia.h:134
pin_name_t cs
Definition ammonia.h:130
Click configuration structure definition.
Definition ammonia.h:124
Click ctx object definition.
Definition ammonia.h:103