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_i2c_master.h"
73#define PRESSURE14_STATUS_PWR_IND 0x40
74#define PRESSURE14_STATUS_BUSY_FLAG 0x20
75#define PRESSURE14_STATUS_ERR_FLAG 0x04
76#define PRESSURE14_STATUS_MATH_SAT 0x01
89#define PRESSURE14_CONV_UNIT_PSI 0x00
90#define PRESSURE14_CONV_UNIT_PASCAL 0x01
91#define PRESSURE14_CONV_UNIT_KILOPASCAL 0x02
92#define PRESSURE14_CONV_UNIT_MMHG 0x03
93#define PRESSURE14_CONV_UNIT_INHG 0x04
94#define PRESSURE14_CONV_UNIT_ATMOSPHERIC 0x05
95#define PRESSURE14_CONV_UNIT_MILIBAR 0x06
96#define PRESSURE14_CONV_UNIT_BAR 0x07
108#define PRESSURE14_CONV_UNIT_CELSIUS 0x00
109#define PRESSURE14_CONV_UNIT_KELVIN 0x01
110#define PRESSURE14_CONV_UNIT_FAHRENHEIT 0x02
123#define PRESSURE14_CONST_PSI 1.00000
124#define PRESSURE14_CONST_PASCAL 6894.76
125#define PRESSURE14_CONST_KILOPASCAL 6.89476
126#define PRESSURE14_CONST_MMHG 51.7149
127#define PRESSURE14_CONST_INHG 2.03602
128#define PRESSURE14_CONST_ATMOSPHERIC 0.06805
129#define PRESSURE14_CONST_MILIBAR 68.9500
130#define PRESSURE14_CONST_BAR 0.06895
142#define PRESSURE14_CONST_ADDI_CELS 0.00000
143#define PRESSURE14_CONST_MULT_CELS 1.00000
144#define PRESSURE14_CONST_ADDI_KELV 273.150
145#define PRESSURE14_CONST_MULT_KELV 1.00000
146#define PRESSURE14_CONST_ADDI_FAHR 32.0000
147#define PRESSURE14_CONST_MULT_FAHR 1.80000
159#define PRESSURE14_CONST_PRESS_OUT_MIN 1677722.00
160#define PRESSURE14_CONST_PRESS_OUT_MAX 13421772.0
161#define PRESSURE14_CONST_PRESS_VAL_MIN 0.00000000
162#define PRESSURE14_CONST_PRESS_VAL_MAX 60.0000000
163#define PRESSURE14_CONST_TEMP_MIN -50.000000
164#define PRESSURE14_CONST_TEMP_MAX 150.000000
165#define PRESSURE14_CONST_TEMP_OUT_MAX 16777215.0
167#define PRESSURE14_CMD_OUT_MEAS 0xAA
168#define PRESSURE14_CMD_DUMMY 0x00
193#define PRESSURE14_SET_DEV_ADDR 0x28
211#define PRESSURE14_MAP_MIKROBUS( cfg, mikrobus ) \
212 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
213 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
214 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
uint8_t pressure14_check_busy_flag_int(pressure14_t *ctx)
Pressure 14 checks INT pin state function.
err_t pressure14_generic_write(pressure14_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Pressure 14 I2C writing function.
err_t pressure14_generic_read(pressure14_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Pressure 14 I2C reading function.
float pressure14_get_temperature(uint32_t temperature_raw, uint8_t conv_unit)
Pressure 14 calculate temperature function.
void pressure14_read_press_and_temp(pressure14_t *ctx, uint8_t *status_byte, uint32_t *pressure_data, uint32_t *temp_data)
Pressure 14 read pressure and temperature function.
float pressure14_get_pressure(uint32_t pressure_raw, uint8_t conv_unit)
Pressure 14 calculate pressure function.
err_t pressure14_init(pressure14_t *ctx, pressure14_cfg_t *cfg)
Pressure 14 initialization function.
void pressure14_cfg_setup(pressure14_cfg_t *cfg)
Pressure 14 configuration object setup function.
void pressure14_measure_cmd(pressure14_t *ctx)
Pressure 14 output Measurement Command function.
pressure14_return_value_t
Pressure 14 Click return value data.
Definition pressure14.h:257
@ PRESSURE14_ERROR
Definition pressure14.h:259
@ PRESSURE14_OK
Definition pressure14.h:258
Pressure 14 Click configuration object.
Definition pressure14.h:241
uint32_t i2c_speed
Definition pressure14.h:247
pin_name_t scl
Definition pressure14.h:242
pin_name_t int_pin
Definition pressure14.h:245
pin_name_t sda
Definition pressure14.h:243
uint8_t i2c_address
Definition pressure14.h:248
Pressure 14 Click context object.
Definition pressure14.h:224
digital_in_t int_pin
Definition pressure14.h:226
i2c_master_t i2c
Definition pressure14.h:229
uint8_t slave_address
Definition pressure14.h:232