loadcell3 2.0.0.0
Load Cell 3 Click Driver

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

Topics

 Load Cell 3 Registers List
 List of registers of Load Cell 3 Click driver.
 
 Load Cell 3 Registers Settings
 Settings for registers of Load Cell 3 Click driver.
 
 Load Cell 3 MikroBUS Map
 MikroBUS pin mapping of Load Cell 3 Click driver.
 
 Weight
 
 Status
 

Functions

void loadcell3_cfg_setup (loadcell3_cfg_t *cfg)
 Load Cell 3 configuration object setup function.
 
err_t loadcell3_init (loadcell3_t *ctx, loadcell3_cfg_t *cfg)
 Load Cell 3 initialization function.
 
err_t loadcell3_default_cfg (loadcell3_t *ctx)
 Load Cell 3 default configuration function.
 
err_t loadcell3_generic_write (loadcell3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Load Cell 3 I2C writing function.
 
err_t loadcell3_generic_read (loadcell3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Load Cell 3 I2C reading function.
 
err_t loadcell3_generic_eeprom_write (loadcell3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Load Cell 3 EEPROM I2C writing function.
 
err_t loadcell3_generic_eeprom_read (loadcell3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Load Cell 3 I2C EEPROM reading function.
 
err_t loadcell3_generic_test_page_write (loadcell3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Load Cell 3 test I2C writing function.
 
err_t loadcell3_generic_test_page_read (loadcell3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Load Cell 3 Control and Status I2C EEPROM reading function.
 
err_t loadcell3_set_memory_page_slave_addr (loadcell3_t *ctx, uint8_t memory_page)
 Load Cell 3 set memory page function.
 
err_t loadcell3_accesses_controller (loadcell3_t *ctx)
 Load Cell 3 accesses controller function.
 
err_t loadcell3_accesses_digital_interface_control (loadcell3_t *ctx)
 Load Cell 3 accesses digital interface control function.
 
err_t loadcell3_soft_reset (loadcell3_t *ctx)
 Load Cell 3 soft reset function.
 
err_t loadcell3_set_p_gain (loadcell3_t *ctx, uint8_t p_gain)
 Load Cell 3 set pressure gain function.
 
err_t loadcell3_set_t_gain (loadcell3_t *ctx, uint8_t t_gain)
 Load Cell 3 set temperature gain function.
 
err_t loadcell3_set_temp_mode (loadcell3_t *ctx, uint8_t t_mode)
 Load Cell 3 set temperature mode function.
 
err_t loadcell3_set_t_mux_ctrl (loadcell3_t *ctx, uint8_t t_mux_ctrl)
 Load Cell 3 set mux control function.
 
err_t loadcell3_itemp_ctrl (loadcell3_t *ctx, uint8_t itemp_ctrl)
 Load Cell 3 set ITEMP control function.
 
err_t loadcell3_set_offset (loadcell3_t *ctx, uint8_t offset_cancel_val, uint8_t offset_cancel_sel)
 Load Cell 3 set offset function.
 
int16_t loadcell3_get_p_adc_data (loadcell3_t *ctx)
 Load Cell 3 get pressure ADC data function.
 
int16_t loadcell3_get_t_adc_data (loadcell3_t *ctx)
 Load Cell 3 get temperature ADC data function.
 
void loadcell3_tare (loadcell3_t *ctx, loadcell3_data_t *cell_data)
 Load Cell 3 tare the scales function.
 
err_t loadcell3_calibration (loadcell3_t *ctx, uint16_t cal_val, loadcell3_data_t *cell_data)
 Load Cell 3 calibration function.
 
float loadcell3_get_weight (loadcell3_t *ctx, loadcell3_data_t *cell_data)
 Load Cell 3 get weight function.
 

Detailed Description

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

◆ loadcell3_accesses_controller()

err_t loadcell3_accesses_controller ( loadcell3_t * ctx)

Load Cell 3 accesses controller function.

This function set ccontroller accesses the memory of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_accesses_digital_interface_control()

err_t loadcell3_accesses_digital_interface_control ( loadcell3_t * ctx)

Load Cell 3 accesses digital interface control function.

This function set digital interface accesses the memory of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_calibration()

err_t loadcell3_calibration ( loadcell3_t * ctx,
uint16_t cal_val,
loadcell3_data_t * cell_data )

Load Cell 3 calibration function.

This function for the calibration sets the calibration value into the cell data structure of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]cal_val: Etalon weight value
  • 100 ( LOADCELL3_WEIGHT_100G ) : 100g etalon,
  • 500 ( LOADCELL3_WEIGHT_500G ) : 500g etalon,
  • 1000 ( LOADCELL3_WEIGHT_1000G ) : 1000g etalon,
  • 5000 ( LOADCELL3_WEIGHT_5000G ) : 5000g etalon,
  • 10000 ( LOADCELL3_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 500 ms.

◆ loadcell3_cfg_setup()

void loadcell3_cfg_setup ( loadcell3_cfg_t * cfg)

Load Cell 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ loadcell3_default_cfg()

err_t loadcell3_default_cfg ( loadcell3_t * ctx)

Load Cell 3 default configuration function.

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

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

◆ loadcell3_generic_eeprom_read()

err_t loadcell3_generic_eeprom_read ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Load Cell 3 I2C EEPROM reading function.

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

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

◆ loadcell3_generic_eeprom_write()

err_t loadcell3_generic_eeprom_write ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Load Cell 3 EEPROM I2C writing function.

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

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

◆ loadcell3_generic_read()

err_t loadcell3_generic_read ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Load Cell 3 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 loadcell3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_generic_test_page_read()

err_t loadcell3_generic_test_page_read ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Load Cell 3 Control and Status I2C EEPROM reading function.

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

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

◆ loadcell3_generic_test_page_write()

err_t loadcell3_generic_test_page_write ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Load Cell 3 test I2C writing function.

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

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

◆ loadcell3_generic_write()

err_t loadcell3_generic_write ( loadcell3_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Load Cell 3 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 loadcell3_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_get_p_adc_data()

int16_t loadcell3_get_p_adc_data ( loadcell3_t * ctx)

Load Cell 3 get pressure ADC data function.

This function set desired offset of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
Returns
16-bit pressure ADC data.

See #err_t definition for detailed explanation.

Note
None.

◆ loadcell3_get_t_adc_data()

int16_t loadcell3_get_t_adc_data ( loadcell3_t * ctx)

Load Cell 3 get temperature ADC data function.

This function set desired offset of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
Returns
16-bit temperature ADC data.

See #err_t definition for detailed explanation.

Note
None.

◆ loadcell3_get_weight()

float loadcell3_get_weight ( loadcell3_t * ctx,
loadcell3_data_t * cell_data )

Load Cell 3 get weight function.

This function gets float value of the scales measurements [ g ] of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_init()

err_t loadcell3_init ( loadcell3_t * ctx,
loadcell3_cfg_t * cfg )

Load Cell 3 initialization function.

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

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

◆ loadcell3_itemp_ctrl()

err_t loadcell3_itemp_ctrl ( loadcell3_t * ctx,
uint8_t itemp_ctrl )

Load Cell 3 set ITEMP control function.

This function set desired ITEMP control of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_set_memory_page_slave_addr()

err_t loadcell3_set_memory_page_slave_addr ( loadcell3_t * ctx,
uint8_t memory_page )

Load Cell 3 set memory page function.

This function set memory page slave address to control communication of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]memory_page: Desired memory page slave address.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_set_offset()

err_t loadcell3_set_offset ( loadcell3_t * ctx,
uint8_t offset_cancel_val,
uint8_t offset_cancel_sel )

Load Cell 3 set offset function.

This function set desired offset of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]offset_cancel_val: Desired offset cancel value.
[in]offset_cancel_sel: Desired offset selection value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_set_p_gain()

err_t loadcell3_set_p_gain ( loadcell3_t * ctx,
uint8_t p_gain )

Load Cell 3 set pressure gain function.

This function set desired pressure gain of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]p_gain: Desired pressure gain steps.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_set_t_gain()

err_t loadcell3_set_t_gain ( loadcell3_t * ctx,
uint8_t t_gain )

Load Cell 3 set temperature gain function.

This function set desired temperature gain of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]t_gain: Desired temperature gain steps.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_set_t_mux_ctrl()

err_t loadcell3_set_t_mux_ctrl ( loadcell3_t * ctx,
uint8_t t_mux_ctrl )

Load Cell 3 set mux control function.

This function set desired pressure channel input MUX of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

Parameters
[in]ctx: Click context object. See loadcell3_t object definition for detailed explanation.
[in]t_mux_ctrl: Desired P channel input MUX.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ loadcell3_set_temp_mode()

err_t loadcell3_set_temp_mode ( loadcell3_t * ctx,
uint8_t t_mode )

Load Cell 3 set temperature mode function.

This function set desired temperature mode of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_soft_reset()

err_t loadcell3_soft_reset ( loadcell3_t * ctx)

Load Cell 3 soft reset function.

This function executes a software reset of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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

◆ loadcell3_tare()

void loadcell3_tare ( loadcell3_t * ctx,
loadcell3_data_t * cell_data )

Load Cell 3 tare the scales function.

This function for the tare scales sets the tara value into the cell data structure of the PGA302 Sensor Signal Conditioner With 0-5V Ratiometric Output on the Load Cell 3 click board™.

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