28#ifndef ULTRALOWPRESS_H
29#define ULTRALOWPRESS_H
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 ULTRALOWPRESS_REG_CMD 0x22
74#define ULTRALOWPRESS_REG_TEMP 0x2E
75#define ULTRALOWPRESS_REG_PRESS 0x30
76#define ULTRALOWPRESS_REG_STATUS_SYNC 0x32
77#define ULTRALOWPRESS_REG_STATUS 0x36
78#define ULTRALOWPRESS_REG_SERIAL_NUM_L 0x50
79#define ULTRALOWPRESS_REG_SERIAL_NUM_H 0x52
97#define ULTRALOWPRESS_REG_CMD_SLEEP 0x6C32
98#define ULTRALOWPRESS_REG_CMD_RESET 0xB169
99#define ULTRALOWPRESS_STATUS_CLEAR 0xFFFF
106#define ULTRALOWPRESS_SET_DEV_ADDR 0x6C
124#define ULTRALOWPRESS_MAP_MIKROBUS( cfg, mikrobus ) \
125 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
126 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
float ultralowpress_get_press(ultralowpress_t *ctx)
Read pressure.
err_t ultralowpress_generic_read(ultralowpress_t *ctx, uint8_t reg, uint16_t *rx_data)
Reading function.
err_t ultralowpress_init(ultralowpress_t *ctx, ultralowpress_cfg_t *cfg)
Ultra-Low Press initialization function.
void ultralowpress_cfg_setup(ultralowpress_cfg_t *cfg)
Ultra-Low Press configuration object setup function.
uint8_t ultralowpress_ready_to_read(ultralowpress_t *ctx)
Ready to read.
err_t ultralowpress_generic_write(ultralowpress_t *ctx, uint8_t reg, uint16_t tx_data)
Writing function.
float ultralowpress_get_temp(ultralowpress_t *ctx)
Read temperature.
void ultralowpress_clear_status(ultralowpress_t *ctx)
Clear status.
Ultra-Low Press Click configuration object.
Definition ultralowpress.h:150
uint32_t i2c_speed
Definition ultralowpress.h:154
pin_name_t scl
Definition ultralowpress.h:151
pin_name_t sda
Definition ultralowpress.h:152
uint8_t i2c_address
Definition ultralowpress.h:155
Ultra-Low Press Click context object.
Definition ultralowpress.h:136
i2c_master_t i2c
Definition ultralowpress.h:138
uint8_t slave_address
Definition ultralowpress.h:141
ultralowpress_return_value_t
Ultra-Low Press Click return value data.
Definition ultralowpress.h:164
@ ULTRALOWPRESS_ERROR
Definition ultralowpress.h:166
@ ULTRALOWPRESS_OK
Definition ultralowpress.h:165