loadcell2 2.0.0.0

Functions

void loadcell2_cfg_setup (loadcell2_cfg_t *cfg)
 Config Object Initialization function.
 
LOADCELL2_RETVAL loadcell2_init (loadcell2_t *ctx, loadcell2_cfg_t *cfg)
 Initialization function.
 
void loadcell2_default_cfg (loadcell2_t *ctx)
 Click Default Configuration function.
 
void loadcell2_generic_write (loadcell2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void loadcell2_generic_read (loadcell2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t loadcell2_check_data_ready (loadcell2_t *ctx)
 Check data ready function.
 
void loadcell2_reset (loadcell2_t *ctx)
 Reset function.
 
LOADCELL2_RETVAL loadcell2_power_on (loadcell2_t *ctx)
 Power On function.
 
void loadcell2_set_ldo_voltage (loadcell2_t *ctx)
 Set LDO Voltage function.
 
void loadcell2_set_gain (loadcell2_t *ctx, uint8_t gain_val)
 Set gain function.
 
void loadcell2_set_sample_rate (loadcell2_t *ctx, uint8_t rate_sps)
 Set sample rate function.
 
void loadcell2_turn_off_clk_chp (loadcell2_t *ctx)
 Turn Off clk chp function.
 
void loadcell2_enable_dec_cap (loadcell2_t *ctx)
 Enables PGA output function.
 
void loadcell2_calibrate_afe (loadcell2_t *ctx)
 Calibrate analog front end of system function.
 
uint32_t loadcell2_get_result (loadcell2_t *ctx)
 Get results function.
 
void loadcell2_tare (loadcell2_t *ctx, loadcell2_data_t *cell_data)
 Tare function.
 
uint8_t loadcell2_calibration (loadcell2_t *ctx, uint16_t cal_val, loadcell2_data_t *cell_data)
 Calibration function.
 
float loadcell2_get_weight (loadcell2_t *ctx, loadcell2_data_t *cell_data)
 Get weight function.
 
uint8_t loadcell2_check_drdy (loadcell2_t *ctx)
 Check data ready function.
 

Detailed Description

Function Documentation

◆ loadcell2_calibrate_afe()

void loadcell2_calibrate_afe ( loadcell2_t * ctx)

Calibrate analog front end of system function.

Parameters
loadcell2Click object.

@description The function enables PGA output bypass capacitor of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

Note
It is recommended that the AFE be re-calibrated any time the gain, SPS, or channel number is changed.

◆ loadcell2_calibration()

uint8_t loadcell2_calibration ( loadcell2_t * ctx,
uint16_t cal_val,
loadcell2_data_t * cell_data )

Calibration function.

Parameters
loadcell2Click object.

@description This function do calibration.

◆ loadcell2_cfg_setup()

void loadcell2_cfg_setup ( loadcell2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ loadcell2_check_data_ready()

uint8_t loadcell2_check_data_ready ( loadcell2_t * ctx)

Check data ready function.

Parameters
loadcell2Click object.
Returns
Data ready:
  • 0 : Not ready;
  • 1 : New data ready;

@description The function check measurement data ready of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_check_drdy()

uint8_t loadcell2_check_drdy ( loadcell2_t * ctx)

Check data ready function.

Parameters
loadcell2Click object.
Returns
  • 0 : Data Not Ready;
  • 1 : Data Ready;

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

◆ loadcell2_default_cfg()

void loadcell2_default_cfg ( loadcell2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for LoadCell2 click.

Note
  • set LDO Voltage of 3.3V and internal LDO
  • set gain x128
  • set conversion rate of 80 SPS
  • turn Off clock frequency
  • enables PGA output bypass capacitor

◆ loadcell2_enable_dec_cap()

void loadcell2_enable_dec_cap ( loadcell2_t * ctx)

Enables PGA output function.

Parameters
loadcell2Click object.

@description The function enables PGA output bypass capacitor of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_generic_read()

void loadcell2_generic_read ( loadcell2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ loadcell2_generic_write()

void loadcell2_generic_write ( loadcell2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ loadcell2_get_result()

uint32_t loadcell2_get_result ( loadcell2_t * ctx)

Get results function.

Parameters
loadcell2Click object.

@description The function read ADC conversion result of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_get_weight()

float loadcell2_get_weight ( loadcell2_t * ctx,
loadcell2_data_t * cell_data )

Get weight function.

Parameters
loadcell2Click object.

@description This function messure weight.

◆ loadcell2_init()

LOADCELL2_RETVAL loadcell2_init ( loadcell2_t * ctx,
loadcell2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ loadcell2_power_on()

LOADCELL2_RETVAL loadcell2_power_on ( loadcell2_t * ctx)

Power On function.

Parameters
loadcell2Click object.
Returns
  • 0 : Error;
  • 1 : Success;

@description The function set power up analog and digital circuit of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_reset()

void loadcell2_reset ( loadcell2_t * ctx)

Reset function.

Parameters
loadcell2Click object.

@description The function resets all registers of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_set_gain()

void loadcell2_set_gain ( loadcell2_t * ctx,
uint8_t gain_val )

Set gain function.

Parameters
loadcell2Click object.
gain_valGain select :
  • 128 : LOADCELL2_GAIN_VAL_x128;
  • 64 : LOADCELL2_GAIN_VAL_x64;
  • 32 : LOADCELL2_GAIN_VAL_x32;
  • 16 : LOADCELL2_GAIN_VAL_x16;
  • 8 : LOADCELL2_GAIN_VAL_x8;
  • 4 : LOADCELL2_GAIN_VAL_x4;
  • 2 : LOADCELL2_GAIN_VAL_x2;
  • 1 : LOADCELL2_GAIN_VAL_x1;

@description The function set gain of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_set_ldo_voltage()

void loadcell2_set_ldo_voltage ( loadcell2_t * ctx)

Set LDO Voltage function.

Parameters
loadcell2Click object.

@description The function set LDO Voltage of 3.3V and internal LDO of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_set_sample_rate()

void loadcell2_set_sample_rate ( loadcell2_t * ctx,
uint8_t rate_sps )

Set sample rate function.

Parameters
loadcell2Click object.
rate_spsConversion rate select :
  • 320 : LOADCELL2_CONV_RATE_SPS_320;
  • 80 : LOADCELL2_CONV_RATE_SPS_80;
  • 40 : LOADCELL2_CONV_RATE_SPS_40;
  • 20 : LOADCELL2_CONV_RATE_SPS_20;
  • 10 : LOADCELL2_CONV_RATE_SPS_10;

@description The function set sample rate of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.

◆ loadcell2_tare()

void loadcell2_tare ( loadcell2_t * ctx,
loadcell2_data_t * cell_data )

Tare function.

Parameters
loadcell2Click object.

@description This function tare load cell.

◆ loadcell2_turn_off_clk_chp()

void loadcell2_turn_off_clk_chp ( loadcell2_t * ctx)

Turn Off clk chp function.

Parameters
loadcell2Click object.

@description The function turn Off selected the CLK_CHP clock frequency of NAU7802 24-Bit Dual-Channel ADC on Load Cell 2 Click board.