loadcell5 2.0.0.0
loadcell5.h File Reference

This file contains API for Load Cell 5 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  loadcell5_t
 Load Cell 5 Click context object. More...
 
struct  loadcell5_cfg_t
 Load Cell 5 Click configuration object. More...
 
struct  loadcell5_data_t
 Load Cell 5 Click data structure definition. More...
 

Macros

#define LOADCELL5_MODE_POWER_DOWN   0x00
 Load Cell 5 ADC power mode setting.
 
#define LOADCELL5_MODE_POWER_UP   0x01
 
#define LOADCELL5_UPDATE_RATE_16_7_Hz   0x00
 Load Cell 5 Filter Select setting.
 
#define LOADCELL5_UPDATE_RATE_10_Hz   0x01
 
#define LOADCELL5_GAIN_1   1
 Load Cell 5 gain setting.
 
#define LOADCELL5_GAIN_128   128
 
#define LOADCELL5_NEW_DATA_IS_AVAILABLE   0
 Load Cell 5 check data ready.
 
#define LOADCELL5_NO_DATA   1
 
#define LOADCELL5_STATUS_PAT_ADC_PERFORMED_NOT_CORRECTLY   0x00
 Load Cell 5 status.
 
#define LOADCELL5_STATUS_PAT_ADC_PERFORMED_CORRECTLY   0x01
 
#define LOADCELL5_STATUS_GAIN_128   0x00
 
#define LOADCELL5_STATUS_GAIN_1   0x04
 
#define LOADCELL5_STATUS_BITS_ID_0   0x08
 
#define LOADCELL5_STATUS_BITS_ID_1   0x10
 
#define LOADCELL5_STATUS_ERROR   0x20
 
#define LOADCELL5_STATUS_FILTER_UPDATE_RATE_16_7_HZ   0x00
 
#define LOADCELL5_STATUS_FILTER_UPDATE_RATE_10_HZ   0x40
 
#define LOADCELL5_STATUS_CONVERSION_NOT_AVAILABLE   0x80
 
#define LOADCELL5_STATUS_CONVERSION_IS_AVAILABLE   0x00
 
#define LOADCELL5_STATUS_CONVERSION_NOT_AVAILABLE   0x80
 
#define LOADCELL5_DATA_NO_DATA   0
 Load Cell 5 data status.
 
#define LOADCELL5_DATA_OK   1
 
#define LOADCELL5_WEIGHT_ZERO   0
 Load Cell 5 weight data.
 
#define LOADCELL5_WEIGHT_100G   100
 
#define LOADCELL5_WEIGHT_500G   500
 
#define LOADCELL5_WEIGHT_1000G   1000
 
#define LOADCELL5_WEIGHT_5000G   5000
 
#define LOADCELL5_WEIGHT_10000G   10000
 
#define LOADCELL5_STATUS_PAT_ADC_PERFORMED_NOT_CORRECTLY   0x00
 Load Cell 5 status.
 
#define LOADCELL5_STATUS_PAT_ADC_PERFORMED_CORRECTLY   0x01
 
#define LOADCELL5_STATUS_GAIN_128   0x00
 
#define LOADCELL5_STATUS_GAIN_1   0x04
 
#define LOADCELL5_STATUS_BITS_ID_0   0x08
 
#define LOADCELL5_STATUS_BITS_ID_1   0x10
 
#define LOADCELL5_STATUS_ERROR   0x20
 
#define LOADCELL5_STATUS_FILTER_UPDATE_RATE_16_7_HZ   0x00
 
#define LOADCELL5_STATUS_FILTER_UPDATE_RATE_10_HZ   0x40
 
#define LOADCELL5_STATUS_CONVERSION_NOT_AVAILABLE   0x80
 
#define LOADCELL5_STATUS_CONVERSION_IS_AVAILABLE   0x00
 
#define LOADCELL5_STATUS_CONVERSION_NOT_AVAILABLE   0x80
 
#define LOADCELL5_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  loadcell5_return_value_t { LOADCELL5_OK = 0 , LOADCELL5_ERROR = -1 }
 Load Cell 5 Click return value data. More...
 

Functions

void loadcell5_cfg_setup (loadcell5_cfg_t *cfg)
 Load Cell 5 configuration object setup function.
 
err_t loadcell5_init (loadcell5_t *ctx, loadcell5_cfg_t *cfg)
 Load Cell 5 initialization function.
 
err_t loadcell5_default_cfg (loadcell5_t *ctx)
 Load Cell 5 default configuration function.
 
err_t loadcell5_set_power_mode (loadcell5_t *ctx, uint8_t pwr_mode)
 Load Cell 5 set power mode function.
 
void loadcell5_hw_reset (loadcell5_t *ctx)
 Load Cell 5 set hardware reset function.
 
err_t loadcell5_filter_select (loadcell5_t *ctx, uint8_t fil_sel)
 Load Cell 5 filter select function.
 
err_t loadcell5_set_gain (loadcell5_t *ctx, uint8_t gain)
 Load Cell 5 set gain function.
 
err_t loadcell5_get_data (loadcell5_t *ctx, uint8_t *status, uint32_t *adc_data)
 Load Cell 5 data reading function.
 
uint32_t loadcell5_read_adc (loadcell5_t *ctx)
 Load Cell 5 reading ADC data function.
 
void loadcell5_tare (loadcell5_t *ctx, loadcell5_data_t *cell_data)
 Load Cell 5 tare the scales function.
 
err_t loadcell5_calibration (loadcell5_t *ctx, uint16_t cal_val, loadcell5_data_t *cell_data)
 Load Cell 5 calibration function.
 
float loadcell5_get_weight (loadcell5_t *ctx, loadcell5_data_t *cell_data)
 Load Cell 5 get weight function.
 
uint8_t loadcell5_check_data_ready (loadcell5_t *ctx)
 Load Cell 5 get error function.
 

Detailed Description

This file contains API for Load Cell 5 Click Driver.

Enumeration Type Documentation

◆ loadcell5_return_value_t

Load Cell 5 Click return value data.

Predefined enum values for driver return values.

Enumerator
LOADCELL5_OK 
LOADCELL5_ERROR