loadcell7 2.1.0.0
Load Cell 7 Click Driver

API for configuring and manipulating Load Cell 7 Click driver. More...

Topics

 Load Cell 7 Registers Settings
 Settings for registers of Load Cell 7 Click driver.
 
 Load Cell 7 MikroBUS Map
 MikroBUS pin mapping of Load Cell 7 Click driver.
 

Functions

void loadcell7_cfg_setup (loadcell7_cfg_t *cfg)
 Load Cell 7 configuration object setup function.
 
err_t loadcell7_init (loadcell7_t *ctx, loadcell7_cfg_t *cfg)
 Load Cell 7 initialization function.
 
void loadcell7_enable_device (loadcell7_t *ctx)
 Load Cell 7 enable device function.
 
void loadcell7_disable_device (loadcell7_t *ctx)
 Load Cell 7 disable device function.
 
err_t loadcell7_read_raw_adc (loadcell7_t *ctx, int32_t *data_out)
 Load Cell 7 read raw adc function.
 
err_t loadcell7_tare_scale (loadcell7_t *ctx)
 Load Cell 7 tare scale function.
 
err_t loadcell7_calibrate_weight (loadcell7_t *ctx, float cal_weight)
 Load Cell 7 calibrate weight function.
 
err_t loadcell7_get_weight (loadcell7_t *ctx, float *weight)
 Load Cell 7 get weight function.
 

Detailed Description

API for configuring and manipulating Load Cell 7 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

◆ loadcell7_calibrate_weight()

err_t loadcell7_calibrate_weight ( loadcell7_t * ctx,
float cal_weight )

Load Cell 7 calibrate weight function.

This function calibrates the weight by calculating the ctx->weight_scale for the input calibration weight.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
[in]cal_weight: Calibration weight value in grams of the goods placed on the scale.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell7_cfg_setup()

void loadcell7_cfg_setup ( loadcell7_cfg_t * cfg)

Load Cell 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ loadcell7_disable_device()

void loadcell7_disable_device ( loadcell7_t * ctx)

Load Cell 7 disable device function.

This function disables the device by setting the CS (PWDN) pin to low logic state.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ loadcell7_enable_device()

void loadcell7_enable_device ( loadcell7_t * ctx)

Load Cell 7 enable device function.

This function enables the device by setting the CS (PWDN) pin to high logic state.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ loadcell7_get_weight()

err_t loadcell7_get_weight ( loadcell7_t * ctx,
float * weight )

Load Cell 7 get weight function.

This function calculates the weight of the goods in grams.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
[out]weight: The weight of the goods in grams.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function relies on the loadcell7_tare_scale and loadcell7_calibrate_weight functions calculation results.

◆ loadcell7_init()

err_t loadcell7_init ( loadcell7_t * ctx,
loadcell7_cfg_t * cfg )

Load Cell 7 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See loadcell7_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell7_read_raw_adc()

err_t loadcell7_read_raw_adc ( loadcell7_t * ctx,
int32_t * data_out )

Load Cell 7 read raw adc function.

This function reads raw ADC measurements using SPI serial interface.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
[out]data_out: 24-bit ADC data out.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell7_tare_scale()

err_t loadcell7_tare_scale ( loadcell7_t * ctx)

Load Cell 7 tare scale function.

This function calculates the ctx->tare_scale which is the raw ADC readings of the empty container.

Parameters
[in]ctx: Click context object. See loadcell7_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.