diffpress2 2.0.0.0
diffpress2.h File Reference

This file contains API for Diff Press 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  diffpress2_t
 Diff Press 2 Click context object. More...
 
struct  diffpress2_cfg_t
 Diff Press 2 Click configuration object. More...
 

Macros

#define DIFFPRESS2_CMD_START_CONT_MEAS_MASS_FLOW_AVG   0x3603
 Diff Press 2 description commands.
 
#define DIFFPRESS2_CMD_START_CONT_MEAS_MASS_FLOW_NONE   0x3608
 
#define DIFFPRESS2_CMD_START_CONT_MEAS_DIFF_PRESS_AVG   0x3615
 
#define DIFFPRESS2_CMD_START_CONT_MEAS_DIFF_PRESS_NONE   0x361E
 
#define DIFFPRESS2_CMD_STOP_CONT_MEAS   0x3FF9
 
#define DIFFPRESS2_CMD_TRIGGER_MEAS_MASS_FLOW   0x3624
 
#define DIFFPRESS2_CMD_TRIGGER_MEAS_MASS_FLOW_STRETCH   0x3726
 
#define DIFFPRESS2_CMD_TRIGGER_MEAS_DIFF_PRESS   0x362F
 
#define DIFFPRESS2_CMD_TRIGGER_MEAS_DIFF_PRESS_STRETCH   0x372D
 
#define DIFFPRESS2_CMD_PRODUCT_ID_PT1   0x367C
 
#define DIFFPRESS2_CMD_PRODUCT_ID_PT2   0xE102
 
#define DIFFPRESS2_PRODUCT_ID   0x03010101
 Diff Press 2 description constants.
 
#define DIFFPRESS2_PRESSURE_SCALE_FACOTR   60.0
 
#define DIFFPRESS2_TEMPERATURE_SCALE_FACOTR   200.0
 
#define DIFFPRESS2_SET_DEV_ADDR_GND   0x21
 Diff Press 2 device address setting.
 
#define DIFFPRESS2_SET_DEV_ADDR_R4   0x22
 
#define DIFFPRESS2_SET_DEV_ADDR   DIFFPRESS2_SET_DEV_ADDR_R4
 
#define DIFFPRESS2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  diffpress2_return_value_t { DIFFPRESS2_OK = 0 , DIFFPRESS2_ERROR = -1 }
 Diff Press 2 Click return value data. More...
 

Functions

void diffpress2_cfg_setup (diffpress2_cfg_t *cfg)
 Diff Press 2 configuration object setup function.
 
err_t diffpress2_init (diffpress2_t *ctx, diffpress2_cfg_t *cfg)
 Diff Press 2 initialization function.
 
err_t diffpress2_default_cfg (diffpress2_t *ctx)
 Diff Press 2 default configuration function.
 
err_t diffpress2_send_command (diffpress2_t *ctx, uint16_t cmd)
 Command writing function.
 
err_t diffpress2_generic_read (diffpress2_t *ctx, uint16_t cmd, uint16_t *rx_buf, uint8_t rx_len)
 Command reading function.
 
err_t diffpress2_raw_read (diffpress2_t *ctx, uint16_t *rx_buf, uint8_t rx_len)
 Reading function.
 
err_t diffpress2_get_id (diffpress2_t *ctx)
 Reads device ID's.
 
err_t diffpress2_reset (diffpress2_t *ctx)
 Reset device.
 
err_t diffpress2_trigger_measurement (diffpress2_t *ctx, uint16_t trigger_type, float *diff_press, float *temperature)
 Pressure and temperature reading.
 

Detailed Description

This file contains API for Diff Press 2 Click Driver.

Enumeration Type Documentation

◆ diffpress2_return_value_t

Diff Press 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIFFPRESS2_OK 
DIFFPRESS2_ERROR