loadcell8  2.1.0.0
Modules | Functions
Load Cell 8 Click Driver

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

Modules

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

Functions

void loadcell8_cfg_setup (loadcell8_cfg_t *cfg)
 Load Cell 8 configuration object setup function. More...
 
err_t loadcell8_init (loadcell8_t *ctx, loadcell8_cfg_t *cfg)
 Load Cell 8 initialization function. More...
 
err_t loadcell8_default_cfg (loadcell8_t *ctx)
 Load Cell 8 default configuration function. More...
 
err_t loadcell8_generic_write (loadcell8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Load Cell 8 I2C writing function. More...
 
err_t loadcell8_generic_read (loadcell8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Load Cell 8 I2C reading function. More...
 
void loadcell8_hw_reset (loadcell8_t *ctx)
 Load Cell 8 HW reset function. More...
 
err_t loadcell8_read_raw_adc (loadcell8_t *ctx, uint32_t *raw_adc)
 Load Cell 8 read raw ADC value function. More...
 
err_t loadcell8_tare_scale (loadcell8_t *ctx, loadcell8_data_t *cell_data)
 Load Cell 8 read raw ADC value function. More...
 
err_t loadcell8_calibration_weight (loadcell8_t *ctx, uint16_t cal_val, loadcell8_data_t *cell_data)
 Load Cell 8 calibrate weight function. More...
 
err_t loadcell8_get_weight (loadcell8_t *ctx, loadcell8_data_t *cell_data, float *weight_g)
 Load Cell 8 get weight function. More...
 

Detailed Description

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

◆ loadcell8_calibration_weight()

err_t loadcell8_calibration_weight ( loadcell8_t ctx,
uint16_t  cal_val,
loadcell8_data_t cell_data 
)

Load Cell 8 calibrate weight function.

This function calibrates the weight by calculating the cell_data for the input calibration weight by using I2C serial interface.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[in]cal_val: Etalon weight value.
[out]cell_data: Cell data object. See loadcell8_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell8_cfg_setup()

void loadcell8_cfg_setup ( loadcell8_cfg_t cfg)

Load Cell 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ loadcell8_default_cfg()

err_t loadcell8_default_cfg ( loadcell8_t ctx)

Load Cell 8 default configuration function.

This function executes a default configuration of Load Cell 8 click board.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ loadcell8_generic_read()

err_t loadcell8_generic_read ( loadcell8_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

Load Cell 8 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell8_generic_write()

err_t loadcell8_generic_write ( loadcell8_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Load Cell 8 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell8_get_weight()

err_t loadcell8_get_weight ( loadcell8_t ctx,
loadcell8_data_t cell_data,
float *  weight_g 
)

Load Cell 8 get weight function.

This function calculates the weight of the goods in grams.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[out]cell_data: Cell data object. See loadcell8_data_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
None.

◆ loadcell8_hw_reset()

void loadcell8_hw_reset ( loadcell8_t ctx)

Load Cell 8 HW reset function.

This function performs hardware reset with delay of 20 ms.

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

◆ loadcell8_init()

err_t loadcell8_init ( loadcell8_t ctx,
loadcell8_cfg_t cfg 
)

Load Cell 8 initialization function.

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

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

◆ loadcell8_read_raw_adc()

err_t loadcell8_read_raw_adc ( loadcell8_t ctx,
uint32_t *  raw_adc 
)

Load Cell 8 read raw ADC value function.

This function reads raw ADC value by using I2C serial interface.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[out]raw_adc: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ loadcell8_tare_scale()

err_t loadcell8_tare_scale ( loadcell8_t ctx,
loadcell8_data_t cell_data 
)

Load Cell 8 read raw ADC value function.

This function calculates the cell_data which is the raw ADC readings of the empty container by using I2C serial interface.

Parameters
[in]ctx: Click context object. See loadcell8_t object definition for detailed explanation.
[out]cell_data: Cell data object. See loadcell8_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.