pressure14 2.0.0.0
Pressure 14 Click Driver

API for configuring and manipulating Pressure 14 Click driver. More...

Topics

 Pressure 14 Status Registers List
 List of registers of Pressure 14 Click driver.
 
 Pressure 14 Registers Settings
 Settings for registers of Pressure 14 Click driver.
 
 Pressure 14 MikroBUS Map
 MikroBUS pin mapping of Pressure 14 Click driver.
 
 Pressure14_pressure_conversion_units
 
 Pressure14_temperature_conversion_units
 
 Pressure14_pressure_conversion_constants
 
 Pressure14_temperature_conversion_constants
 
 Pressure14_general_sensor_constants
 

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

API for configuring and manipulating Pressure 14 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

◆ pressure14_cfg_setup()

void pressure14_cfg_setup ( pressure14_cfg_t * cfg)

Pressure 14 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ pressure14_check_busy_flag_int()

uint8_t pressure14_check_busy_flag_int ( pressure14_t * ctx)

Pressure 14 checks INT pin state function.

This function returns the INT pin state which indicates the End-of-conversion for ABP2 series pressure sensor on Pressure 14 click board.

Parameters
[in]ctx: Click context object. See pressure14_t object definition for detailed explanation.
Returns
INT pin state.

See #err_t definition for detailed explanation.

Note
None.

◆ pressure14_generic_read()

err_t pressure14_generic_read ( pressure14_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Pressure 14 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ pressure14_generic_write()

err_t pressure14_generic_write ( pressure14_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Pressure 14 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ pressure14_get_pressure()

float pressure14_get_pressure ( uint32_t pressure_raw,
uint8_t conv_unit )

Pressure 14 calculate pressure function.

This function calculates raw pressure data acquired from the ABP2 series pressure sensor on Pressure 14 click board, and converts the result into preferred unit.

Parameters
[in]pressure_raw: Input parameter of raw pressure to be converted into a more meaningful value.
[in]conv_unit: Preferred conversion unit for measured pressure.
Returns
The result of the calculation pressure.

See #err_t definition for detailed explanation.

Note
None.

◆ pressure14_get_temperature()

float pressure14_get_temperature ( uint32_t temperature_raw,
uint8_t conv_unit )

Pressure 14 calculate temperature function.

This function calculates raw temperature data acquired from the ABP2 series pressure sensor on Pressure 14 click board, and converts the result into preferred unit.

Parameters
[in]temperature_raw: input parameter of raw temperature to be converted into a more meaningful value.
[out]conv_unit: Preferred conversion unit for measured temperature.
Returns
The result of the calculation temperature.

See #err_t definition for detailed explanation.

Note
None.

◆ pressure14_init()

err_t pressure14_init ( pressure14_t * ctx,
pressure14_cfg_t * cfg )

Pressure 14 initialization function.

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

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

◆ pressure14_measure_cmd()

void pressure14_measure_cmd ( pressure14_t * ctx)

Pressure 14 output Measurement Command function.

This function sends output measurement command that causes the ABP2 series pressure sensor to exit standby mode and enter operating mode.

Parameters
[in]ctx: Click context object. See pressure14_t object definition for detailed explanation.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.

◆ pressure14_read_press_and_temp()

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.

This function reads 24-bit pressure, 24-bit temperature data and 8-bit status register from the ABP2 series pressure sensor on Pressure 14 click board.

Parameters
[in]ctx: Click context object. See pressure14_t object definition for detailed explanation.
[in]status_byte: Pointer to the memory location where the 8-bit status will be stored.
[out]pressure_data: Pointer to the memory location where the raw pressure data will be stored.
[in]temp_data: Pointer to the memory location where the raw temperature data will be stored.
Returns
Nothing.

See #err_t definition for detailed explanation.

Note
None.