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"
67#define DIFFPRESSURE_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define DIFFPRESSURE_OK 0
80#define DIFFPRESSURE_ERROR -1
int32_t diffpressure_get_pa_difference(diffpressure_t *ctx, float adc_voltage)
Get pressure difference [Pa] function.
float diffpressure_read_adc_voltage(diffpressure_t *ctx)
Read adc voltage function.
err_t diffpressure_init(diffpressure_t *ctx, diffpressure_cfg_t *cfg)
Initialization function.
void diffpressure_cfg_setup(diffpressure_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition diffpressure.h:107
spi_master_chip_select_polarity_t cs_polarity
Definition diffpressure.h:117
pin_name_t sck
Definition diffpressure.h:111
spi_master_mode_t spi_mode
Definition diffpressure.h:116
pin_name_t mosi
Definition diffpressure.h:110
uint32_t spi_speed
Definition diffpressure.h:115
pin_name_t miso
Definition diffpressure.h:109
pin_name_t cs
Definition diffpressure.h:112
Click ctx object definition.
Definition diffpressure.h:94
spi_master_t spi
Definition diffpressure.h:96
pin_name_t chip_select
Definition diffpressure.h:99