force5 2.0.0.0
|
API for configuring and manipulating Force 5 Click driver. More...
Topics | |
Force 5 Registers Settings | |
Settings for registers of Force 5 Click driver. | |
Force 5 MikroBUS Map | |
MikroBUS pin mapping of Force 5 Click driver. | |
Functions | |
void | force5_cfg_setup (force5_cfg_t *cfg) |
Force 5 configuration object setup function. | |
err_t | force5_init (force5_t *ctx, force5_cfg_t *cfg) |
Force 5 initialization function. | |
err_t | force5_generic_write (force5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Force 5 I2C writing function. | |
err_t | force5_generic_read (force5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Force 5 I2C reading function. | |
err_t | force5_read_byte (force5_t *ctx, uint8_t *rx_data, uint8_t n_bytes) |
Generic read data function. | |
void | force5_read_all_data (force5_t *ctx, force5_data_t *force_data) |
Read all data function. | |
uint8_t | force5_get_force_value (force5_t *ctx, uint16_t *force) |
Get force value function. | |
uint8_t | force5_get_temperature_value (force5_t *ctx, uint16_t *temp) |
Get temperature value function. | |
uint8_t | force5_calibration (force5_t *ctx, force5_calibration_t *calib_data) |
Calibration the sensor function. | |
float | force5_get_force (force5_t *ctx, force5_calibration_t calib_data) |
Get force function. | |
float | force5_get_temperature (force5_t *ctx) |
Get temperature function. | |
API for configuring and manipulating Force 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
uint8_t force5_calibration | ( | force5_t * | ctx, |
force5_calibration_t * | calib_data ) |
Calibration the sensor function.
The function calibrate.
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[out] | calib_data | : Pointer to the memory location where data is stored. |
void force5_cfg_setup | ( | force5_cfg_t * | cfg | ) |
Force 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See force5_cfg_t object definition for detailed explanation. |
err_t force5_generic_read | ( | force5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Force 5 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 force5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t force5_generic_write | ( | force5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Force 5 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 force5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.float force5_get_force | ( | force5_t * | ctx, |
force5_calibration_t | calib_data ) |
Get force function.
The function get force.
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[in] | calib_data | : Structure where calibration data be stored. |
uint8_t force5_get_force_value | ( | force5_t * | ctx, |
uint16_t * | force ) |
Get force value function.
The function get force value.
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[out] | force | : Pointer to the memory location where 14-bit data be stored. |
float force5_get_temperature | ( | force5_t * | ctx | ) |
Get temperature function.
The function get temperature.
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
uint8_t force5_get_temperature_value | ( | force5_t * | ctx, |
uint16_t * | temp ) |
Get temperature value function.
The function get temperature value.
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[out] | temp | : Pointer to the memory location where 14-bit data be stored. |
err_t force5_init | ( | force5_t * | ctx, |
force5_cfg_t * | cfg ) |
Force 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See force5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void force5_read_all_data | ( | force5_t * | ctx, |
force5_data_t * | force_data ) |
Read all data function.
The function read all data and store to the structure
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[out] | force_data | : Pointer to the memory location where data be stored. |
err_t force5_read_byte | ( | force5_t * | ctx, |
uint8_t * | rx_data, | ||
uint8_t | n_bytes ) |
Generic read data function.
The function read data is used to read multiple data bytes ( 2, 3 or 4 )
[in] | ctx | : Click context object. See force5_t object definition for detailed explanation. |
[out] | rx_data | : Pointer to the memory location where data be stored. |
[in] | n_bytes | : Number of bytes to be written. |
0
- Success, -1
- Error.