force5 2.0.0.0
force5.h File Reference

This file contains API for Force 5 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  force5_t
 Force 5 Click context object. More...
 
struct  force5_cfg_t
 Force 5 Click configuration object. More...
 
struct  force5_data_t
 Force 5 Click data object. More...
 
struct  force5_calibration_t
 Force 5 Click calibration object. More...
 

Macros

#define FORCE5_STATES_BIT_MASK   0x03
 Force 5 states.
 
#define FORCE5_STATES_NORMAL_OPERATION   0x00
 
#define FORCE5_STATES_COMMAND_MODE   0x01
 
#define FORCE5_STATES_STALE_DATA   0x02
 
#define FORCE5_STATES_DIAGNOSTIC_CONDITION   0x03
 
#define FORCE5_FORCE_SENSOR_10_N   10.0
 Force 5 force calculation.
 
#define FORCE5_FORCE_SENSOR_25_N   25.0
 
#define FORCE5_FORCE_MAX_VALUE   14745.0
 
#define FORCE5_SET_DEV_ADDR   0x28
 Force 5 device address setting.
 
#define FORCE5_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  force5_return_value_t { FORCE5_OK = 0 , FORCE5_ERROR = -1 }
 Force 5 Click return value data. More...
 

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

This file contains API for Force 5 Click Driver.

Enumeration Type Documentation

◆ force5_return_value_t

Force 5 Click return value data.

Predefined enum values for driver return values.

Enumerator
FORCE5_OK 
FORCE5_ERROR