loadcell6 2.0.0.0
loadcell6.h File Reference

This file contains API for Load Cell 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  loadcell6_t
 Load Cell 6 Click context object. More...
 
struct  loadcell6_cfg_t
 Load Cell 6 Click configuration object. More...
 
struct  loadcell6_data_t
 Load Cell 6 Click load cell data object. More...
 

Macros

#define LOADCELL6_REG_STAT   0x00
 Load Cell 6 description register.
 
#define LOADCELL6_REG_CTRL1   0x01
 
#define LOADCELL6_REG_CTRL2   0x02
 
#define LOADCELL6_REG_CTRL3   0x03
 
#define LOADCELL6_REG_CTRL4   0x04
 
#define LOADCELL6_REG_CTRL5   0x05
 
#define LOADCELL6_REG_DATA   0x06
 
#define LOADCELL6_REG_SOC_SPI   0x07
 
#define LOADCELL6_REG_SCG_SPI   0x08
 
#define LOADCELL6_REG_SCOC_SPI   0x09
 
#define LOADCELL6_REG_SCGC_SPI   0x0A
 
#define LOADCELL6_REG_RAM   0x0C
 
#define LOADCELL6_REG_SYNC_SPI   0x0D
 
#define LOADCELL6_REG_SOC_ADC   0x15
 
#define LOADCELL6_REG_SCG_ADC   0x16
 
#define LOADCELL6_REG_SCOC_ADC   0x17
 
#define LOADCELL6_REG_SCGC_ADC   0x18
 
#define LOADCELL6_CMD_RATE0   0x01
 Load Cell 6 description setting.
 
#define LOADCELL6_CMD_RATE1   0x02
 
#define LOADCELL6_CMD_RATE2   0x04
 
#define LOADCELL6_CMD_RATE3   0x08
 
#define LOADCELL6_CMD_IMPD   0x10
 
#define LOADCELL6_CMD_CAL   0x20
 
#define LOADCELL6_CMD_START   0x80
 
#define LOADCELL6_CMD_REG_ACCESS_MODE   0x40
 
#define LOADCELL6_STAT_RDY   0x0001
 Load Cell 6 STAT register bits description.
 
#define LOADCELL6_STAT_MSTAT   0x0002
 
#define LOADCELL6_STAT_DOR   0x0004
 
#define LOADCELL6_STAT_SYSGOR   0x0008
 
#define LOADCELL6_STAT_RATE0   0x0010
 
#define LOADCELL6_STAT_RATE1   0x0020
 
#define LOADCELL6_STAT_RATE2   0x0040
 
#define LOADCELL6_STAT_RATE3   0x0080
 
#define LOADCELL6_STAT_AOR   0x0100
 
#define LOADCELL6_STAT_RDERR   0x0200
 
#define LOADCELL6_STAT_PDSTAT0   0x0400
 
#define LOADCELL6_STAT_PDSTAT1   0x0800
 
#define LOADCELL6_STAT_ERROR   0x4000
 
#define LOADCELL6_STAT_INRESET   0x8000
 
#define LOADCELL6_CTRL1_CONTSC   0x01
 Load Cell 6 CTRL1 register bits description.
 
#define LOADCELL6_CTRL1_SCYCLE   0x02
 
#define LOADCELL6_CTRL1_FORMAT   0x04
 
#define LOADCELL6_CTRL1_U_B   0x08
 
#define LOADCELL6_CTRL1_PD0   0x10
 
#define LOADCELL6_CTRL1_PD1   0x20
 
#define LOADCELL6_CTRL1_SYNC   0x40
 
#define LOADCELL6_CTRL1_EXTCK   0x80
 
#define LOADCELL6_CTRL2_PGAIN_x1   0x00
 Load Cell 6 CTRL2 register bits description.
 
#define LOADCELL6_CTRL2_PGAIN_x2   0x01
 
#define LOADCELL6_CTRL2_PGAIN_x4   0x02
 
#define LOADCELL6_CTRL2_PGAIN_x8   0x03
 
#define LOADCELL6_CTRL2_PGAIN_x16   0x04
 
#define LOADCELL6_CTRL2_PGAIN_x32   0x05
 
#define LOADCELL6_CTRL2_PGAIN_x64   0x06
 
#define LOADCELL6_CTRL2_PGAIN_x128   0x07
 
#define LOADCELL6_CTRL2_PGAGEN   0x08
 
#define LOADCELL6_CTRL2_LPMODE   0x10
 
#define LOADCELL6_CTRL2_BUFEN   0x20
 
#define LOADCELL6_CTRL2_DGAIN_x1   0x00
 
#define LOADCELL6_CTRL2_DGAIN_x2   0x40
 
#define LOADCELL6_CTRL2_DGAIN_x4   0x80
 
#define LOADCELL6_CTRL2_DGAIN_x8   0xC0
 
#define LOADCELL6_CTRL2_DGAIN0   0x40
 
#define LOADCELL6_CTRL2_DGAIN1   0x80
 
#define LOADCELL6_CTRL3_DATA32   0x08
 Load Cell 6 CTRL3 register bits description.
 
#define LOADCELL6_CTRL3_MODBITS   0x10
 
#define LOADCELL6_CTRL3_ENMSYNC   0x20
 
#define LOADCELL6_CTRL3_RESERVED   0x41
 
#define LOADCELL6_CTRL4_DIO1   0x01
 Load Cell 6 CTRL4 register bits description.
 
#define LOADCELL6_CTRL4_DIO2   0x02
 
#define LOADCELL6_CTRL4_DIO3   0x04
 
#define LOADCELL6_CTRL4_DIO4   0x08
 
#define LOADCELL6_CTRL4_DIR1   0x10
 
#define LOADCELL6_CTRL4_DIR2   0x20
 
#define LOADCELL6_CTRL4_DIR3   0x40
 
#define LOADCELL6_CTRL4_DIR4   0x80
 
#define LOADCELL6_CTRL5_NOSCO   0x01
 Load Cell 6 CTRL5 register bits description.
 
#define LOADCELL6_CTRL5_NOSCG   0x02
 
#define LOADCELL6_CTRL5_NOSYSO   0x04
 
#define LOADCELL6_CTRL5_NOSYSG   0x08
 
#define LOADCELL6_CTRL5_CAL0   0x40
 
#define LOADCELL6_CTRL5_CAL1   0x80
 
#define LOADCELL6_DATA_NO_DATA   0
 Load Cell 6 weight data description.
 
#define LOADCELL6_DATA_OK   1
 
#define LOADCELL6_WEIGHT_ZERO   0
 
#define LOADCELL6_WEIGHT_100G   100
 
#define LOADCELL6_WEIGHT_200G   200
 
#define LOADCELL6_WEIGHT_500G   500
 
#define LOADCELL6_WEIGHT_1000G   1000
 
#define LOADCELL6_WEIGHT_5000G   5000
 
#define LOADCELL6_WEIGHT_10000G   10000
 
#define LOADCELL6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define LOADCELL6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define LOADCELL6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  loadcell6_return_value_t { LOADCELL6_OK = 0 , LOADCELL6_ERROR = -1 }
 Load Cell 6 Click return value data. More...
 

Functions

void loadcell6_cfg_setup (loadcell6_cfg_t *cfg)
 Load Cell 6 configuration object setup function.
 
err_t loadcell6_init (loadcell6_t *ctx, loadcell6_cfg_t *cfg)
 Load Cell 6 initialization function.
 
err_t loadcell6_default_cfg (loadcell6_t *ctx)
 Load Cell 6 default configuration function.
 
err_t loadcell6_generic_write (loadcell6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Load Cell 6 data writing function.
 
err_t loadcell6_generic_read (loadcell6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Load Cell 6 data reading function.
 
err_t loadcell6_hw_reset (loadcell6_t *ctx)
 Load Cell 6 hw reset function.
 
uint8_t loadcell6_sync (loadcell6_t *ctx)
 Load Cell 6 get sync function.
 
uint8_t loadcell6_check_data_ready (loadcell6_t *ctx)
 Load Cell 6 check data ready function.
 
err_t loadcell6_write_reg (loadcell6_t *ctx, uint8_t reg, uint8_t data_in)
 Load Cell 6 write reg function.
 
err_t loadcell6_read_reg (loadcell6_t *ctx, uint8_t reg, uint8_t *data_out)
 Load Cell 6 read reg function.
 
err_t loadcell6_write_reg_data (loadcell6_t *ctx, uint8_t reg, uint32_t data_in)
 Load Cell 6 read reg data function.
 
err_t loadcell6_read_reg_data (loadcell6_t *ctx, uint8_t reg, uint32_t *data_out)
 Load Cell 6 read reg data function.
 
err_t loadcell6_set_command (loadcell6_t *ctx, uint8_t cmd)
 Load Cell 6 set command function.
 
err_t loadcell6_get_status (loadcell6_t *ctx, uint16_t *status)
 Load Cell 6 get status function.
 
err_t loadcell6_read_adc (loadcell6_t *ctx, uint32_t *data_out)
 Load Cell 6 read ADC data function.
 
err_t loadcell6_tare (loadcell6_t *ctx, loadcell6_data_t *cell_data)
 Load Cell 6 tare the scales function.
 
err_t loadcell6_calibration (loadcell6_t *ctx, uint16_t cal_val, loadcell6_data_t *cell_data)
 Load Cell 6 calibration function.
 
err_t loadcell6_get_weight (loadcell6_t *ctx, loadcell6_data_t *cell_data, float *weight_g)
 Load Cell 6 get weight function.
 

Detailed Description

This file contains API for Load Cell 6 Click Driver.

Enumeration Type Documentation

◆ loadcell6_return_value_t

Load Cell 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
LOADCELL6_OK 
LOADCELL6_ERROR