39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_in.h"
50#include "drv_i2c_master.h"
72#define BAROMETER10_REG_INTERRUPT_CFG 0x0B
73#define BAROMETER10_REG_THS_P_L 0x0C
74#define BAROMETER10_REG_THS_P_H 0x0D
75#define BAROMETER10_REG_IF_CTRL 0x0E
76#define BAROMETER10_REG_WHO_AM_I 0x0F
77#define BAROMETER10_REG_CTRL_REG1 0x10
78#define BAROMETER10_REG_CTRL_REG2 0x11
79#define BAROMETER10_REG_CTRL_REG3 0x12
80#define BAROMETER10_REG_CTRL_REG4 0x13
81#define BAROMETER10_REG_FIFO_CTRL 0x14
82#define BAROMETER10_REG_FIFO_WTM 0x15
83#define BAROMETER10_REG_REF_P_L 0x16
84#define BAROMETER10_REG_REF_P_H 0x17
85#define BAROMETER10_REG_I3C_IF_CTRL_ADD 0x19
86#define BAROMETER10_REG_RPDS_L 0x1A
87#define BAROMETER10_REG_RPDS_H 0x1B
88#define BAROMETER10_REG_INT_SOURCE 0x24
89#define BAROMETER10_REG_FIFO_STATUS1 0x25
90#define BAROMETER10_REG_FIFO_STATUS2 0x26
91#define BAROMETER10_REG_STATUS 0x27
92#define BAROMETER10_REG_PRESS_OUT_XL 0x28
93#define BAROMETER10_REG_PRESS_OUT_L 0x29
94#define BAROMETER10_REG_PRESS_OUT_H 0x2A
95#define BAROMETER10_REG_TEMP_OUT_L 0x2B
96#define BAROMETER10_REG_TEMP_OUT_H 0x2C
97#define BAROMETER10_REG_FIFO_DATA_OUT_PRESS_XL 0x78
98#define BAROMETER10_REG_FIFO_DATA_OUT_PRESS_L 0x79
99#define BAROMETER10_REG_FIFO_DATA_OUT_PRESS_H 0x7A
117#define BAROMETER10_DEVICE_ID 0xB4
123#define BAROMETER10_ODR_ONE_SHOT 0x00
124#define BAROMETER10_ODR_1_Hz 0x01
125#define BAROMETER10_ODR_4_Hz 0x02
126#define BAROMETER10_ODR_10_Hz 0x03
127#define BAROMETER10_ODR_25_Hz 0x04
128#define BAROMETER10_ODR_50_Hz 0x05
129#define BAROMETER10_ODR_75_Hz 0x06
130#define BAROMETER10_ODR_100_Hz 0x07
131#define BAROMETER10_ODR_200_Hz 0x08
132#define BAROMETER10_AVG_4 0x00
133#define BAROMETER10_AVG_8 0x01
134#define BAROMETER10_AVG_16 0x02
135#define BAROMETER10_AVG_32 0x03
136#define BAROMETER10_AVG_64 0x04
137#define BAROMETER10_AVG_128 0x05
138#define BAROMETER10_AVG_512 0x07
144#define BAROMETER10_FS_MODE_1260_hPa 0x00
145#define BAROMETER10_FS_MODE_4060_hPa 0x01
146#define BAROMETER10_LFPF_CFG_ODR4 0x00
147#define BAROMETER10_LFPF_CFG_ODR9 0x01
148#define BAROMETER10_EN_LPFP_DISABLE 0x00
149#define BAROMETER10_EN_LPFP_ENABLE 0x01
150#define BAROMETER10_BDU_CONTINUOUS_UPDATE 0x00
151#define BAROMETER10_BDU_NO_UPDATE_UNTIL_READ 0x01
152#define BAROMETER10_SWRESET_BIT_MASK 0x02
153#define BAROMETER10_ONESHOT_IDLE_MODE 0x00
154#define BAROMETER10_ONESHOT_NEW_SET_ACQUIRED 0x01
160#define BAROMETER10_INT_H_L_ACTIVE_HIGH 0x00
161#define BAROMETER10_INT_H_L_ACTIVE_LOW 0x01
162#define BAROMETER10_IF_ADD_INC_DISABLE 0x00
163#define BAROMETER10_IF_ADD_INC_ENABLE 0x01
169#define BAROMETER10_DRDY_PLS_DISABLE 0x00
170#define BAROMETER10_DRDY_PLS_ENABLE 0x01
171#define BAROMETER10_DRDY_DISABLE 0x00
172#define BAROMETER10_DRDY_ENABLE 0x01
173#define BAROMETER10_INT_EN_DISABLE 0x00
174#define BAROMETER10_INT_EN_ENABLE 0x01
181#define BAROMETER10_DEVICE_ADDRESS_GND 0x5C
182#define BAROMETER10_DEVICE_ADDRESS_VCC 0x5D
200#define BAROMETER10_MAP_MIKROBUS( cfg, mikrobus ) \
201 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
202 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
203 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
barometer10_return_value_t
Barometer 10 Click return value data.
Definition barometer10.h:267
@ BAROMETER10_OK
Definition barometer10.h:268
@ BAROMETER10_ERROR
Definition barometer10.h:269
err_t barometer10_get_temperature(barometer10_t *ctx, float *temperature)
Barometer 10 gets temperature function.
err_t barometer10_trigger_one_shot(barometer10_t *ctx)
Barometer 10 trigger one-shot function.
err_t barometer10_default_cfg(barometer10_t *ctx)
Barometer 10 default configuration function.
err_t barometer10_get_pressure(barometer10_t *ctx, float *pressure)
Barometer 10 gets pressure function.
err_t barometer10_init(barometer10_t *ctx, barometer10_cfg_t *cfg)
Barometer 10 initialization function.
err_t barometer10_get_device_id(barometer10_t *ctx, uint8_t *device_id)
Barometer 10 gets device ID function.
err_t barometer10_set_config(barometer10_t *ctx, barometer10_sensor_cfg_t config)
Barometer 10 set configuration function.
err_t barometer10_sw_reset(barometer10_t *ctx)
Barometer 10 software reset function.
err_t barometer10_get_config(barometer10_t *ctx, barometer10_sensor_cfg_t *config)
Barometer 10 gets configuration function.
err_t barometer10_generic_read(barometer10_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Barometer 10 I2C reading function.
uint8_t barometer10_get_int_pin(barometer10_t *ctx)
Barometer 10 gets interrupt function.
err_t barometer10_generic_write(barometer10_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Barometer 10 I2C writing function.
void barometer10_cfg_setup(barometer10_cfg_t *cfg)
Barometer 10 configuration object setup function.
err_t barometer10_get_temperature_output(barometer10_t *ctx, int16_t *temperature_raw)
Barometer 10 gets temperature output function.
err_t barometer10_get_pressure_output(barometer10_t *ctx, int32_t *pressure_raw)
Barometer 10 gets pressure output function.
Barometer 10 Click configuration object.
Definition barometer10.h:230
uint32_t i2c_speed
Definition barometer10.h:236
pin_name_t scl
Definition barometer10.h:231
pin_name_t int_pin
Definition barometer10.h:234
pin_name_t sda
Definition barometer10.h:232
uint8_t i2c_address
Definition barometer10.h:237
Barometer 10 Click sensor configuration object.
Definition barometer10.h:246
uint8_t fs_mode
Definition barometer10.h:249
uint8_t bdu
Definition barometer10.h:252
uint8_t avg
Definition barometer10.h:248
uint8_t oneshot
Definition barometer10.h:253
uint8_t int_h_l
Definition barometer10.h:254
uint8_t drdy_pls
Definition barometer10.h:256
uint8_t if_add_inc
Definition barometer10.h:255
uint8_t drdy
Definition barometer10.h:257
uint8_t lfpf_cfg
Definition barometer10.h:250
uint8_t en_lpfp
Definition barometer10.h:251
uint8_t odr
Definition barometer10.h:247
uint8_t int_en
Definition barometer10.h:258
Barometer 10 Click context object.
Definition barometer10.h:213
digital_in_t int_pin
Definition barometer10.h:215
i2c_master_t i2c
Definition barometer10.h:218
uint8_t slave_address
Definition barometer10.h:221