Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define DIFFPRESS2_CMD_START_CONT_MEAS_MASS_FLOW_AVG 0x3603
60 #define DIFFPRESS2_CMD_START_CONT_MEAS_MASS_FLOW_NONE 0x3608
61 #define DIFFPRESS2_CMD_START_CONT_MEAS_DIFF_PRESS_AVG 0x3615
62 #define DIFFPRESS2_CMD_START_CONT_MEAS_DIFF_PRESS_NONE 0x361E
63 #define DIFFPRESS2_CMD_STOP_CONT_MEAS 0x3FF9
64 #define DIFFPRESS2_CMD_TRIGGER_MEAS_MASS_FLOW 0x3624
65 #define DIFFPRESS2_CMD_TRIGGER_MEAS_MASS_FLOW_STRETCH 0x3726
66 #define DIFFPRESS2_CMD_TRIGGER_MEAS_DIFF_PRESS 0x362F
67 #define DIFFPRESS2_CMD_TRIGGER_MEAS_DIFF_PRESS_STRETCH 0x372D
68 #define DIFFPRESS2_CMD_PRODUCT_ID_PT1 0x367C
69 #define DIFFPRESS2_CMD_PRODUCT_ID_PT2 0xE102
87 #define DIFFPRESS2_PRODUCT_ID 0x03010101
88 #define DIFFPRESS2_PRESSURE_SCALE_FACOTR 60.0
89 #define DIFFPRESS2_TEMPERATURE_SCALE_FACOTR 200.0
96 #define DIFFPRESS2_SET_DEV_ADDR_GND 0x21
97 #define DIFFPRESS2_SET_DEV_ADDR_R4 0x22
98 #define DIFFPRESS2_SET_DEV_ADDR DIFFPRESS2_SET_DEV_ADDR_R4
116 #define DIFFPRESS2_MAP_MIKROBUS( cfg, mikrobus ) \
117 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
118 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
119 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
131 digital_in_t int_pin;
137 uint8_t slave_address;
141 uint32_t serial_id[ 2 ];
308 float *diff_press,
float *temperature );
313 #endif // DIFFPRESS2_H
err_t diffpress2_default_cfg(diffpress2_t *ctx)
Diff Press 2 default configuration function.
err_t diffpress2_raw_read(diffpress2_t *ctx, uint16_t *rx_buf, uint8_t rx_len)
Reading function.
err_t diffpress2_generic_read(diffpress2_t *ctx, uint16_t cmd, uint16_t *rx_buf, uint8_t rx_len)
Command reading function.
err_t diffpress2_init(diffpress2_t *ctx, diffpress2_cfg_t *cfg)
Diff Press 2 initialization function.
Definition: diffpress2.h:166
Diff Press 2 Click context object.
Definition: diffpress2.h:127
Definition: diffpress2.h:167
err_t diffpress2_reset(diffpress2_t *ctx)
Reset device.
err_t diffpress2_trigger_measurement(diffpress2_t *ctx, uint16_t trigger_type, float *diff_press, float *temperature)
Pressure and temperature reading.
err_t diffpress2_send_command(diffpress2_t *ctx, uint16_t cmd)
Command writing function.
err_t diffpress2_get_id(diffpress2_t *ctx)
Reads device ID's.
diffpress2_return_value_t
Diff Press 2 Click return value data.
Definition: diffpress2.h:164
void diffpress2_cfg_setup(diffpress2_cfg_t *cfg)
Diff Press 2 configuration object setup function.
Diff Press 2 Click configuration object.
Definition: diffpress2.h:148