barometer11 2.2.0
Loading...
Searching...
No Matches
Barometer 11 Click Driver

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

Topics

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

Functions

void barometer11_cfg_setup (barometer11_cfg_t *cfg)
 Barometer 11 configuration object setup function.
void barometer11_drv_interface_sel (barometer11_cfg_t *cfg, barometer11_drv_t drv_sel)
 Barometer 11 driver interface setup function.
err_t barometer11_init (barometer11_t *ctx, barometer11_cfg_t *cfg)
 Barometer 11 initialization function.
err_t barometer11_read_raw_adc (barometer11_t *ctx, uint16_t *raw_adc)
 Barometer 11 read raw ADC value function.
err_t barometer11_read_voltage (barometer11_t *ctx, float *voltage)
 Barometer 11 read voltage level function.
err_t barometer11_read_voltage_avg (barometer11_t *ctx, uint16_t num_conv, float *voltage_avg)
 Barometer 11 read average voltage level function.
err_t barometer11_set_vref (barometer11_t *ctx, float vref)
 Barometer 11 set vref function.
err_t barometer11_read_pressure (barometer11_t *ctx, float *pressure)
 Barometer 11 read pressure function.

Detailed Description

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

◆ barometer11_cfg_setup()

void barometer11_cfg_setup ( barometer11_cfg_t * cfg)

Barometer 11 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ barometer11_drv_interface_sel()

void barometer11_drv_interface_sel ( barometer11_cfg_t * cfg,
barometer11_drv_t drv_sel )

Barometer 11 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 barometer11_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See barometer11_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called 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.

◆ barometer11_init()

err_t barometer11_init ( barometer11_t * ctx,
barometer11_cfg_t * cfg )

Barometer 11 initialization function.

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

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

◆ barometer11_read_pressure()

err_t barometer11_read_pressure ( barometer11_t * ctx,
float * pressure )

Barometer 11 read pressure function.

This function reads the pressure level [mBar].

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

◆ barometer11_read_raw_adc()

err_t barometer11_read_raw_adc ( barometer11_t * ctx,
uint16_t * raw_adc )

Barometer 11 read raw ADC value function.

This function reads raw ADC value.

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

◆ barometer11_read_voltage()

err_t barometer11_read_voltage ( barometer11_t * ctx,
float * voltage )

Barometer 11 read voltage level function.

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

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

◆ barometer11_read_voltage_avg()

err_t barometer11_read_voltage_avg ( barometer11_t * ctx,
uint16_t num_conv,
float * voltage_avg )

Barometer 11 read average voltage level function.

This function reads a desired number of ADC samples and calculates the average voltage level.

Parameters
[in]ctx: Click context object. See barometer11_t object definition for detailed explanation.
[in]num_conv: Number of ADC samples.
[out]voltage_avg: Average 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.

◆ barometer11_set_vref()

err_t barometer11_set_vref ( barometer11_t * ctx,
float vref )

Barometer 11 set vref function.

This function sets the voltage reference for Barometer 11 Click driver.

Parameters
[in]ctx: Click context object. See barometer11_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 barometer11_init is 3.3V.