loadcell4 2.0.0.0
Load Cell 4 Click Driver

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

Topics

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

Functions

void loadcell4_cfg_setup (loadcell4_cfg_t *cfg)
 Load Cell 4 configuration object setup function.
 
err_t loadcell4_init (loadcell4_t *ctx, loadcell4_cfg_t *cfg)
 Load Cell 4 initialization function.
 
err_t loadcell4_default_cfg (loadcell4_t *ctx)
 Load Cell 4 default configuration function.
 
err_t loadcell4_generic_write (loadcell4_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Load Cell 4 I2C writing function.
 
err_t loadcell4_generic_read (loadcell4_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Load Cell 4 I2C reading function.
 
void loadcell4_read_raw (loadcell4_t *ctx, uint32_t *rx_data)
 Read raw data function.
 
uint8_t loadcell4_read_data (loadcell4_t *ctx, uint16_t *bridge_data, int16_t *temperature_data)
 Read data function.
 
uint16_t loadcell4_read_bridge_data (loadcell4_t *ctx)
 Read bridge data function.
 
void loadcell4_start_cmd_mode (loadcell4_t *ctx)
 Start command mode function.
 
void loadcell4_end_cmd_mode (loadcell4_t *ctx)
 Start command mode function.
 
void loadcell4_power_dev (loadcell4_t *ctx, uint8_t power_state)
 Enable power function.
 
void loadcell4_write_eeprom (loadcell4_t *ctx, uint8_t cmd_byte, uint16_t data_word)
 Write eeprom function.
 
uint16_t loadcell4_read_eeprom (loadcell4_t *ctx, uint8_t cmd_byte)
 Write eeprom function.
 
uint8_t loadcell4_get_int (loadcell4_t *ctx)
 Get state of the INT pin function.
 
void loadcell4_tare (loadcell4_t *ctx, loadcell4_data_t *cell_data)
 Tare the scales function.
 
err_t loadcell4_calibration (loadcell4_t *ctx, uint16_t cal_val, loadcell4_data_t *cell_data)
 Calibration function.
 
float loadcell4_get_weight (loadcell4_t *ctx, loadcell4_data_t *cell_data)
 Get weight function.
 

Detailed Description

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

◆ loadcell4_calibration()

err_t loadcell4_calibration ( loadcell4_t * ctx,
uint16_t cal_val,
loadcell4_data_t * cell_data )

Calibration function.

The function sets calibration and write the cell data structure value of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[in]cal_val: Etalon weight value
[out]cell_data: Pointer to the memory location of the structure where cell data be stored
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Function delay is approximately 100 ms.

◆ loadcell4_cfg_setup()

void loadcell4_cfg_setup ( loadcell4_cfg_t * cfg)

Load Cell 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ loadcell4_default_cfg()

err_t loadcell4_default_cfg ( loadcell4_t * ctx)

Load Cell 4 default configuration function.

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

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

◆ loadcell4_end_cmd_mode()

void loadcell4_end_cmd_mode ( loadcell4_t * ctx)

Start command mode function.

The function performs the end command mode of ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
Returns
Nothing.

◆ loadcell4_generic_read()

err_t loadcell4_generic_read ( loadcell4_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Load Cell 4 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 loadcell4_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.

◆ loadcell4_generic_write()

err_t loadcell4_generic_write ( loadcell4_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Load Cell 4 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 loadcell4_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.

◆ loadcell4_get_int()

uint8_t loadcell4_get_int ( loadcell4_t * ctx)

Get state of the INT pin function.

The function check data ready state by return state of the INT pin of Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
Returns
Data ready state

◆ loadcell4_get_weight()

float loadcell4_get_weight ( loadcell4_t * ctx,
loadcell4_data_t * cell_data )

Get weight function.

The function gets float value of the scales measurements [ g ] of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[out]cell_data: Pointer to the memory location of the structure where cell data be stored
Returns
Float value of the scales measurements
Note
Function delay is approximately 100 ms.

◆ loadcell4_init()

err_t loadcell4_init ( loadcell4_t * ctx,
loadcell4_cfg_t * cfg )

Load Cell 4 initialization function.

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

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

◆ loadcell4_power_dev()

void loadcell4_power_dev ( loadcell4_t * ctx,
uint8_t power_state )

Enable power function.

The function performs power up or power down of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[out]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[in]power_state: Power settings.
Returns
Nothing.

◆ loadcell4_read_bridge_data()

uint16_t loadcell4_read_bridge_data ( loadcell4_t * ctx)

Read bridge data function.

The function read the bridge data of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
Returns
16-bit bridge data.
Nothing.

◆ loadcell4_read_data()

uint8_t loadcell4_read_data ( loadcell4_t * ctx,
uint16_t * bridge_data,
int16_t * temperature_data )

Read data function.

The function read the bridge and temperature data of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[out]bridge_data: Pointer to the memory location where bridge data be stored.
[out]temperature_data: Pointer to the memory location where temperature data be stored.
Returns
Nothing.

◆ loadcell4_read_eeprom()

uint16_t loadcell4_read_eeprom ( loadcell4_t * ctx,
uint8_t cmd_byte )

Write eeprom function.

The function read 16-bit data from the eeprom memmory of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[in]cmd_byte: 8-bit command byte.
Returns
16-bit read data.

◆ loadcell4_read_raw()

void loadcell4_read_raw ( loadcell4_t * ctx,
uint32_t * rx_data )

Read raw data function.

The function read the raw data of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[out]read_buf: Pointer to the memory location where read data be stored.
Returns
Nothing.

◆ loadcell4_start_cmd_mode()

void loadcell4_start_cmd_mode ( loadcell4_t * ctx)

Start command mode function.

The function performs the start command mode of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
Returns
Nothing.

◆ loadcell4_tare()

void loadcell4_tare ( loadcell4_t * ctx,
loadcell4_data_t * cell_data )

Tare the scales function.

The function for tare scales sets tara value in the to the cell data structure.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[out]cell_data: Pointer to the memory location of the structure where cell data be stored.
Returns
Nothing.
Note
Function delay is approximately 105 ms.

◆ loadcell4_write_eeprom()

void loadcell4_write_eeprom ( loadcell4_t * ctx,
uint8_t cmd_byte,
uint16_t data_word )

Write eeprom function.

The function write 16-bit data to the eeprom memmory of the ZSC31014, RBicilite� Digital Output Sensor Signal Conditioner on Load Cell 4 Click board.

Parameters
[in]cfg: Click configuration structure. See loadcell4_cfg_t object definition for detailed explanation.
[in]cmd_byte: 8-bit command byte.
[in]write_word: 16-bit write data.
Returns
Nothing.