diffpress2 2.0.0.0
|
API for configuring and manipulating Diff Press 2 Click driver. More...
Topics | |
Diff Press 2 Registers List | |
List of registers of Diff Press 2 Click driver. | |
Diff Press 2 Registers Settings | |
Settings for registers of Diff Press 2 Click driver. | |
Diff Press 2 MikroBUS Map | |
MikroBUS pin mapping of Diff Press 2 Click driver. | |
Functions | |
void | diffpress2_cfg_setup (diffpress2_cfg_t *cfg) |
Diff Press 2 configuration object setup function. | |
err_t | diffpress2_init (diffpress2_t *ctx, diffpress2_cfg_t *cfg) |
Diff Press 2 initialization function. | |
err_t | diffpress2_default_cfg (diffpress2_t *ctx) |
Diff Press 2 default configuration function. | |
err_t | diffpress2_send_command (diffpress2_t *ctx, uint16_t cmd) |
Command writing function. | |
err_t | diffpress2_generic_read (diffpress2_t *ctx, uint16_t cmd, uint16_t *rx_buf, uint8_t rx_len) |
Command reading function. | |
err_t | diffpress2_raw_read (diffpress2_t *ctx, uint16_t *rx_buf, uint8_t rx_len) |
Reading function. | |
err_t | diffpress2_get_id (diffpress2_t *ctx) |
Reads device ID's. | |
err_t | diffpress2_reset (diffpress2_t *ctx) |
Reset device. | |
err_t | diffpress2_trigger_measurement (diffpress2_t *ctx, uint16_t trigger_type, float *diff_press, float *temperature) |
Pressure and temperature reading. | |
API for configuring and manipulating Diff Press 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void diffpress2_cfg_setup | ( | diffpress2_cfg_t * | cfg | ) |
Diff Press 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See diffpress2_cfg_t object definition for detailed explanation. |
err_t diffpress2_default_cfg | ( | diffpress2_t * | ctx | ) |
Diff Press 2 default configuration function.
This function executes a default configuration of Diff Press 2 click board.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t diffpress2_generic_read | ( | diffpress2_t * | ctx, |
uint16_t | cmd, | ||
uint16_t * | rx_buf, | ||
uint8_t | rx_len ) |
Command reading function.
This function reads a desired number of data words from the selected command.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
[in] | cmd | : Command. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t diffpress2_get_id | ( | diffpress2_t * | ctx | ) |
Reads device ID's.
This function reads a product and serial id's from device. Checks if product ID is correctly read and stores them in context object.
[in,out] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t diffpress2_init | ( | diffpress2_t * | ctx, |
diffpress2_cfg_t * | cfg ) |
Diff Press 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See diffpress2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t diffpress2_raw_read | ( | diffpress2_t * | ctx, |
uint16_t * | rx_buf, | ||
uint8_t | rx_len ) |
Reading function.
This function reads a desired number of data words.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t diffpress2_reset | ( | diffpress2_t * | ctx | ) |
Reset device.
This function resets device with reset sequence command.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t diffpress2_send_command | ( | diffpress2_t * | ctx, |
uint16_t | cmd ) |
Command writing function.
This function sends a word of data to device.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
[in] | cmd | : Command. |
0
- Success, -1
- Error.err_t diffpress2_trigger_measurement | ( | diffpress2_t * | ctx, |
uint16_t | trigger_type, | ||
float * | diff_press, | ||
float * | temperature ) |
Pressure and temperature reading.
This function reads a pressure and temperature for selected type of trigger measurement and calculates value with scale factors for pressure and temperature.
[in] | ctx | : Click context object. See diffpress2_t object definition for detailed explanation. |
[in] | tigger_type | : Trigger measurement type. |
[out] | diff_press | : Output pressure data in Pasacl. |
[out] | temperature | : Output temperature data in degrees Celsius. |
0
- Success, -1
- Error.