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 VAVPRESS_SET_CMD_RESET_FIRMWARE 0x11
74#define VAVPRESS_SET_CMD_START_PRESSURE_CONVERSION 0x21
75#define VAVPRESS_SET_CMD_RETRIEVE_ELECTRONIC_SIGNATURE 0x23
82#define VAVPRESS_SET_DEV_ADDR_0 0x5C
83#define VAVPRESS_SET_DEV_ADDR_1 0x5D
84#define VAVPRESS_SET_DEV_ADDR_2 0x5E
85#define VAVPRESS_SET_DEV_ADDR_3 0x5F
103#define VAVPRESS_MAP_MIKROBUS( cfg, mikrobus ) \
104 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
105 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
158 char part_number[ 12 ];
159 char lot_number[ 7 ];
163 char calibration_id[ 2 ];
void vavpress_cfg_setup(vavpress_cfg_t *cfg)
VAV Press configuration object setup function.
err_t vavpress_set_command(vavpress_t *ctx, uint8_t cmd)
VAV Press set command function.
err_t vavpress_get_dif_press_and_temp(vavpress_t *ctx, vavpress_sensor_param_data_t *param_data, float *diff_press, float *temperature)
VAV Press get differential pressure and temperature function.
err_t vavpress_init(vavpress_t *ctx, vavpress_cfg_t *cfg)
VAV Press initialization function.
err_t vavpress_set_default_sensor_param(vavpress_t *ctx, vavpress_sensor_param_data_t *param_data)
VAV Press set default sensor parameter function.
err_t vavpress_generic_write(vavpress_t *ctx, uint8_t *tx_buf, uint8_t tx_len)
VAV Press I2C writing function.
err_t vavpress_get_readout_data(vavpress_t *ctx, int16_t *press_data, int16_t *temp_data)
VAV Press get data readout function.
err_t vavpress_generic_read(vavpress_t *ctx, uint8_t *rx_buf, uint8_t rx_len)
VAV Press I2C reading function.
err_t vavpress_retrieve_electronic_signature(vavpress_t *ctx, vavpress_el_signature_data_t *el_signature_data)
VAV Press retrieve electronic signature function.
err_t vavpress_default_cfg(vavpress_t *ctx)
VAV Press default configuration function.
vavpress_el_signature_data_t el_signature_data
Definition main.c:36
vavpress_sensor_param_data_t param_data
Definition main.c:37
VAV Press Click configuration object.
Definition vavpress.h:131
uint32_t i2c_speed
Definition vavpress.h:135
pin_name_t scl
Definition vavpress.h:132
pin_name_t sda
Definition vavpress.h:133
uint8_t i2c_address
Definition vavpress.h:136
VAV Press Click electronic signature.
Definition vavpress.h:156
char output_type
Definition vavpress.h:161
uint16_t pressure_range
Definition vavpress.h:160
float firmware_version
Definition vavpress.h:157
uint16_t scale_factor
Definition vavpress.h:162
uint8_t week_number
Definition vavpress.h:164
uint16_t sequence_number
Definition vavpress.h:166
uint8_t year_number
Definition vavpress.h:165
VAV Press Click sensor parameter data.
Definition vavpress.h:175
uint16_t readout_at_known_temperature
Definition vavpress.h:178
float known_temperature_c
Definition vavpress.h:179
uint16_t scale_factor_press
Definition vavpress.h:177
uint16_t scale_factor_temp
Definition vavpress.h:176
VAV Press Click context object.
Definition vavpress.h:115
i2c_master_t i2c
Definition vavpress.h:118
uint8_t slave_address
Definition vavpress.h:122
vavpress_return_value_t
VAV Press Click return value data.
Definition vavpress.h:145
@ VAVPRESS_OK
Definition vavpress.h:146
@ VAVPRESS_ERROR
Definition vavpress.h:147