|
barometer8 2.2.0
|
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. | |
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.
| void barometer8_cfg_setup | ( | barometer8_cfg_t * | cfg | ) |
Barometer 8 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See barometer8_cfg_t object definition for detailed explanation. |
| 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.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t barometer8_default_cfg | ( | barometer8_t * | ctx | ) |
Barometer 8 default configuration function.
This function executes a default configuration of Barometer 8 Click board.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
| 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
| [out] | pressure | : Pressure in mBar. |
| [out] | temperature | : Temperature in Celsius. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t barometer8_software_reset | ( | barometer8_t * | ctx | ) |
Barometer 8 software reset function.
This function performs the software reset command.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | 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.
| [in] | ctx | : Click context object. See barometer8_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.