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"
52#include "drv_spi_master.h"
74#define PRESSURE15_REG_INTERRUPT_CFG 0x0B
75#define PRESSURE15_REG_THS_P_L 0x0C
76#define PRESSURE15_REG_THS_P_H 0x0D
77#define PRESSURE15_REG_IF_CTRL 0x0E
78#define PRESSURE15_REG_WHO_AM_I 0x0F
79#define PRESSURE15_REG_CTRL_REG1 0x10
80#define PRESSURE15_REG_CTRL_REG2 0x11
81#define PRESSURE15_REG_CTRL_REG3 0x12
82#define PRESSURE15_REG_FIFO_CTRL 0x13
83#define PRESSURE15_REG_FIFO_WTM 0x14
84#define PRESSURE15_REG_REF_PL_L 0x15
85#define PRESSURE15_REG_REF_PL_H 0x16
86#define PRESSURE15_REG_RPDS_L 0x18
87#define PRESSURE15_REG_RPDS_H 0x19
88#define PRESSURE15_REG_INT_SOURCE 0x24
89#define PRESSURE15_REG_FIFO_STATUS1 0x25
90#define PRESSURE15_REG_FIFO_STATUS2 0x26
91#define PRESSURE15_REG_STATUS 0x27
92#define PRESSURE15_REG_PRESSURE_OUT_XL 0x28
93#define PRESSURE15_REG_PRESSURE_OUT_L 0x29
94#define PRESSURE15_REG_PRESSURE_OUT_H 0x2A
95#define PRESSURE15_REG_TEMP_OUT_L 0x2B
96#define PRESSURE15_REG_TEMP_OUT_H 0x2C
97#define PRESSURE15_REG_LPFP_RES 0x3C
98#define PRESSURE15_REG_FIFO_DATA_OUT_PRESS_XL 0x78
99#define PRESSURE15_REG_FIFO_DATA_OUT_PRESS_L 0x79
100#define PRESSURE15_REG_FIFO_DATA_OUT_PRESS_H 0x7A
101#define PRESSURE15_REG_FIFO_DATA_OUT_TEMP_L 0x7B
102#define PRESSURE15_REG_FIFO_DATA_OUT_TEMP_H 0x7C
120#define PRESSURE15_ID 0xB3
127#define PRESSURE15_SET_DEV_ADDR 0x5C
145#define PRESSURE15_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
147 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
148 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
149 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
150 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
151 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
152 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t pressure15_default_cfg(pressure15_t *ctx)
Pressure 15 default configuration function.
uint8_t pressure15_get_int(pressure15_t *ctx)
Get interrupt pin state.
err_t pressure15_get_temperature(pressure15_t *ctx, float *temperature)
Get temperature data.
err_t pressure15_generic_read(pressure15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Pressure 15 data reading function.
void pressure15_cfg_setup(pressure15_cfg_t *cfg)
Pressure 15 configuration object setup function.
err_t pressure15_init(pressure15_t *ctx, pressure15_cfg_t *cfg)
Pressure 15 initialization function.
err_t pressure15_get_pressure(pressure15_t *ctx, float *pressure)
Get pressure data.
err_t pressure15_generic_write(pressure15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Pressure 15 data writing function.
void pressure15_drv_interface_selection(pressure15_cfg_t *cfg, pressure15_drv_t drv_sel)
Pressure 15 driver interface setup function.
pressure15_drv_t
Pressure 15 Click driver selector.
Definition pressure15.h:162
@ PRESSURE15_DRV_SEL_I2C
Definition pressure15.h:164
@ PRESSURE15_DRV_SEL_SPI
Definition pressure15.h:163
pressure15_return_value_t
Pressure 15 Click return value data.
Definition pressure15.h:225
@ PRESSURE15_ERROR
Definition pressure15.h:227
@ PRESSURE15_OK
Definition pressure15.h:226
err_t(* pressure15_master_io_t)(struct pressure15_s *, uint8_t, uint8_t *, uint8_t)
Pressure 15 Click driver interface.
Definition pressure15.h:172
struct pressure15_s pressure15_t
Pressure 15 Click context object.
Pressure 15 Click configuration object.
Definition pressure15.h:200
pressure15_drv_t drv_sel
Definition pressure15.h:216
uint32_t i2c_speed
Definition pressure15.h:209
spi_master_chip_select_polarity_t cs_polarity
Definition pressure15.h:214
pin_name_t sck
Definition pressure15.h:205
spi_master_mode_t spi_mode
Definition pressure15.h:213
pin_name_t mosi
Definition pressure15.h:204
uint32_t spi_speed
Definition pressure15.h:212
pin_name_t scl
Definition pressure15.h:201
pin_name_t int_pin
Definition pressure15.h:207
pin_name_t miso
Definition pressure15.h:203
pin_name_t sda
Definition pressure15.h:202
pin_name_t cs
Definition pressure15.h:206
uint8_t i2c_address
Definition pressure15.h:210
Pressure 15 Click context object.
Definition pressure15.h:180
pressure15_drv_t drv_sel
Definition pressure15.h:188
spi_master_t spi
Definition pressure15.h:184
digital_in_t int_pin
Definition pressure15.h:181
i2c_master_t i2c
Definition pressure15.h:183
pressure15_master_io_t write_f
Definition pressure15.h:190
uint8_t slave_address
Definition pressure15.h:186
pin_name_t chip_select
Definition pressure15.h:187
pressure15_master_io_t read_f
Definition pressure15.h:191