loadcell5 2.0.0.0
Load Cell 5 Click Driver

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

Topics

 Load Cell 5 Registers Settings
 Settings for registers of Load Cell 5 Click driver.
 
 Load Cell 5 MikroBUS Map
 MikroBUS pin mapping of Load Cell 5 Click driver.
 
 Loadcell5_get
 
 Loadcell5_cfg_data
 

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

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

◆ loadcell5_calibration()

err_t loadcell5_calibration ( loadcell5_t * ctx,
uint16_t cal_val,
loadcell5_data_t * cell_data )

Load Cell 5 calibration function.

This function for the calibration sets the calibration value into the cell data structure of the AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[in]cal_val: Etalon weight value
  • 100 ( LOADCELL4_WEIGHT_100G ) : 100g etalon,
  • 500 ( LOADCELL4_WEIGHT_500G ) : 500g etalon,
  • 1000 ( LOADCELL4_WEIGHT_1000G ) : 1000g etalon,
  • 5000 ( LOADCELL4_WEIGHT_5000G ) : 5000g etalon,
  • 10000 ( LOADCELL4_WEIGHT_10000G ) : 10000g etalon.
[out]cell_data: Pointer to the memory location of the structure where data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Function delay is approximately 1800 ms.

◆ loadcell5_cfg_setup()

void loadcell5_cfg_setup ( loadcell5_cfg_t * cfg)

Load Cell 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ loadcell5_check_data_ready()

uint8_t loadcell5_check_data_ready ( loadcell5_t * ctx)

Load Cell 5 get error function.

This function reads the state of the RDY ( INT ) pin of Load Cell 5 click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
Returns
  • 0 - INT pin state low,
  • 1 - INT pin state high.
Note
None.

◆ loadcell5_default_cfg()

err_t loadcell5_default_cfg ( loadcell5_t * ctx)

Load Cell 5 default configuration function.

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

Parameters
[in]ctx: Click context object. See loadcell5_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.

◆ loadcell5_filter_select()

err_t loadcell5_filter_select ( loadcell5_t * ctx,
uint8_t fil_sel )

Load Cell 5 filter select function.

This function adjusts the selection for the filter of the he AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[in]fil_sel:
  • 0x00 ( LOADCELL5_UPDATE_RATE_16_7_Hz ) : Fast settling filter, update rate is set to 16.7 Hz,
  • 0x01 ( LOADCELL5_UPDATE_RATE_10_Hz ) : Update rate is set to 10 Hz.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell5_get_data()

err_t loadcell5_get_data ( loadcell5_t * ctx,
uint8_t * status,
uint32_t * adc_data )

Load Cell 5 data reading function.

This function reads a status and ADC data from the AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

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

◆ loadcell5_get_weight()

float loadcell5_get_weight ( loadcell5_t * ctx,
loadcell5_data_t * cell_data )

Load Cell 5 get weight function.

This function gets float value of the scales measurements [ g ] of the AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[out]cell_data: Pointer to the memory location of the structure where data be stored.
Returns
Float value of the scales measurements [ g ].
Note
Function delay is approximately 1800 ms.

◆ loadcell5_hw_reset()

void loadcell5_hw_reset ( loadcell5_t * ctx)

Load Cell 5 set hardware reset function.

This function performs hardware reset of the he AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
Returns
Nothing.
Note
Function delay is approximately 20 ms.

◆ loadcell5_init()

err_t loadcell5_init ( loadcell5_t * ctx,
loadcell5_cfg_t * cfg )

Load Cell 5 initialization function.

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

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

◆ loadcell5_read_adc()

uint32_t loadcell5_read_adc ( loadcell5_t * ctx)

Load Cell 5 reading ADC data function.

This function reads the ADC data from the AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
Returns
24-bit ADC data.
Note
None.

◆ loadcell5_set_gain()

err_t loadcell5_set_gain ( loadcell5_t * ctx,
uint8_t gain )

Load Cell 5 set gain function.

This function adjusts the selection for the gain of the he AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[in]gain:
  • 1 ( LOADCELL5_GAIN_1 ) : The gain is set to 1,
  • 128 ( LOADCELL5_GAIN_128 ) : The gain is set to 128.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell5_set_power_mode()

err_t loadcell5_set_power_mode ( loadcell5_t * ctx,
uint8_t pwr_mode )

Load Cell 5 set power mode function.

This function performs power up or power down of the he AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[in]pwr_mode:
  • 0x00 ( LOADCELL5_MODE_POWER_DOWN ) : Power OFF,
  • 0x01 ( LOADCELL5_MODE_POWER_UP ) : Power ON.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell5_tare()

void loadcell5_tare ( loadcell5_t * ctx,
loadcell5_data_t * cell_data )

Load Cell 5 tare the scales function.

This function for the tare scales sets the tara value into the cell data structure of the AD7780 24-Bit, Pin-Programmable, Ultralow Power Sigma-Delta ADC on Load Cell 5 Click board.

Parameters
[in]ctx: Click context object. See loadcell5_t object definition for detailed explanation.
[out]cell_data: Pointer to the memory location of the structure where data be stored.
Returns
Nothing.
Note
Function delay is approximately 1800 ms.