|
barometer11 2.2.0
|
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. | |
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.
| void barometer11_cfg_setup | ( | barometer11_cfg_t * | cfg | ) |
Barometer 11 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See barometer11_cfg_t object definition for detailed explanation. |
| 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.
| [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. |
| 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t barometer11_read_pressure | ( | barometer11_t * | ctx, |
| float * | pressure ) |
Barometer 11 read pressure function.
This function reads the pressure level [mBar].
| [in] | ctx | : Click context object. See barometer11_t object definition for detailed explanation. |
| [out] | pressure | : Pressure level [mBar]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer11_t object definition for detailed explanation. |
| [out] | raw_adc | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer11_t object definition for detailed explanation. |
| [out] | voltage | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer11_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.