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_analog_in.h"
52#include "drv_i2c_master.h"
74#define DIFFPRESS3_PMIN -100.0f
75#define DIFFPRESS3_PMAX 1000.0f
76#define DIFFPRESS3_ACCP_ABS_MIN -0.3f
77#define DIFFPRESS3_ACCP_ABS_TYP 0.1f
78#define DIFFPRESS3_ACCP_ABS_MAX 0.3f
79#define DIFFPRESS3_ACCP_TOT_MIN -0.5f
80#define DIFFPRESS3_ACCP_TOT_TYP 0.25f
81#define DIFFPRESS3_ACCP_TOT_MAX 0.5f
82#define DIFFPRESS3_SENP 0.04196f
83#define DIFFPRESS3_AN_SENP 275.0f
84#define DIFFPRESS3_ACCP_REP 0.01f
85#define DIFFPRESS3_ACCP_DRIFT 0.05f
86#define DIFFPRESS3_DIG_OUTOFF 5660.0f
87#define DIFFPRESS3_DIG_FSS 26214.0f
88#define DIFFPRESS3_DIG_OUTP_MIN 3207.0f
89#define DIFFPRESS3_DIG_OUTP_MAX 29491.0f
90#define DIFFPRESS3_AN_OUTOFF 0.87f
91#define DIFFPRESS3_AN_FSS 4.0f
92#define DIFFPRESS3_AN_OUTP_MIN 0.5f
93#define DIFFPRESS3_AN_OUTP_MAX 4.5f
94#define DIFFPRESS3_PRES 0x7FFF
100#define DIFFPRESS3_TRANGE_MIN 0.0f
101#define DIFFPRESS3_TRANGE_MAX 70.0f
102#define DIFFPRESS3_TRES 0x7FFF
103#define DIFFPRESS3_SENT 0.004272
104#define DIFFPRESS3_OUTT_MIN 8192.0
105#define DIFFPRESS3_OUTT_MAX 24576.0
111#define DIFFPRESS3_ADC_RESOLUTION 0x7FFF
112#define DIFFPRESS3_VREF_3V3 3.3
113#define DIFFPRESS3_VREF_5V 5.0
120#define DIFFPRESS3_SET_DEV_ADDR 0x78
138#define DIFFPRESS3_MAP_MIKROBUS( cfg, mikrobus ) \
139 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
140 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
141 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
diffpress3_return_value_t
Diff Press 3 Click return value data.
Definition diffpress3.h:224
@ DIFFPRESS3_ERROR
Definition diffpress3.h:226
@ DIFFPRESS3_OK
Definition diffpress3.h:225
diffpress3_d_sel_t
Diff Press 3 Click digital output data selector.
Definition diffpress3.h:173
@ DIFFPRESS3_RAW_DATA_PRESSURE
Definition diffpress3.h:174
@ DIFFPRESS3_RAW_DATA_TEMPERATURE
Definition diffpress3.h:175
diffpress3_drv_t
Diff Press 3 Click driver selector.
Definition diffpress3.h:151
@ DIFFPRESS3_DRV_SEL_ADC
Definition diffpress3.h:152
@ DIFFPRESS3_DRV_SEL_I2C
Definition diffpress3.h:153
diffpress3_an_sel_t
Diff Press 3 Click AN SEL selector value.
Definition diffpress3.h:162
@ DIFFPRESS3_AN_SEL_5V
Definition diffpress3.h:163
@ DIFFPRESS3_AN_SEL_2V5
Definition diffpress3.h:164
void diffpress3_cfg_setup(diffpress3_cfg_t *cfg)
Diff Press 3 configuration object setup function.
void diffpress3_drv_interface_selection(diffpress3_cfg_t *cfg, diffpress3_drv_t drv_sel)
Diff Press 3 driver interface setup function.
err_t diffpress3_set_vref(diffpress3_t *ctx, float vref)
Diff Press 3 set vref function.
err_t diffpress3_read_raw_adc(diffpress3_t *ctx, uint16_t *raw_adc, diffpress3_d_sel_t data_sel)
Diff Press 3 read raw ADC value function.
err_t diffpress3_read_voltage(diffpress3_t *ctx, float *voltage)
Diff Press 3 read voltage level function.
err_t diffpress3_get_pressure(diffpress3_t *ctx, float *pressure)
Diff Press 3 get pressure function.
err_t diffpress3_init(diffpress3_t *ctx, diffpress3_cfg_t *cfg)
Diff Press 3 initialization function.
err_t diffpress3_get_digit_out_data(diffpress3_t *ctx, uint16_t *press_data, uint16_t *temp_data)
Diff Press 3 get digital output data function.
err_t diffpress3_get_temperature(diffpress3_t *ctx, float *temperature)
Diff Press 3 get temperature function.
Diff Press 3 Click configuration object.
Definition diffpress3.h:202
diffpress3_an_sel_t an_sel
Definition diffpress3.h:214
analog_in_resolution_t resolution
Definition diffpress3.h:207
float vref
Definition diffpress3.h:208
diffpress3_drv_t drv_sel
Definition diffpress3.h:213
uint32_t i2c_speed
Definition diffpress3.h:210
pin_name_t scl
Definition diffpress3.h:204
pin_name_t sda
Definition diffpress3.h:205
pin_name_t an
Definition diffpress3.h:203
diffpress3_d_sel_t data_sel
Definition diffpress3.h:215
uint8_t i2c_address
Definition diffpress3.h:211
Diff Press 3 Click context object.
Definition diffpress3.h:184
diffpress3_an_sel_t an_sel
Definition diffpress3.h:192
float vref
Definition diffpress3.h:189
diffpress3_drv_t drv_sel
Definition diffpress3.h:190
i2c_master_t i2c
Definition diffpress3.h:186
uint8_t slave_address
Definition diffpress3.h:188
analog_in_t adc
Definition diffpress3.h:185
diffpress3_d_sel_t data_sel
Definition diffpress3.h:193