diffpress3 2.1.0.0
Diff Press 3 Click Driver

API for configuring and manipulating Diff Press 3 Click driver. More...

Topics

 Diff Press 3 Registers Settings
 Settings for registers of Diff Press 3 Click driver.
 
 Diff Press 3 MikroBUS Map
 MikroBUS pin mapping of Diff Press 3 Click driver.
 

Functions

void diffpress3_cfg_setup (diffpress3_cfg_t *cfg)
 Diff Press 3 configuration object setup function.
 
void diffpress3_drv_interface_selection (diffpress3_cfg_t *cfg, diffpress3_drv_t drv_sel)
 Diff Press 3 driver interface setup function.
 
err_t diffpress3_init (diffpress3_t *ctx, diffpress3_cfg_t *cfg)
 Diff Press 3 initialization function.
 
err_t diffpress3_read_raw_adc (diffpress3_t *ctx, uint16_t *raw_adc, diffpress3_d_sel_t data_sel)
 Diff Press 3 read raw ADC value function.
 
err_t diffpress3_read_voltage (diffpress3_t *ctx, float *voltage)
 Diff Press 3 read voltage level function.
 
err_t diffpress3_set_vref (diffpress3_t *ctx, float vref)
 Diff Press 3 set vref function.
 
err_t diffpress3_get_pressure (diffpress3_t *ctx, float *pressure)
 Diff Press 3 get pressure function.
 
err_t diffpress3_get_temperature (diffpress3_t *ctx, float *temperature)
 Diff Press 3 get temperature function.
 
err_t diffpress3_get_digit_out_data (diffpress3_t *ctx, uint16_t *press_data, uint16_t *temp_data)
 Diff Press 3 get digital output data function.
 

Detailed Description

API for configuring and manipulating Diff Press 3 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

◆ diffpress3_cfg_setup()

void diffpress3_cfg_setup ( diffpress3_cfg_t * cfg)

Diff Press 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ diffpress3_drv_interface_selection()

void diffpress3_drv_interface_selection ( diffpress3_cfg_t * cfg,
diffpress3_drv_t drv_sel )

Diff Press 3 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 diffpress3_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See diffpress3_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.

◆ diffpress3_get_digit_out_data()

err_t diffpress3_get_digit_out_data ( diffpress3_t * ctx,
uint16_t * press_data,
uint16_t * temp_data )

Diff Press 3 get digital output data function.

This function reads pressure and temperature digital output raw data of the WSEN-PDUS, differential pressure sensor on the Diff Press 3 Click boardâ„¢.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[out]press_data: Raw pressure values.
[out]press_data: Raw temperature values.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ diffpress3_get_pressure()

err_t diffpress3_get_pressure ( diffpress3_t * ctx,
float * pressure )

Diff Press 3 get pressure function.

This function reads a differential pressure data in kPa of the WSEN-PDUS, differential pressure sensor on the Diff Press 3 Click boardâ„¢.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[out]pressure: Differential pressure (kPa).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ diffpress3_get_temperature()

err_t diffpress3_get_temperature ( diffpress3_t * ctx,
float * temperature )

Diff Press 3 get temperature function.

This function reads a temperature data in degree Celsius of the WSEN-PDUS, differential pressure sensor on the Diff Press 3 Click boardâ„¢.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[out]temperature: Temperature (degree Celsius).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
WSEN-PDUS sensor support only analog pressure data.

◆ diffpress3_init()

err_t diffpress3_init ( diffpress3_t * ctx,
diffpress3_cfg_t * cfg )

Diff Press 3 initialization function.

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

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

◆ diffpress3_read_raw_adc()

err_t diffpress3_read_raw_adc ( diffpress3_t * ctx,
uint16_t * raw_adc,
diffpress3_d_sel_t data_sel )

Diff Press 3 read raw ADC value function.

This function reads raw ADC value.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[out]raw_adc: Output ADC result.
[out]data_sel: Digital output data selector. See diffpress3_d_sel_t definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ diffpress3_read_voltage()

err_t diffpress3_read_voltage ( diffpress3_t * ctx,
float * voltage )

Diff Press 3 read voltage level function.

This function reads raw ADC value and converts it to proportional voltage level.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ diffpress3_set_vref()

err_t diffpress3_set_vref ( diffpress3_t * ctx,
float vref )

Diff Press 3 set vref function.

This function sets the voltage reference for Diff Press 3 click driver.

Parameters
[in]ctx: Click context object. See diffpress3_t object definition for detailed explanation.
[in]vref: Reference voltage (volts).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The default voltage reference set with diffpress3_init is 3.3V.