39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define FORCE5_STATES_BIT_MASK 0x03
74#define FORCE5_STATES_NORMAL_OPERATION 0x00
75#define FORCE5_STATES_COMMAND_MODE 0x01
76#define FORCE5_STATES_STALE_DATA 0x02
77#define FORCE5_STATES_DIAGNOSTIC_CONDITION 0x03
83#define FORCE5_FORCE_SENSOR_10_N 10.0
84#define FORCE5_FORCE_SENSOR_25_N 25.0
86#define FORCE5_FORCE_MAX_VALUE 14745.0
93#define FORCE5_SET_DEV_ADDR 0x28
111#define FORCE5_MAP_MIKROBUS( cfg, mikrobus ) \
112 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
113 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
force5_return_value_t
Force 5 Click return value data.
Definition force5.h:171
@ FORCE5_ERROR
Definition force5.h:173
@ FORCE5_OK
Definition force5.h:172
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.
uint8_t force5_calibration(force5_t *ctx, force5_calibration_t *calib_data)
Calibration the sensor function.
uint8_t force5_get_force_value(force5_t *ctx, uint16_t *force)
Get force value function.
err_t force5_read_byte(force5_t *ctx, uint8_t *rx_data, uint8_t n_bytes)
Generic read data 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.
uint8_t force5_get_temperature_value(force5_t *ctx, uint16_t *temp)
Get temperature value function.
void force5_read_all_data(force5_t *ctx, force5_data_t *force_data)
Read all data function.
float force5_get_temperature(force5_t *ctx)
Get temperature function.
float force5_get_force(force5_t *ctx, force5_calibration_t calib_data)
Get force function.
void force5_cfg_setup(force5_cfg_t *cfg)
Force 5 configuration object setup function.
force5_calibration_t calib_data
Definition main.c:29
Force 5 Click calibration object.
Definition force5.h:162
uint16_t force_claib_data
Definition force5.h:163
Force 5 Click configuration object.
Definition force5.h:137
uint32_t i2c_speed
Definition force5.h:141
pin_name_t scl
Definition force5.h:138
pin_name_t sda
Definition force5.h:139
uint8_t i2c_address
Definition force5.h:142
Force 5 Click data object.
Definition force5.h:151
uint16_t force_data
Definition force5.h:153
uint16_t temp_data
Definition force5.h:154
uint8_t status_data
Definition force5.h:152
Force 5 Click context object.
Definition force5.h:123
i2c_master_t i2c
Definition force5.h:125
uint8_t slave_address
Definition force5.h:128