pressure20 2.0.0.0
|
API for configuring and manipulating Pressure 20 Click driver. More...
Topics | |
Pressure 20 Registers List | |
List of registers of Pressure 20 Click driver. | |
Pressure 20 Registers Settings | |
Settings for registers of Pressure 20 Click driver. | |
Pressure 20 MikroBUS Map | |
MikroBUS pin mapping of Pressure 20 Click driver. | |
Functions | |
void | pressure20_cfg_setup (pressure20_cfg_t *cfg) |
Pressure 20 configuration object setup function. | |
void | pressure20_drv_interface_selection (pressure20_cfg_t *cfg, pressure20_drv_t drv_sel) |
Pressure 20 driver interface setup function. | |
err_t | pressure20_init (pressure20_t *ctx, pressure20_cfg_t *cfg) |
Pressure 20 initialization function. | |
err_t | pressure20_default_cfg (pressure20_t *ctx) |
Pressure 20 default configuration function. | |
err_t | pressure20_generic_write (pressure20_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Pressure 20 data writing function. | |
err_t | pressure20_generic_read (pressure20_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Pressure 20 data reading function. | |
err_t | pressure20_write_register (pressure20_t *ctx, uint8_t reg, uint8_t data_in) |
Pressure 20 write register function. | |
err_t | pressure20_read_register (pressure20_t *ctx, uint8_t reg, uint8_t *data_out) |
Pressure 20 read register function. | |
err_t | pressure20_check_communication (pressure20_t *ctx) |
Pressure 20 check communication function. | |
err_t | pressure20_write_mode_select (pressure20_t *ctx, uint8_t mode_select) |
Pressure 20 write mode select function. | |
err_t | pressure20_read_otp_data (pressure20_t *ctx, uint8_t otp_address, uint8_t *data_out) |
Pressure 20 read otp data function. | |
err_t | pressure20_read_data (pressure20_t *ctx, float *pressure, float *temperature) |
Pressure 20 read data function. | |
uint8_t | pressure20_get_int_pin (pressure20_t *ctx) |
Pressure 20 get int pin function. | |
err_t | pressure20_clear_interrupts (pressure20_t *ctx) |
Pressure 20 clear interrupts function. | |
API for configuring and manipulating Pressure 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void pressure20_cfg_setup | ( | pressure20_cfg_t * | cfg | ) |
Pressure 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See pressure20_cfg_t object definition for detailed explanation. |
err_t pressure20_check_communication | ( | pressure20_t * | ctx | ) |
Pressure 20 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pressure20_clear_interrupts | ( | pressure20_t * | ctx | ) |
Pressure 20 clear interrupts function.
This function reads and clears the interrupt status register.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pressure20_default_cfg | ( | pressure20_t * | ctx | ) |
Pressure 20 default configuration function.
This function executes a default configuration of Pressure 20 click board.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void pressure20_drv_interface_selection | ( | pressure20_cfg_t * | cfg, |
pressure20_drv_t | drv_sel ) |
Pressure 20 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 pressure20_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See pressure20_drv_t object definition for detailed explanation. |
err_t pressure20_generic_read | ( | pressure20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Pressure 20 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See pressure20_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 pressure20_generic_write | ( | pressure20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Pressure 20 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See pressure20_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. uint8_t pressure20_get_int_pin | ( | pressure20_t * | ctx | ) |
Pressure 20 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
err_t pressure20_init | ( | pressure20_t * | ctx, |
pressure20_cfg_t * | cfg ) |
Pressure 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See pressure20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pressure20_read_data | ( | pressure20_t * | ctx, |
float * | pressure, | ||
float * | temperature ) |
Pressure 20 read data function.
This function reads the pressure [mBar] and temperature [Celsius] data.
[in] | ctx | : Click context object. See pressure20_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 pressure20_read_otp_data | ( | pressure20_t * | ctx, |
uint8_t | otp_address, | ||
uint8_t * | data_out ) |
Pressure 20 read otp data function.
This function reads the OTP data from the selected register.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
[in] | otp_address | : OTP register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pressure20_read_register | ( | pressure20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Pressure 20 read register function.
This function reads data from the selected register.
[in] | ctx | : Click context object. See pressure20_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 pressure20_write_mode_select | ( | pressure20_t * | ctx, |
uint8_t | mode_select ) |
Pressure 20 write mode select function.
This function writes data to the mode select register.
[in] | ctx | : Click context object. See pressure20_t object definition for detailed explanation. |
[in] | mode_select | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pressure20_write_register | ( | pressure20_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Pressure 20 write register function.
This function writes a desired data to the selected register.
[in] | ctx | : Click context object. See pressure20_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.