ultralowpress 2.0.0.0
|
API for configuring and manipulating Ultra-Low Press Click driver. More...
Topics | |
Ultra-Low Press Registers List | |
List of registers of Ultra-Low Press Click driver. | |
Ultra-Low Press Registers Settings | |
Settings for registers of Ultra-Low Press Click driver. | |
Ultra-Low Press MikroBUS Map | |
MikroBUS pin mapping of Ultra-Low Press Click driver. | |
Functions | |
void | ultralowpress_cfg_setup (ultralowpress_cfg_t *cfg) |
Ultra-Low Press configuration object setup function. | |
err_t | ultralowpress_init (ultralowpress_t *ctx, ultralowpress_cfg_t *cfg) |
Ultra-Low Press initialization function. | |
err_t | ultralowpress_generic_write (ultralowpress_t *ctx, uint8_t reg, uint16_t tx_data) |
Writing function. | |
err_t | ultralowpress_generic_read (ultralowpress_t *ctx, uint8_t reg, uint16_t *rx_data) |
Reading function. | |
void | ultralowpress_clear_status (ultralowpress_t *ctx) |
Clear status. | |
uint8_t | ultralowpress_ready_to_read (ultralowpress_t *ctx) |
Ready to read. | |
float | ultralowpress_get_press (ultralowpress_t *ctx) |
Read pressure. | |
float | ultralowpress_get_temp (ultralowpress_t *ctx) |
Read temperature. | |
API for configuring and manipulating Ultra-Low Press Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ultralowpress_cfg_setup | ( | ultralowpress_cfg_t * | cfg | ) |
Ultra-Low Press configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
void ultralowpress_clear_status | ( | ultralowpress_t * | ctx | ) |
Clear status.
Clears status register by writing 0xFFFF to it.
[out] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
err_t ultralowpress_generic_read | ( | ultralowpress_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | rx_data ) |
Reading function.
This function reads data word from register by using I2C serial interface.
[in] | ctx | : Click context object. See ultralowpress_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_data | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultralowpress_generic_write | ( | ultralowpress_t * | ctx, |
uint8_t | reg, | ||
uint16_t | tx_data ) |
Writing function.
This function writes a data word to register by using I2C serial interface.
[in] | ctx | : Click context object. See ultralowpress_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_data | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. float ultralowpress_get_press | ( | ultralowpress_t * | ctx | ) |
Read pressure.
Reads pressure from register and calculates and converts data to Pascal data.
[out] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
float ultralowpress_get_temp | ( | ultralowpress_t * | ctx | ) |
Read temperature.
Reads temperature from register and calculates and converts data to Celzius data.
[out] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
err_t ultralowpress_init | ( | ultralowpress_t * | ctx, |
ultralowpress_cfg_t * | cfg ) |
Ultra-Low Press initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ultralowpress_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t ultralowpress_ready_to_read | ( | ultralowpress_t * | ctx | ) |
Ready to read.
Reads status and checks if status bits for temperature and pressure data is ready.
[out] | cfg | : Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation. |
1
- Temperature and pressure data ready to read. 0
- Temperature and pressure data not ready to read.