Go to the documentation of this file.
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 PRESS_REG_INTERRUPT_CFG 0x0B
74 #define PRESS_REG_THS_P_L 0x0C
75 #define PRESS_REG_THS_P_H 0x0D
76 #define PRESS_REG_IF_CTRL 0x0E
77 #define PRESS_REG_WHO_AM_I 0x0F
78 #define PRESS_REG_CTRL_REG1 0x10
79 #define PRESS_REG_CTRL_REG2 0x11
80 #define PRESS_REG_CTRL_REG3 0x12
81 #define PRESS_REG_FIFO_CTRL 0x14
82 #define PRESS_REG_FIFO_WTM 0x15
83 #define PRESS_REG_REF_P_L 0x16
84 #define PRESS_REG_REF_P_H 0x17
85 #define PRESS_REG_I3C_IF_CTRL 0x19
86 #define PRESS_REG_RPDS_L 0x1A
87 #define PRESS_REG_RPDS_H 0x1B
88 #define PRESS_REG_INT_SOURCE 0x24
89 #define PRESS_REG_FIFO_STATUS1 0x25
90 #define PRESS_REG_FIFO_STATUS2 0x26
91 #define PRESS_REG_STATUS 0x27
92 #define PRESS_REG_PRESSURE_OUT_XL 0x28
93 #define PRESS_REG_PRESSURE_OUT_L 0x29
94 #define PRESS_REG_PRESSURE_OUT_H 0x2A
95 #define PRESS_REG_TEMP_OUT_L 0x2B
96 #define PRESS_REG_TEMP_OUT_H 0x2C
97 #define PRESS_REG_FIFO_DATA_OUT_PRESS_XL 0x78
98 #define PRESS_REG_FIFO_DATA_OUT_PRESS_L 0x79
99 #define PRESS_REG_FIFO_DATA_OUT_PRESS_H 0x7A
117 #define PRESS_WHO_AM_I 0xB4
123 #define PRESS_ODR_PWR_DOWN_ONE_SHOT 0x00
124 #define PRESS_ODR_1HZ 0x08
125 #define PRESS_ODR_4HZ 0x10
126 #define PRESS_ODR_10HZ 0x18
127 #define PRESS_ODR_25HZ 0x20
128 #define PRESS_ODR_50HZ 0x28
129 #define PRESS_ODR_75HZ 0x30
130 #define PRESS_ODR_100HZ 0x38
131 #define PRESS_ODR_200HZ 0x40
132 #define PRESS_ODR_BIT_MASK 0x78
133 #define PRESS_AVG_4 0x00
134 #define PRESS_AVG_8 0x01
135 #define PRESS_AVG_16 0x02
136 #define PRESS_AVG_32 0x03
137 #define PRESS_AVG_64 0x04
138 #define PRESS_AVG_128 0x05
139 #define PRESS_AVG_512 0x07
140 #define PRESS_AVG_BIT_MASK 0x07
146 #define PRESS_BOOT_NORMAL_MODE 0x00
147 #define PRESS_REBOOT_MEMORY_CONTENT 0x80
148 #define PRESS_FS_MODE_1_1260HPA 0x00
149 #define PRESS_FS_MODE_2_4060HPA 0x40
150 #define PRESS_LFPF_CFG_ODR_4 0x00
151 #define PRESS_LFPF_CFG_ODR_9 0x20
152 #define PRESS_DISABLE_LPFP 0x00
153 #define PRESS_ENABLE_LPFP 0x10
154 #define PRESS_BDU_CONTINUOUS 0x00
155 #define PRESS_BDU_MSB_LSB_READ 0x08
156 #define PRESS_SW_RESET 0x04
157 #define PRESS_ONESHOT_IDLE 0x00
158 #define PRESS_ONESHOT_NEW_DATA 0x01
164 #define PRESS_REBOOT_AH_QVAR_EN 0x80
165 #define PRESS_REBOOT_AH_QVAR_DIS 0x00
166 #define PRESS_REBOOT_AH_QVAR_P_AUTO_EN 0x20
167 #define PRESS_REBOOT_AH_QVAR_P_AUTO_DIS 0x00
168 #define PRESS_REBOOT_IF_ADD_INC_EN 0x01
169 #define PRESS_REBOOT_IF_ADD_INC_DIS 0x00
175 #define PRESS_TRIG_F_MODE_BYPASS 0x00
176 #define PRESS_TRIG_F_MODE_FIFO 0x01
177 #define PRESS_TRIG_F_MODE_CONT 0x02
178 #define PRESS_TRIG_F_MODE_BYPASS_FIFO 0x05
179 #define PRESS_TRIG_F_MODE_BYPASS_CONT 0x06
180 #define PRESS_TRIG_F_MODE_CONT_FIFO 0x07
186 #define PRESS_STATUS_TEMP_OVERRUN 0x20
187 #define PRESS_STATUS_PRESS_OVERRUN 0x10
188 #define PRESS_STATUS_TEMP_AVAILABLE 0x02
189 #define PRESS_STATUS_PRESS_AVAILABLE 0x01
195 #define PRESS_AH_QVAR_DISABLE 0x00
196 #define PRESS_AH_QVAR_ENABLE 0x01
202 #define PRESS_LSB_HPA_FS_MODE_4096 4096.0f
203 #define PRESS_LSB_HPA_FS_MODE_2048 2048.0f
204 #define PRESS_TEMP_SENS 100.0f
205 #define PRESS_QVAR_GAIN_LSB_MV 426000.0f
212 #define PRESS_DEVICE_ADDRESS 0x5C
230 #define PRESS_MAP_MIKROBUS( cfg, mikrobus ) \
231 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
232 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
i2c_master_t i2c
Definition: press.h:245
PRESS Click configuration object.
Definition: press.h:257
err_t press_reg_read(press_t *ctx, uint8_t reg, uint8_t *data_out)
PRESS I2C register reading function.
@ PRESS_ERROR
Definition: press.h:273
press_return_value_t
PRESS Click return value data.
Definition: press.h:271
pin_name_t sda
Definition: press.h:259
err_t press_get_raw_data(press_t *ctx, uint32_t *press_data, uint32_t *qvar_data, uint16_t *temp_data)
PRESS gets the raw data function.
err_t press_generic_read(press_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
PRESS I2C reading function.
uint8_t i2c_address
Definition: press.h:262
err_t press_sw_reset(press_t *ctx)
PRESS software reset function.
err_t press_generic_write(press_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
PRESS I2C writing function.
err_t press_config_ah_qvar(press_t *ctx, uint8_t ah_qvar_en)
PRESS config AH and Qva function.
err_t press_reg_write(press_t *ctx, uint8_t reg, uint8_t data_in)
PRESS I2C register writing function.
void press_cfg_setup(press_cfg_t *cfg)
PRESS configuration object setup function.
err_t press_get_ah_qvar_data(press_t *ctx, float *ah_qvar)
PRESS gets the AH/Qvar data function.
uint8_t slave_address
Definition: press.h:248
err_t press_get_measurement_data(press_t *ctx, float *pressure, float *temperature)
PRESS gets the measurement data function.
@ PRESS_OK
Definition: press.h:272
PRESS Click context object.
Definition: press.h:242
pin_name_t scl
Definition: press.h:258
err_t press_init(press_t *ctx, press_cfg_t *cfg)
PRESS initialization function.
err_t press_default_cfg(press_t *ctx)
PRESS default configuration function.
uint32_t i2c_speed
Definition: press.h:261