airflow 2.0.0.0
Air Flow Click Driver

API for configuring and manipulating Air Flow Click driver. More...

Topics

 Air Flow Registers List
 List of registers of Air Flow Click driver.
 
 Air Flow Registers Settings
 Settings for registers of Air Flow Click driver.
 
 Air Flow MikroBUS Map
 MikroBUS pin mapping of Air Flow Click driver.
 

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

API for configuring and manipulating Air Flow Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ airflow_cfg_setup()

void airflow_cfg_setup ( airflow_cfg_t * cfg)

Air Flow configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See airflow_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ airflow_check_ready()

uint8_t airflow_check_ready ( airflow_t * ctx)

Reads ready pin state.

This function reads logic level of rdy pin.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
Returns
Pin logic state.
Note
Pin state is high when device has data ready to read.

◆ airflow_default_cfg()

err_t airflow_default_cfg ( airflow_t * ctx)

Air Flow default configuration function.

This function executes a default configuration of Air Flow click board.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ airflow_drv_interface_selection()

void airflow_drv_interface_selection ( airflow_cfg_t * cfg,
airflow_drv_t drv_sel )

Air Flow driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See airflow_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See airflow_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ airflow_generic_read()

err_t airflow_generic_read ( airflow_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Air Flow data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ airflow_generic_write()

err_t airflow_generic_write ( airflow_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Air Flow data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ airflow_get_atmospheric_pressure()

err_t airflow_get_atmospheric_pressure ( airflow_t * ctx,
float * pressure,
float * temperature )

Reads atmospheric pressure and temperature.

This function reads pressure and temperature data from sensor.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
[out]pressure: Pressure data in mBar.
[out]temperature: Temperature data in C.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ airflow_get_differential_pressure()

err_t airflow_get_differential_pressure ( airflow_t * ctx,
float * pressure )

Reads differential pressure.

This function reads differential pressure data from sensor.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
[out]pressure: Differential pressure data in Pascals.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ airflow_get_status()

err_t airflow_get_status ( airflow_t * ctx,
uint8_t * status )

Reads status data.

This function reads status data from sensor.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
[out]status: Device status.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function will work only in SPI example.

◆ airflow_init()

err_t airflow_init ( airflow_t * ctx,
airflow_cfg_t * cfg )

Air Flow initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See airflow_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See airflow_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ airflow_reset_device()

void airflow_reset_device ( airflow_t * ctx)

Reset device.

This function sends command to reset device.

Parameters
[in]ctx: Click context object. See airflow_t object definition for detailed explanation.
Returns
Nothing.
Note
After command function will hold MCU for 100ms.