loadcell4 2.0.0.0
loadcell4.h File Reference

This file contains API for Load Cell 4 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  loadcell4_t
 Load Cell 4 Click context object. More...
 
struct  loadcell4_cfg_t
 Load Cell 4 Click configuration object. More...
 
struct  loadcell4_data_t
 Load Cell 4 Click data object. More...
 

Macros

#define LOADCELL4_GET_RESULT_ERROR   0
 Load Cell 4 description setting.
 
#define LOADCELL4_GET_RESULT_OK   1
 
#define LOADCELL4_DATA_NO_DATA   0
 
#define LOADCELL4_DATA_OK   1
 
#define LOADCELL4_WEIGHT_100G   100
 
#define LOADCELL4_WEIGHT_500G   500
 
#define LOADCELL4_WEIGHT_1000G   1000
 
#define LOADCELL4_WEIGHT_5000G   5000
 
#define LOADCELL4_WEIGHT_10000G   10000
 
#define LOADCELL4_DEFAULT_WEIGHT_SCALE_COEFFICIENT   0.088495575221
 
#define LOADCELL4_EEPROM_ID_0   0x00
 Load Cell 4 eeprom setting.
 
#define LOADCELL4_EEPROM_CONFIG_1   0x01
 
#define LOADCELL4_EEPROM_CONFIG_2   0x02
 
#define LOADCELL4_EEPROM_OFFSET_BRIDGE   0x03
 
#define LOADCELL4_EEPROM_GAIN_BRIDGE   0x04
 
#define LOADCELL4_EEPROM_TEMP_COF_GAIN   0x05
 
#define LOADCELL4_EEPROM_TEMP_COF_OFFSET   0x06
 
#define LOADCELL4_EEPROM_2ND_ORDER_TEMP_COF_OFFSET   0x07
 
#define LOADCELL4_EEPROM_2ND_ORDER_TEMP_COF_GAIN   0x08
 
#define LOADCELL4_EEPROM_2ND_ORDER_BRIDGE   0x09
 
#define LOADCELL4_EEPROM_OFFSET_TEMP   0x0A
 
#define LOADCELL4_EEPROM_GAINT_TEMP   0x0B
 
#define LOADCELL4_EEPROM_2ND_ORDER_TEMP   0x0C
 
#define LOADCELL4_EEPROM_TEMP_SETL   0x0D
 
#define LOADCELL4_EEPROM_ID_1   0x0E
 
#define LOADCELL4_EEPROM_BRIDGE_CONFIG   0x0F
 
#define LOADCELL4_EEPROM_TEMP_CONFIG   0x10
 
#define LOADCELL4_EEPROM_OSC_TRIM   0x11
 
#define LOADCELL4_EEPROM_SIGNATURE   0x12
 
#define LOADCELL4_EEPROM_ID_2   0x13
 
#define LOADCELL4_EEPROM_WRITE_CMD   0x40
 
#define LOADCELL4_EEPROM_STATUS_READ_READY   0x5A
 
#define LOADCELL4_STATUS_NORMAL   0x00
 Load Cell 4 status.
 
#define LOADCELL4_STATUS_CMD_MODE   0x01
 
#define LOADCELL4_STATUS_STALE_DATA   0x02
 
#define LOADCELL4_STATUS_ERROR   0x03
 
#define LOADCELL4_STATUS_BIT_MASK   0x03
 
#define LOADCELL4_BRIDGE_RES   0x3FFF
 
#define LOADCELL4_DUMMY   0x0000
 Load Cell 4 dummy.
 
#define LOADCELL4_PWR_OFF   0x00
 Load Cell 4 power setting.
 
#define LOADCELL4_PWR_ON   0x01
 
#define LOADCELL4_WEIGHT_ZERO   0.000
 Load Cell 4 zero weight.
 
#define LOADCELL4_NUMB_OF_SUM_AVG_20   20.00
 Load Cell 4 number of average values.
 
#define LOADCELL4_NUMB_OF_SUM_AVG_100   100.0
 
#define LOADCELL4_CMD_MODE_START   0xA0
 Load Cell 4 command mode.
 
#define LOADCELL4_CMD_MODE_STOP   0x80
 
#define LOADCELL4_SET_DEV_ADDR   0x28
 Load Cell 4 device address setting.
 
#define LOADCELL4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  loadcell4_return_value_t { LOADCELL4_OK = 0 , LOADCELL4_ERROR = -1 }
 Load Cell 4 Click return value data. More...
 

Functions

void loadcell4_cfg_setup (loadcell4_cfg_t *cfg)
 Load Cell 4 configuration object setup function.
 
err_t loadcell4_init (loadcell4_t *ctx, loadcell4_cfg_t *cfg)
 Load Cell 4 initialization function.
 
err_t loadcell4_default_cfg (loadcell4_t *ctx)
 Load Cell 4 default configuration function.
 
err_t loadcell4_generic_write (loadcell4_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Load Cell 4 I2C writing function.
 
err_t loadcell4_generic_read (loadcell4_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Load Cell 4 I2C reading function.
 
void loadcell4_read_raw (loadcell4_t *ctx, uint32_t *rx_data)
 Read raw data function.
 
uint8_t loadcell4_read_data (loadcell4_t *ctx, uint16_t *bridge_data, int16_t *temperature_data)
 Read data function.
 
uint16_t loadcell4_read_bridge_data (loadcell4_t *ctx)
 Read bridge data function.
 
void loadcell4_start_cmd_mode (loadcell4_t *ctx)
 Start command mode function.
 
void loadcell4_end_cmd_mode (loadcell4_t *ctx)
 Start command mode function.
 
void loadcell4_power_dev (loadcell4_t *ctx, uint8_t power_state)
 Enable power function.
 
void loadcell4_write_eeprom (loadcell4_t *ctx, uint8_t cmd_byte, uint16_t data_word)
 Write eeprom function.
 
uint16_t loadcell4_read_eeprom (loadcell4_t *ctx, uint8_t cmd_byte)
 Write eeprom function.
 
uint8_t loadcell4_get_int (loadcell4_t *ctx)
 Get state of the INT pin function.
 
void loadcell4_tare (loadcell4_t *ctx, loadcell4_data_t *cell_data)
 Tare the scales function.
 
err_t loadcell4_calibration (loadcell4_t *ctx, uint16_t cal_val, loadcell4_data_t *cell_data)
 Calibration function.
 
float loadcell4_get_weight (loadcell4_t *ctx, loadcell4_data_t *cell_data)
 Get weight function.
 

Detailed Description

This file contains API for Load Cell 4 Click Driver.

Enumeration Type Documentation

◆ loadcell4_return_value_t

Load Cell 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
LOADCELL4_OK 
LOADCELL4_ERROR