Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define PRESS_REG_INTERRUPT_CFG 0x0B
70 #define PRESS_REG_THS_P_L 0x0C
71 #define PRESS_REG_THS_P_H 0x0D
72 #define PRESS_REG_IF_CTRL 0x0E
73 #define PRESS_REG_WHO_AM_I 0x0F
74 #define PRESS_REG_CTRL_REG1 0x10
75 #define PRESS_REG_CTRL_REG2 0x11
76 #define PRESS_REG_CTRL_REG3 0x12
77 #define PRESS_REG_FIFO_CTRL 0x14
78 #define PRESS_REG_FIFO_WTM 0x15
79 #define PRESS_REG_REF_P_L 0x16
80 #define PRESS_REG_REF_P_H 0x17
81 #define PRESS_REG_I3C_IF_CTRL 0x19
82 #define PRESS_REG_RPDS_L 0x1A
83 #define PRESS_REG_RPDS_H 0x1B
84 #define PRESS_REG_INT_SOURCE 0x24
85 #define PRESS_REG_FIFO_STATUS1 0x25
86 #define PRESS_REG_FIFO_STATUS2 0x26
87 #define PRESS_REG_STATUS 0x27
88 #define PRESS_REG_PRESSURE_OUT_XL 0x28
89 #define PRESS_REG_PRESSURE_OUT_L 0x29
90 #define PRESS_REG_PRESSURE_OUT_H 0x2A
91 #define PRESS_REG_TEMP_OUT_L 0x2B
92 #define PRESS_REG_TEMP_OUT_H 0x2C
93 #define PRESS_REG_FIFO_DATA_OUT_PRESS_XL 0x78
94 #define PRESS_REG_FIFO_DATA_OUT_PRESS_L 0x79
95 #define PRESS_REG_FIFO_DATA_OUT_PRESS_H 0x7A
113 #define PRESS_WHO_AM_I 0xB4
119 #define PRESS_ODR_PWR_DOWN_ONE_SHOT 0x00
120 #define PRESS_ODR_1HZ 0x08
121 #define PRESS_ODR_4HZ 0x10
122 #define PRESS_ODR_10HZ 0x18
123 #define PRESS_ODR_25HZ 0x20
124 #define PRESS_ODR_50HZ 0x28
125 #define PRESS_ODR_75HZ 0x30
126 #define PRESS_ODR_100HZ 0x38
127 #define PRESS_ODR_200HZ 0x40
128 #define PRESS_ODR_BIT_MASK 0x78
129 #define PRESS_AVG_4 0x00
130 #define PRESS_AVG_8 0x01
131 #define PRESS_AVG_16 0x02
132 #define PRESS_AVG_32 0x03
133 #define PRESS_AVG_64 0x04
134 #define PRESS_AVG_128 0x05
135 #define PRESS_AVG_512 0x07
136 #define PRESS_AVG_BIT_MASK 0x07
142 #define PRESS_BOOT_NORMAL_MODE 0x00
143 #define PRESS_REBOOT_MEMORY_CONTENT 0x80
144 #define PRESS_FS_MODE_1_1260HPA 0x00
145 #define PRESS_FS_MODE_2_4060HPA 0x40
146 #define PRESS_LFPF_CFG_ODR_4 0x00
147 #define PRESS_LFPF_CFG_ODR_9 0x20
148 #define PRESS_DISABLE_LPFP 0x00
149 #define PRESS_ENABLE_LPFP 0x10
150 #define PRESS_BDU_CONTINUOUS 0x00
151 #define PRESS_BDU_MSB_LSB_READ 0x08
152 #define PRESS_SW_RESET 0x04
153 #define PRESS_ONESHOT_IDLE 0x00
154 #define PRESS_ONESHOT_NEW_DATA 0x01
160 #define PRESS_REBOOT_AH_QVAR_EN 0x80
161 #define PRESS_REBOOT_AH_QVAR_DIS 0x00
162 #define PRESS_REBOOT_AH_QVAR_P_AUTO_EN 0x20
163 #define PRESS_REBOOT_AH_QVAR_P_AUTO_DIS 0x00
164 #define PRESS_REBOOT_IF_ADD_INC_EN 0x01
165 #define PRESS_REBOOT_IF_ADD_INC_DIS 0x00
171 #define PRESS_TRIG_F_MODE_BYPASS 0x00
172 #define PRESS_TRIG_F_MODE_FIFO 0x01
173 #define PRESS_TRIG_F_MODE_CONT 0x02
174 #define PRESS_TRIG_F_MODE_BYPASS_FIFO 0x05
175 #define PRESS_TRIG_F_MODE_BYPASS_CONT 0x06
176 #define PRESS_TRIG_F_MODE_CONT_FIFO 0x07
182 #define PRESS_STATUS_TEMP_OVERRUN 0x20
183 #define PRESS_STATUS_PRESS_OVERRUN 0x10
184 #define PRESS_STATUS_TEMP_AVAILABLE 0x02
185 #define PRESS_STATUS_PRESS_AVAILABLE 0x01
191 #define PRESS_AH_QVAR_DISABLE 0x00
192 #define PRESS_AH_QVAR_ENABLE 0x01
198 #define PRESS_LSB_HPA_FS_MODE_4096 4096.0f
199 #define PRESS_LSB_HPA_FS_MODE_2048 2048.0f
200 #define PRESS_TEMP_SENS 100.0f
201 #define PRESS_QVAR_GAIN_LSB_MV 426000.0f
208 #define PRESS_DEVICE_ADDRESS 0x5C
226 #define PRESS_MAP_MIKROBUS( cfg, mikrobus ) \
227 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
228 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
i2c_master_t i2c
Definition: press.h:241
PRESS Click configuration object.
Definition: press.h:253
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:269
press_return_value_t
PRESS Click return value data.
Definition: press.h:267
pin_name_t sda
Definition: press.h:255
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:258
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:244
err_t press_get_measurement_data(press_t *ctx, float *pressure, float *temperature)
PRESS gets the measurement data function.
@ PRESS_OK
Definition: press.h:268
PRESS Click context object.
Definition: press.h:238
pin_name_t scl
Definition: press.h:254
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:257