barometer4 2.0.0.0
Barometer 4 Click Driver

API for configuring and manipulating Barometer 4 Click driver. More...

Topics

 Barometer 4 Command List
 List of command of Barometer 4 Click driver.
 
 Barometer 4 Registers Settings
 Settings for registers of Barometer 4 Click driver.
 
 Barometer 4 MikroBUS Map
 MikroBUS pin mapping of Barometer 4 Click driver.
 
 Barometer4_cmd
 

Functions

void barometer4_cfg_setup (barometer4_cfg_t *cfg)
 Barometer 4 configuration object setup function.
 
err_t barometer4_init (barometer4_t *ctx, barometer4_cfg_t *cfg)
 Barometer 4 initialization function.
 
err_t barometer4_default_cfg (barometer4_t *ctx)
 Barometer 4 default configuration function.
 
err_t barometer4_generic_write (barometer4_t *ctx, uint16_t cmd, uint8_t *tx_buf, uint8_t tx_len)
 Barometer 4 I2C writing function.
 
err_t barometer4_generic_read (barometer4_t *ctx, uint16_t cmd, uint16_t *rx_buf, uint8_t rx_len)
 Barometer 4 I2C reading function.
 
err_t barometer4_set_command (barometer4_t *ctx, uint16_t cmd)
 Barometer 4 set command function.
 
err_t barometer4_soft_reset (barometer4_t *ctx)
 Barometer 4 software reset function.
 
err_t barometer4_get_device_id (barometer4_t *ctx, uint16_t *device_id)
 Barometer 4 get device ID function.
 
err_t barometer4_set_up_otp_read (barometer4_t *ctx)
 Barometer 4 set up OTP read function.
 
err_t barometer4_get_otp (barometer4_t *ctx, uint16_t *otp_data)
 Barometer 4 get OTP function.
 
err_t barometer4_inv_invpres_calibration (barometer4_t *ctx, barometer4_invpres_t *cfg_data)
 Barometer 4 inverse process data function.
 
err_t barometer4_get_raw_data (barometer4_t *ctx, uint16_t measurement_comd, uint32_t *pressure, uint16_t *temperature)
 Barometer 4 get RAW data function.
 
err_t barometer4_get_pressure_and_temperature (barometer4_t *ctx, float *pressure, float *temperature)
 Barometer 4 get pressure and temperature function.
 

Detailed Description

API for configuring and manipulating Barometer 4 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

◆ barometer4_cfg_setup()

void barometer4_cfg_setup ( barometer4_cfg_t * cfg)

Barometer 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ barometer4_default_cfg()

err_t barometer4_default_cfg ( barometer4_t * ctx)

Barometer 4 default configuration function.

This function executes a default configuration of Barometer 4 click board.

Parameters
[in]ctx: Click context object. See barometer4_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.

◆ barometer4_generic_read()

err_t barometer4_generic_read ( barometer4_t * ctx,
uint16_t cmd,
uint16_t * rx_buf,
uint8_t rx_len )

Barometer 4 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 barometer4_t object definition for detailed explanation.
[in]cmd: Commands.
[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.

◆ barometer4_generic_write()

err_t barometer4_generic_write ( barometer4_t * ctx,
uint16_t cmd,
uint8_t * tx_buf,
uint8_t tx_len )

Barometer 4 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 barometer4_t object definition for detailed explanation.
[in]cmd: Commands.
[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.

◆ barometer4_get_device_id()

err_t barometer4_get_device_id ( barometer4_t * ctx,
uint16_t * device_id )

Barometer 4 get device ID function.

This function read device ID of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[out]device_id: Device ID value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_get_otp()

err_t barometer4_get_otp ( barometer4_t * ctx,
uint16_t * otp_data )

Barometer 4 get OTP function.

This function read OTP values of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[out]otp_data: OTP values.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_get_pressure_and_temperature()

err_t barometer4_get_pressure_and_temperature ( barometer4_t * ctx,
float * pressure,
float * temperature )

Barometer 4 get pressure and temperature function.

This function read pressure ( Pa ) and temperature ( degree Celsius ) of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[out]pressure: Pressure data ( Pa ).
[out]temperature: Temperature data ( degree Celsius ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_get_raw_data()

err_t barometer4_get_raw_data ( barometer4_t * ctx,
uint16_t measurement_comd,
uint32_t * pressure,
uint16_t * temperature )

Barometer 4 get RAW data function.

This function read RAW data of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[in]measurement_comd: Operation mode measurement commands.
[out]pressure: RAW pressure data.
[out]temperature: RAW temperature data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_init()

err_t barometer4_init ( barometer4_t * ctx,
barometer4_cfg_t * cfg )

Barometer 4 initialization function.

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

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

◆ barometer4_inv_invpres_calibration()

err_t barometer4_inv_invpres_calibration ( barometer4_t * ctx,
barometer4_invpres_t * cfg_data )

Barometer 4 inverse process data function.

This function performs a inverse process data of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[in]cfg_data: Data structure to hold pressure sensor related parameters.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_set_command()

err_t barometer4_set_command ( barometer4_t * ctx,
uint16_t cmd )

Barometer 4 set command function.

This function sets desired command of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
[in]cmd: Desired command.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_set_up_otp_read()

err_t barometer4_set_up_otp_read ( barometer4_t * ctx)

Barometer 4 set up OTP read function.

This function performs a OTP read mode of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ barometer4_soft_reset()

err_t barometer4_soft_reset ( barometer4_t * ctx)

Barometer 4 software reset function.

This function performs a software reset of the ICP-10111, High Accuracy, Low Power, Waterproof Barometric Pressure a nd Temperature Sensor IC on the Barometer 4 click board™.

Parameters
[in]ctx: Click context object. See barometer4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.