force5 2.0.0.0
Force 5 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ force5_calibration()

uint8_t force5_calibration ( force5_t * ctx,
force5_calibration_t * calib_data )

Calibration the sensor function.

The function calibrate.

Parameters
[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.
Returns
Force 5 states bit See #force5_set object definition for detailed explanation.

◆ force5_cfg_setup()

void force5_cfg_setup ( force5_cfg_t * cfg)

Force 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See force5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ force5_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ force5_generic_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ force5_get_force()

float force5_get_force ( force5_t * ctx,
force5_calibration_t calib_data )

Get force function.

The function get force.

Parameters
[in]ctx: Click context object. See force5_t object definition for detailed explanation.
[in]calib_data: Structure where calibration data be stored.
Returns
Float force ( N ).

◆ force5_get_force_value()

uint8_t force5_get_force_value ( force5_t * ctx,
uint16_t * force )

Get force value function.

The function get force value.

Parameters
[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.
Returns
Force 5 states bit See #force5_set object definition for detailed explanation.

◆ force5_get_temperature()

float force5_get_temperature ( force5_t * ctx)

Get temperature function.

The function get temperature.

Parameters
[in]ctx: Click context object. See force5_t object definition for detailed explanation.
Returns
Float temperature ( degree Celsius ).

◆ force5_get_temperature_value()

uint8_t force5_get_temperature_value ( force5_t * ctx,
uint16_t * temp )

Get temperature value function.

The function get temperature value.

Parameters
[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.
Returns
Force 5 states bit See #force5_set object definition for detailed explanation.

◆ force5_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ force5_read_all_data()

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

Parameters
[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.
Returns
Nothing.

◆ force5_read_byte()

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 )

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.