airflow 2.0.0.0
airflow.h File Reference

This file contains API for Air Flow Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  airflow_s
 Air Flow Click context object. More...
 
struct  airflow_cfg_t
 Air Flow Click configuration object. More...
 

Macros

#define AIRFLOW_I2C_CMD_RESET   0x11
 Air Flow I2C control registers.
 
#define AIRFLOW_I2C_CMD_GET_SIG   0x23
 
#define AIRFLOW_I2C_CMD_GET_DATA   0x26
 
#define AIRFLOW_I2C_CMD_CONV   0x27
 
#define AIRFLOW_I2C_CMD_GET_NON_BAR   0x50
 
#define AIRFLOW_I2C_CMD_GET_NON_BLOCK_BAR   0x51
 
#define AIRFLOW_SPI_CMD_NONE   0x00
 Air Flow SPI control registers.
 
#define AIRFLOW_SPI_CMD_RESET   0x01
 
#define AIRFLOW_SPI_CMD_CONV   0x04
 
#define AIRFLOW_SPI_CMD_STOP   0x05
 
#define AIRFLOW_SPI_CMD_GET_DATA   0x06
 
#define AIRFLOW_SPI_CMD_GET_BAR   0x07
 
#define AIRFLOW_SPI_CMD_GET_SIG   0x0C
 
#define AIRFLOW_NO_BAROMETRIC_CORRECTION   0x01
 Air Flow description setting.
 
#define AIRFLOW_BAROMETRIC_CORRECTION   0x03
 
#define AIRFLOW_SET_DEV_ADDR   0x5B
 Air Flow device address setting.
 
#define AIRFLOW_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* airflow_master_io_t) (struct airflow_s *, uint8_t, uint8_t *, uint8_t)
 Air Flow Click driver interface.
 
typedef struct airflow_s airflow_t
 Air Flow Click context object.
 

Enumerations

enum  airflow_drv_t { AIRFLOW_DRV_SEL_SPI , AIRFLOW_DRV_SEL_I2C }
 Air Flow Click driver selector. More...
 
enum  airflow_return_value_t { AIRFLOW_OK = 0 , AIRFLOW_ERROR = -1 }
 Air Flow Click return value data. More...
 

Functions

void airflow_cfg_setup (airflow_cfg_t *cfg)
 Air Flow configuration object setup function.
 
void airflow_drv_interface_selection (airflow_cfg_t *cfg, airflow_drv_t drv_sel)
 Air Flow driver interface setup function.
 
err_t airflow_init (airflow_t *ctx, airflow_cfg_t *cfg)
 Air Flow initialization function.
 
err_t airflow_default_cfg (airflow_t *ctx)
 Air Flow default configuration function.
 
err_t airflow_generic_write (airflow_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Air Flow data writing function.
 
err_t airflow_generic_read (airflow_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Air Flow data reading function.
 
void airflow_reset_device (airflow_t *ctx)
 Reset device.
 
uint8_t airflow_check_ready (airflow_t *ctx)
 Reads ready pin state.
 
err_t airflow_get_differential_pressure (airflow_t *ctx, float *pressure)
 Reads differential pressure.
 
err_t airflow_get_atmospheric_pressure (airflow_t *ctx, float *pressure, float *temperature)
 Reads atmospheric pressure and temperature.
 
err_t airflow_get_status (airflow_t *ctx, uint8_t *status)
 Reads status data.
 

Detailed Description

This file contains API for Air Flow Click Driver.

Typedef Documentation

◆ airflow_master_io_t

typedef err_t(* airflow_master_io_t) (struct airflow_s *, uint8_t, uint8_t *, uint8_t)

Air Flow Click driver interface.

Definition of driver interface of Air Flow Click driver. Driver serial interface.

◆ airflow_t

typedef struct airflow_s airflow_t

Air Flow Click context object.

Context object definition of Air Flow Click driver.

Enumeration Type Documentation

◆ airflow_drv_t

Air Flow Click driver selector.

Selects target driver interface of Air Flow Click driver.

Enumerator
AIRFLOW_DRV_SEL_SPI 

SPI driver descriptor.

AIRFLOW_DRV_SEL_I2C 

I2C driver descriptor.

◆ airflow_return_value_t

Air Flow Click return value data.

Predefined enum values for driver return values.

Enumerator
AIRFLOW_OK 
AIRFLOW_ERROR