barometer13 2.1.0.0
Barometer 13 Click Driver

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

Topics

 Barometer 13 Registers List
 List of registers of Barometer 13 Click driver.
 
 Barometer 13 Registers Settings
 Settings for registers of Barometer 13 Click driver.
 
 Barometer 13 MikroBUS Map
 MikroBUS pin mapping of Barometer 13 Click driver.
 

Functions

void barometer13_cfg_setup (barometer13_cfg_t *cfg)
 Barometer 13 configuration object setup function.
 
void barometer13_drv_interface_sel (barometer13_cfg_t *cfg, barometer13_drv_t drv_sel)
 Barometer 13 driver interface setup function.
 
err_t barometer13_init (barometer13_t *ctx, barometer13_cfg_t *cfg)
 Barometer 13 initialization function.
 
err_t barometer13_default_cfg (barometer13_t *ctx)
 Barometer 13 default configuration function.
 
err_t barometer13_generic_write (barometer13_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Barometer 13 data writing function.
 
err_t barometer13_generic_read (barometer13_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Barometer 13 data reading function.
 
err_t barometer13_reg_write (barometer13_t *ctx, uint8_t reg, uint8_t data_in)
 Barometer 13 register data writing function.
 
err_t barometer13_reg_read (barometer13_t *ctx, uint8_t reg, uint8_t *data_out)
 Barometer 13 register data reading function.
 
err_t barometer13_get_device_id (barometer13_t *ctx, uint8_t *chip_id, uint8_t *rev_id)
 Barometer 13 get device ID function.
 
err_t barometer13_set_int_cfg (barometer13_t *ctx, uint8_t int_en, uint8_t int_od, uint8_t int_pol, uint8_t int_mode)
 Barometer 13 set the interrupt config function.
 
err_t barometer13_set_drdy_data (barometer13_t *ctx, uint8_t en_drdy_data)
 Barometer 13 set data ready function.
 
err_t barometer13_get_int_status (barometer13_t *ctx, uint8_t *int_status)
 Barometer 13 get interrupt status function.
 
err_t barometer13_set_shdw_sel (barometer13_t *ctx, uint8_t shdw_sel_iir_p, uint8_t shdw_sel_iir_t)
 Barometer 13 set shadow IIR selection function.
 
err_t barometer13_set_lpf_band_flt (barometer13_t *ctx, uint8_t set_iir_p, uint8_t set_iir_t)
 Barometer 13 set LPF band filter function.
 
err_t barometer13_set_osr (barometer13_t *ctx, uint8_t osr_p, uint8_t osr_t)
 Barometer 13 set over-sampling rate function.
 
err_t barometer13_press_enable (barometer13_t *ctx)
 Barometer 13 enable pressure data function.
 
err_t barometer13_set_odr (barometer13_t *ctx, uint8_t odr)
 Barometer 13 set the output data rate function.
 
err_t barometer13_set_pwr_mode (barometer13_t *ctx, uint8_t pwr_mode)
 Barometer 13 set power mode configuration function.
 
err_t barometer13_get_raw_data (barometer13_t *ctx, int32_t *press_data, int32_t *temp_data)
 Barometer 13 get raw data function.
 
err_t barometer13_get_measurement (barometer13_t *ctx, float *pressure, float *temperature)
 Barometer 13 get the measurement data function.
 
err_t barometer13_get_pressure (barometer13_t *ctx, float *pressure)
 Barometer 13 get the pressure data function.
 
uint8_t barometer13_get_interrupt (barometer13_t *ctx)
 Barometer 13 get the interrupt function.
 

Detailed Description

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

◆ barometer13_cfg_setup()

void barometer13_cfg_setup ( barometer13_cfg_t * cfg)

Barometer 13 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ barometer13_default_cfg()

err_t barometer13_default_cfg ( barometer13_t * ctx)

Barometer 13 default configuration function.

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

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

◆ barometer13_drv_interface_sel()

void barometer13_drv_interface_sel ( barometer13_cfg_t * cfg,
barometer13_drv_t drv_sel )

Barometer 13 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 barometer13_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See barometer13_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.

◆ barometer13_generic_read()

err_t barometer13_generic_read ( barometer13_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Barometer 13 data reading function.

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

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

◆ barometer13_generic_write()

err_t barometer13_generic_write ( barometer13_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Barometer 13 data writing function.

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

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

◆ barometer13_get_device_id()

err_t barometer13_get_device_id ( barometer13_t * ctx,
uint8_t * chip_id,
uint8_t * rev_id )

Barometer 13 get device ID function.

This function reads the ASIC identification ID and revision ID of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[out]chip_id: ASIC identification ID.
[out]rev_id: ASIC revision ID.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_get_int_status()

err_t barometer13_get_int_status ( barometer13_t * ctx,
uint8_t * int_status )

Barometer 13 get interrupt status function.

This function reads the interrupt status of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_get_interrupt()

uint8_t barometer13_get_interrupt ( barometer13_t * ctx)

Barometer 13 get the interrupt function.

This function get states of the interrupt [INT] pin of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ barometer13_get_measurement()

err_t barometer13_get_measurement ( barometer13_t * ctx,
float * pressure,
float * temperature )

Barometer 13 get the measurement data function.

This function reads the pressure and temperature measurement data of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_get_pressure()

err_t barometer13_get_pressure ( barometer13_t * ctx,
float * pressure )

Barometer 13 get the pressure data function.

This function reads the pressure measurement data of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[out]pressure: Pressure value [mBar-hPa].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_get_raw_data()

err_t barometer13_get_raw_data ( barometer13_t * ctx,
int32_t * press_data,
int32_t * temp_data )

Barometer 13 get raw data function.

This function reads the pressure and temperature raw data value of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_init()

err_t barometer13_init ( barometer13_t * ctx,
barometer13_cfg_t * cfg )

Barometer 13 initialization function.

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

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

◆ barometer13_press_enable()

err_t barometer13_press_enable ( barometer13_t * ctx)

Barometer 13 enable pressure data function.

This function is used to enabled pressure data output of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_reg_read()

err_t barometer13_reg_read ( barometer13_t * ctx,
uint8_t reg,
uint8_t * data_out )

Barometer 13 register data reading function.

This function reads the data bytes from the selected register of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_reg_write()

err_t barometer13_reg_write ( barometer13_t * ctx,
uint8_t reg,
uint8_t data_in )

Barometer 13 register data writing function.

This function writes the data bytes to the selected register of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_set_drdy_data()

err_t barometer13_set_drdy_data ( barometer13_t * ctx,
uint8_t en_drdy_data )

Barometer 13 set data ready function.

This function sets the data ready of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]en_drdy_data: Data ready enable-disable.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_set_int_cfg()

err_t barometer13_set_int_cfg ( barometer13_t * ctx,
uint8_t int_en,
uint8_t int_od,
uint8_t int_pol,
uint8_t int_mode )

Barometer 13 set the interrupt config function.

This function sets the interrupt configuration of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]int_en: Interrupt enabling.
[in]int_od: Interrupt pin config.
[in]int_pol: Interrupt polarity.
[in]int_mode: Interrupt mode.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_set_lpf_band_flt()

err_t barometer13_set_lpf_band_flt ( barometer13_t * ctx,
uint8_t set_iir_p,
uint8_t set_iir_t )

Barometer 13 set LPF band filter function.

This function sets the LPF band filter selection of the pressure and temperature data of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]set_iir_p: Pressure IIR LPF band filter selection.
[in]set_iir_t: Temperature IIR LPF band filter selection
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This field cannot be written during an ongoing P/T conversion.

◆ barometer13_set_odr()

err_t barometer13_set_odr ( barometer13_t * ctx,
uint8_t odr )

Barometer 13 set the output data rate function.

This function sets the pressure and temperature output data rate of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_set_osr()

err_t barometer13_set_osr ( barometer13_t * ctx,
uint8_t osr_p,
uint8_t osr_t )

Barometer 13 set over-sampling rate function.

This function sets the pressure and temperature over-sampling data rate of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]osr_p: Pressure over-sampling data rate.
[in]osr_t: Temperature over-sampling data rate.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ barometer13_set_pwr_mode()

err_t barometer13_set_pwr_mode ( barometer13_t * ctx,
uint8_t pwr_mode )

Barometer 13 set power mode configuration function.

This function sets the pressure and temperature power mode configuration of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

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

◆ barometer13_set_shdw_sel()

err_t barometer13_set_shdw_sel ( barometer13_t * ctx,
uint8_t shdw_sel_iir_p,
uint8_t shdw_sel_iir_t )

Barometer 13 set shadow IIR selection function.

This function sets the shadow registers IIR selection of the pressure and temperature data of the BMP585, Barometric Pressure Sensor on the Barometer 13 Click board™.

Parameters
[in]ctx: Click context object. See barometer13_t object definition for detailed explanation.
[in]shdw_sel_iir_p: IIR selection pressure data.
[in]shdw_sel_iir_t: IIR selection temperature data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.