barometer8 2.0.0.0
Barometer 8 Click Driver

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

Topics

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

Functions

void barometer8_cfg_setup (barometer8_cfg_t *cfg)
 Barometer 8 configuration object setup function.
 
void barometer8_drv_interface_selection (barometer8_cfg_t *cfg, barometer8_drv_t drv_sel)
 Barometer 8 driver interface setup function.
 
err_t barometer8_init (barometer8_t *ctx, barometer8_cfg_t *cfg)
 Barometer 8 initialization function.
 
err_t barometer8_default_cfg (barometer8_t *ctx)
 Barometer 8 default configuration function.
 
err_t barometer8_generic_write (barometer8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Barometer 8 data writing function.
 
err_t barometer8_generic_read (barometer8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Barometer 8 data reading function.
 
err_t barometer8_write_register (barometer8_t *ctx, uint8_t reg, uint8_t data_in)
 Barometer 8 write register function.
 
err_t barometer8_read_register (barometer8_t *ctx, uint8_t reg, uint8_t *data_out)
 Barometer 8 read register function.
 
err_t barometer8_check_communication (barometer8_t *ctx)
 Barometer 8 check communication function.
 
err_t barometer8_software_reset (barometer8_t *ctx)
 Barometer 8 software reset function.
 
err_t barometer8_read_data (barometer8_t *ctx, float *pressure, float *temperature)
 Barometer 8 read data function.
 

Detailed Description

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

◆ barometer8_cfg_setup()

void barometer8_cfg_setup ( barometer8_cfg_t * cfg)

Barometer 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ barometer8_check_communication()

err_t barometer8_check_communication ( barometer8_t * ctx)

Barometer 8 check communication function.

This function checks the communication by reading and verifying the WHO_AM_I register value.

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

◆ barometer8_default_cfg()

err_t barometer8_default_cfg ( barometer8_t * ctx)

Barometer 8 default configuration function.

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

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

◆ barometer8_drv_interface_selection()

void barometer8_drv_interface_selection ( barometer8_cfg_t * cfg,
barometer8_drv_t drv_sel )

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

◆ barometer8_generic_read()

err_t barometer8_generic_read ( barometer8_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Barometer 8 data reading function.

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

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

◆ barometer8_generic_write()

err_t barometer8_generic_write ( barometer8_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Barometer 8 data writing function.

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

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

◆ barometer8_init()

err_t barometer8_init ( barometer8_t * ctx,
barometer8_cfg_t * cfg )

Barometer 8 initialization function.

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

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

◆ barometer8_read_data()

err_t barometer8_read_data ( barometer8_t * ctx,
float * pressure,
float * temperature )

Barometer 8 read data function.

This function reads the pressure and temperature raw data and converts them to mBar and Celsius.

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

◆ barometer8_read_register()

err_t barometer8_read_register ( barometer8_t * ctx,
uint8_t reg,
uint8_t * data_out )

Barometer 8 read register function.

This function reads a data byte from the selected register.

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

◆ barometer8_software_reset()

err_t barometer8_software_reset ( barometer8_t * ctx)

Barometer 8 software reset function.

This function performs the software reset command.

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

◆ barometer8_write_register()

err_t barometer8_write_register ( barometer8_t * ctx,
uint8_t reg,
uint8_t data_in )

Barometer 8 write register function.

This function writes a desired data byte to the selected register.

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