42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define PRESSURE7_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
76#define PRESSURE7_RETVAL uint8_t
78#define PRESSURE7_OK 0x00
79#define PRESSURE7_INIT_ERROR 0xFF
86#define PRESSURE7_CMD_RESET 0x1E
87#define PRESSURE7_CMD_CONVERT_D1_OSR_256 0x40
88#define PRESSURE7_CMD_CONVERT_D1_OSR_512 0x42
89#define PRESSURE7_CMD_CONVERT_D1_OSR_1024 0x44
90#define PRESSURE7_CMD_CONVERT_D1_OSR_2048 0x46
91#define PRESSURE7_CMD_CONVERT_D1_OSR_4096 0x48
92#define PRESSURE7_CMD_CONVERT_D1_OSR_8192 0x4A
93#define PRESSURE7_CMD_CONVERT_D2_OSR_256 0x50
94#define PRESSURE7_CMD_CONVERT_D2_OSR_512 0x52
95#define PRESSURE7_CMD_CONVERT_D2_OSR_1024 0x54
96#define PRESSURE7_CMD_CONVERT_D2_OSR_2048 0x56
97#define PRESSURE7_CMD_CONVERT_D2_OSR_4096 0x58
98#define PRESSURE7_CMD_CONVERT_D2_OSR_8912 0x5A
99#define PRESSURE7_CMD_ADC_READ 0x00
100#define PRESSURE7_CMD_PROM_READ 0xA0
107#define PRESSURE7_PROM_ADDR_CRC 0x00
108#define PRESSURE7_PROM_ADDR_C1 0x01 << 1
109#define PRESSURE7_PROM_ADDR_C2 0x02 << 1
110#define PRESSURE7_PROM_ADDR_C3 0x03 << 1
111#define PRESSURE7_PROM_ADDR_C4 0x04 << 1
112#define PRESSURE7_PROM_ADDR_C5 0x05 << 1
113#define PRESSURE7_PROM_ADDR_C6 0x06 << 1
114#define PRESSURE7_PROM_ADDR_C7 0x07 << 1
121#define PRESSURE7_PROM_READ_ERROR 1
122#define PRESSURE7_PROM_READ_OK 0
129#define PRESSURE7_DEVICE_SLAVE_ADDRESS 0x76
#define PRESSURE7_RETVAL
Definition pressure7.h:76
void pressure7_start_measurement(pressure7_t *ctx)
Start measurement and calculation data.
void pressure7_cfg_setup(pressure7_cfg_t *cfg)
Config Object Initialization function.
void pressure7_reset(pressure7_t *ctx)
Start reset sequence.
void pressure7_generic_read(pressure7_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint8_t len)
Generic read function.
void pressure7_get_sensor_data(pressure7_t *ctx, float *Temperature, float *Pressure)
Read Pressure and Temperature data.
void pressure7_default_cfg(pressure7_t *ctx)
Click Default Configuration function.
uint8_t pressure7_read_prom(pressure7_t *ctx)
Read calibration data from PROM.
void pressure7_set_over_sampling_ratio(uint8_t osr_d1, uint8_t osr_d2)
Set OSR(Over sampling ratio) for Pressure(D1) and Temperature(D2) data.
PRESSURE7_RETVAL pressure7_init(pressure7_t *ctx, pressure7_cfg_t *cfg)
Initialization function.
void pressure7_send_command(pressure7_t *ctx, uint8_t cmd)
Send command to click.
Click configuration structure definition.
Definition pressure7.h:163
uint32_t i2c_speed
Definition pressure7.h:171
pin_name_t scl
Definition pressure7.h:166
pin_name_t sda
Definition pressure7.h:167
uint8_t i2c_address
Definition pressure7.h:172
Click ctx object definition.
Definition pressure7.h:143
i2c_master_t i2c
Definition pressure7.h:146
float pressure
Definition pressure7.h:155
uint8_t slave_address
Definition pressure7.h:150
float temperature
Definition pressure7.h:154