loadcell8
2.1.0.0
|
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... | |
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.
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void loadcell8_cfg_setup | ( | loadcell8_cfg_t * | cfg | ) |
Load Cell 8 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See loadcell8_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See loadcell8_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void loadcell8_hw_reset | ( | loadcell8_t * | ctx | ) |
Load Cell 8 HW reset function.
This function performs hardware reset with delay of 20 ms.
[in] | ctx | : Click context object. See loadcell8_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See loadcell8_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.