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 PRESSURE17_REG_MANUFACTURER_ID 0x0F
74#define PRESSURE17_REG_PART_ID 0x10
75#define PRESSURE17_REG_POWER_DOWN 0x12
76#define PRESSURE17_REG_RESET 0x13
77#define PRESSURE17_REG_MODE_CONTROL 0x14
78#define PRESSURE17_REG_IIR_FIFO_CONTROL 0x15
79#define PRESSURE17_REG_FIFO_DATA 0x18
80#define PRESSURE17_REG_STATUS 0x19
81#define PRESSURE17_REG_PRESS_OUT_MSB 0x1A
82#define PRESSURE17_REG_PRESS_OUT_LSB 0x1B
83#define PRESSURE17_REG_PRESS_OUT_XL 0x1C
84#define PRESSURE17_REG_TEMP_OUT_MSB 0x1D
85#define PRESSURE17_REG_TEMP_OUT_LSB 0x1E
103#define PRESSURE17_MANUFACTURER_ID 0xE0
104#define PRESSURE17_PART_ID 0x34
110#define PRESSURE17_POWER_DOWN 0x00
111#define PRESSURE17_POWER_ACTIVE 0x01
117#define PRESSURE17_RSTB_RESET 0x00
118#define PRESSURE17_RSTB_ACTIVE 0x01
124#define PRESSURE17_MODE_AVE_NUM_8_TIMES 0x60
125#define PRESSURE17_MODE_AVE_NUM_16_TIMES 0x80
126#define PRESSURE17_MODE_AVE_NUM_32_TIMES 0xA0
127#define PRESSURE17_MODE_AVE_NUM_64_TIMES 0xC0
128#define PRESSURE17_MODE_DR_EN 0x10
129#define PRESSURE17_MODE_FULL_EN 0x08
130#define PRESSURE17_MODE_WTM_EN 0x04
131#define PRESSURE17_MODE_STANDBY_MODE 0x00
132#define PRESSURE17_MODE_ONE_SHOT_MODE 0x01
133#define PRESSURE17_MODE_CONTINUOUS_MODE 0x02
139#define PRESSURE17_FIFO_EN 0x80
140#define PRESSURE17_WTM_LEVEL_2 0x00
141#define PRESSURE17_WTM_LEVEL_3 0x40
142#define PRESSURE17_IIR_OFF 0x00
143#define PRESSURE17_IIR_ON_WEAK 0x01
144#define PRESSURE17_IIR_ON_MIDDLE 0x02
145#define PRESSURE17_IIR_ON_STRONG 0x03
151#define PRESSURE17_FIFO_LVL_FIFO_EMPTY 0x00
152#define PRESSURE17_FIFO_LVL_FIFO_NUM_1 0x01
153#define PRESSURE17_FIFO_LVL_FIFO_NUM_2 0x02
154#define PRESSURE17_FIFO_LVL_FIFO_NUM_3 0x03
155#define PRESSURE17_FIFO_LVL_FIFO_FULL 0x04
161#define PRESSURE17_STATUS_RD_FULL 0x04
162#define PRESSURE17_STATUS_RD_WTM 0x02
163#define PRESSURE17_STATUS_RD_DRDY 0x01
169#define PRESSURE17_PRESS_COUNTS_PER_MBAR 2048
170#define PRESSURE17_TEMP_COUNTS_PER_C 32
177#define PRESSURE17_SET_DEV_ADDR 0x5D
195#define PRESSURE17_MAP_MIKROBUS( cfg, mikrobus ) \
196 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
197 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
198 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t pressure17_generic_write(pressure17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Pressure 17 I2C writing function.
err_t pressure17_write_register(pressure17_t *ctx, uint8_t reg, uint8_t data_in)
Pressure 17 write register function.
err_t pressure17_generic_read(pressure17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Pressure 17 I2C reading function.
uint8_t pressure17_get_int_pin(pressure17_t *ctx)
Pressure 17 get int pin function.
err_t pressure17_read_data(pressure17_t *ctx, float *pressure, float *temperature)
Pressure 17 read data function.
void pressure17_cfg_setup(pressure17_cfg_t *cfg)
Pressure 17 configuration object setup function.
err_t pressure17_check_communication(pressure17_t *ctx)
Pressure 17 check communication function.
err_t pressure17_init(pressure17_t *ctx, pressure17_cfg_t *cfg)
Pressure 17 initialization function.
err_t pressure17_default_cfg(pressure17_t *ctx)
Pressure 17 default configuration function.
err_t pressure17_read_register(pressure17_t *ctx, uint8_t reg, uint8_t *data_out)
Pressure 17 read register function.
pressure17_return_value_t
Pressure 17 Click return value data.
Definition pressure17.h:241
@ PRESSURE17_ERROR
Definition pressure17.h:243
@ PRESSURE17_OK
Definition pressure17.h:242
Pressure 17 Click configuration object.
Definition pressure17.h:225
uint32_t i2c_speed
Definition pressure17.h:231
pin_name_t scl
Definition pressure17.h:226
pin_name_t int_pin
Definition pressure17.h:229
pin_name_t sda
Definition pressure17.h:227
uint8_t i2c_address
Definition pressure17.h:232
Pressure 17 Click context object.
Definition pressure17.h:208
digital_in_t int_pin
Definition pressure17.h:210
i2c_master_t i2c
Definition pressure17.h:213
uint8_t slave_address
Definition pressure17.h:216