diffpress4 2.1.0.0
|
API for configuring and manipulating Diff Press 4 Click driver. More...
Topics | |
Diff Press 4 Registers List | |
List of registers of Diff Press 4 Click driver. | |
Diff Press 4 Registers Settings | |
Settings for registers of Diff Press 4 Click driver. | |
Diff Press 4 MikroBUS Map | |
MikroBUS pin mapping of Diff Press 4 Click driver. | |
Functions | |
void | diffpress4_cfg_setup (diffpress4_cfg_t *cfg) |
Diff Press 4 configuration object setup function. | |
err_t | diffpress4_init (diffpress4_t *ctx, diffpress4_cfg_t *cfg) |
Diff Press 4 initialization function. | |
err_t | diffpress4_set_slave_address (diffpress4_t *ctx, uint8_t slave_address) |
Diff Press 4 set I2C Slave address function. | |
err_t | diffpress4_generic_write (diffpress4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Diff Press 4 I2C writing function. | |
err_t | diffpress4_generic_read (diffpress4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Diff Press 4 I2C reading function. | |
err_t | diffpress4_set_sleep_mode (diffpress4_t *ctx) |
Diff Press 4 set sleep mode function. | |
err_t | diffpress4_sw_reset (diffpress4_t *ctx) |
Diff Press 4 software reset function. | |
err_t | diffpress4_get_serial_number (diffpress4_t *ctx, uint32_t *serial_number) |
Diff Press 4 get serial number function. | |
err_t | diffpress4_get_status (diffpress4_t *ctx, diffpress4_status_t *status) |
Diff Press 4 get status function. | |
err_t | diffpress4_get_raw_data (diffpress4_t *ctx, int16_t *temp_data, int16_t *press_data) |
Diff Press 4 gets the raw data function. | |
err_t | diffpress4_get_measurement_data (diffpress4_t *ctx, float *diff_press, float *temperature) |
Diff Press 4 gets the raw data function. | |
API for configuring and manipulating Diff Press 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void diffpress4_cfg_setup | ( | diffpress4_cfg_t * | cfg | ) |
Diff Press 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See diffpress4_cfg_t object definition for detailed explanation. |
err_t diffpress4_generic_read | ( | diffpress4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Diff Press 4 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See diffpress4_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 diffpress4_generic_write | ( | diffpress4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Diff Press 4 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See diffpress4_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 diffpress4_get_measurement_data | ( | diffpress4_t * | ctx, |
float * | diff_press, | ||
float * | temperature ) |
Diff Press 4 gets the raw data function.
This function reads the pressure and temperature raw data values of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[out] | diff_press | : Diff pressure [Pa]. |
[out] | temperature | : Temperature [degree Celsius]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_get_raw_data | ( | diffpress4_t * | ctx, |
int16_t * | temp_data, | ||
int16_t * | press_data ) |
Diff Press 4 gets the raw data function.
This function reads the pressure and temperature raw data values of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[out] | temp_data | : Temperature data. |
[out] | press_data | : Pressure data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_get_serial_number | ( | diffpress4_t * | ctx, |
uint32_t * | serial_number ) |
Diff Press 4 get serial number function.
This function reads serial number data values of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[out] | serial_number | : Serial number value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_get_status | ( | diffpress4_t * | ctx, |
diffpress4_status_t * | status ) |
Diff Press 4 get status function.
This function reads status data values of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[out] | status | : Status object. See diffpress4_status_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_init | ( | diffpress4_t * | ctx, |
diffpress4_cfg_t * | cfg ) |
Diff Press 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See diffpress4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_set_slave_address | ( | diffpress4_t * | ctx, |
uint8_t | slave_address ) |
Diff Press 4 set I2C Slave address function.
This function sets I2C address of the subordinate I2C device to address which is targeted by read and write operations.
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
[in] | slave_address | Specified I2C slave address. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_set_sleep_mode | ( | diffpress4_t * | ctx | ) |
Diff Press 4 set sleep mode function.
This function is used to initiate a shutdown state of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t diffpress4_sw_reset | ( | diffpress4_t * | ctx | ) |
Diff Press 4 software reset function.
This function performs the reset sequence of the SM9336, SMI ultra-low pressure digital sensor
[in] | ctx | : Click context object. See diffpress4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.