pressure14 2.0.0.0
pressure14.h File Reference

This file contains API for Pressure 14 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  pressure14_t
 Pressure 14 Click context object. More...
 
struct  pressure14_cfg_t
 Pressure 14 Click configuration object. More...
 

Macros

#define PRESSURE14_STATUS_PWR_IND   0x40
 Pressure 14 description status register.
 
#define PRESSURE14_STATUS_BUSY_FLAG   0x20
 
#define PRESSURE14_STATUS_ERR_FLAG   0x04
 
#define PRESSURE14_STATUS_MATH_SAT   0x01
 
#define PRESSURE14_CONV_UNIT_PSI   0x00
 Pressure 14 description pressure conversion units.
 
#define PRESSURE14_CONV_UNIT_PASCAL   0x01
 
#define PRESSURE14_CONV_UNIT_KILOPASCAL   0x02
 
#define PRESSURE14_CONV_UNIT_MMHG   0x03
 
#define PRESSURE14_CONV_UNIT_INHG   0x04
 
#define PRESSURE14_CONV_UNIT_ATMOSPHERIC   0x05
 
#define PRESSURE14_CONV_UNIT_MILIBAR   0x06
 
#define PRESSURE14_CONV_UNIT_BAR   0x07
 
#define PRESSURE14_CONV_UNIT_CELSIUS   0x00
 Pressure 14 description temperature conversion units.
 
#define PRESSURE14_CONV_UNIT_KELVIN   0x01
 
#define PRESSURE14_CONV_UNIT_FAHRENHEIT   0x02
 
#define PRESSURE14_CONST_PSI   1.00000
 Pressure 14 description pressure conversion constants.
 
#define PRESSURE14_CONST_PASCAL   6894.76
 
#define PRESSURE14_CONST_KILOPASCAL   6.89476
 
#define PRESSURE14_CONST_MMHG   51.7149
 
#define PRESSURE14_CONST_INHG   2.03602
 
#define PRESSURE14_CONST_ATMOSPHERIC   0.06805
 
#define PRESSURE14_CONST_MILIBAR   68.9500
 
#define PRESSURE14_CONST_BAR   0.06895
 
#define PRESSURE14_CONST_ADDI_CELS   0.00000
 Pressure 14 description temperature conversion constants.
 
#define PRESSURE14_CONST_MULT_CELS   1.00000
 
#define PRESSURE14_CONST_ADDI_KELV   273.150
 
#define PRESSURE14_CONST_MULT_KELV   1.00000
 
#define PRESSURE14_CONST_ADDI_FAHR   32.0000
 
#define PRESSURE14_CONST_MULT_FAHR   1.80000
 
#define PRESSURE14_CONST_PRESS_OUT_MIN   1677722.00
 Pressure 14 description general sensor constants.
 
#define PRESSURE14_CONST_PRESS_OUT_MAX   13421772.0
 
#define PRESSURE14_CONST_PRESS_VAL_MIN   0.00000000
 
#define PRESSURE14_CONST_PRESS_VAL_MAX   60.0000000
 
#define PRESSURE14_CONST_TEMP_MIN   -50.000000
 
#define PRESSURE14_CONST_TEMP_MAX   150.000000
 
#define PRESSURE14_CONST_TEMP_OUT_MAX   16777215.0
 
#define PRESSURE14_CMD_OUT_MEAS   0xAA
 
#define PRESSURE14_CMD_DUMMY   0x00
 
#define PRESSURE14_SET_DEV_ADDR   0x28
 Pressure 14 description setting.
 
#define PRESSURE14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  pressure14_return_value_t { PRESSURE14_OK = 0 , PRESSURE14_ERROR = -1 }
 Pressure 14 Click return value data. More...
 

Functions

void pressure14_cfg_setup (pressure14_cfg_t *cfg)
 Pressure 14 configuration object setup function.
 
err_t pressure14_init (pressure14_t *ctx, pressure14_cfg_t *cfg)
 Pressure 14 initialization function.
 
err_t pressure14_generic_write (pressure14_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Pressure 14 I2C writing function.
 
err_t pressure14_generic_read (pressure14_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Pressure 14 I2C reading function.
 
void pressure14_measure_cmd (pressure14_t *ctx)
 Pressure 14 output Measurement Command function.
 
uint8_t pressure14_check_busy_flag_int (pressure14_t *ctx)
 Pressure 14 checks INT pin state function.
 
void pressure14_read_press_and_temp (pressure14_t *ctx, uint8_t *status_byte, uint32_t *pressure_data, uint32_t *temp_data)
 Pressure 14 read pressure and temperature function.
 
float pressure14_get_pressure (uint32_t pressure_raw, uint8_t conv_unit)
 Pressure 14 calculate pressure function.
 
float pressure14_get_temperature (uint32_t temperature_raw, uint8_t conv_unit)
 Pressure 14 calculate temperature function.
 

Detailed Description

This file contains API for Pressure 14 Click Driver.

Enumeration Type Documentation

◆ pressure14_return_value_t

Pressure 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
PRESSURE14_OK 
PRESSURE14_ERROR