Hospital Analyser  1.0
FX1901_LC.h
Go to the documentation of this file.
1 #ifndef __FX1901_LC_H
2 #define __FX1901_LC_H
3 
4 #include "stdint.h"
5 
6 #include "MCP3425.h"
7 //#include "stm32l4xx_hal.h"
8 
15 typedef enum
16 {
32 typedef enum
33 {
34  FX1901_kgf = 0,
45 typedef enum
46 {
55 float offset;
56 
64 FX1901_StatusTypeDef FX1901_GetMassFromSensorVoltage(FX1901_ModelTypeDef model, float sensorVoltage, float *mass);
65 
73 FX1901_StatusTypeDef FX1901_GetMass(I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, float *mass);
74 
82 FX1901_StatusTypeDef FX1901_AverageCalibration(I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, uint8_t samples);
83 
88 void FX1901_CompensateOffset(float *mass);
89 
94 float FX1901_GetOffset();
95 
100 void FX1901_SetOffset(float newOffset);
101 
107 float kg2lbs(float weight);
113 float lbs2kg(float weight);
114 
115 #endif
float lbs2kg(float weight)
lbs2kg Converts pounds to kilograms
FX1901_StatusTypeDef
Definition: FX1901_LC.h:45
Definition: FX1901_LC.h:35
Definition: FX1901_LC.h:17
FX1901_ModelTypeDef
Definition: FX1901_LC.h:15
Definition: FX1901_LC.h:20
FX1901_StatusTypeDef FX1901_GetMass(I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, float *mass)
FX1901_GetMass Computes force (weight) from new A/D reading.
void FX1901_CompensateOffset(float *mass)
FX1901_CompensateOffset Substracts calculated offset from current reading.
FX1901_StatusTypeDef FX1901_AverageCalibration(I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, uint8_t samples)
FX1901_AverageCalibration Calibrate sensor using simple averege calibration.
void FX1901_SetOffset(float newOffset)
FX1901_SetOffset Offset setter.
Definition: FX1901_LC.h:47
FX1901_UnitTypeDef
Definition: FX1901_LC.h:32
Definition: FX1901_LC.h:18
Definition: FX1901_LC.h:19
Definition: FX1901_LC.h:48
Definition: FX1901_LC.h:21
Definition: FX1901_LC.h:34
FX1901_StatusTypeDef FX1901_GetMassFromSensorVoltage(FX1901_ModelTypeDef model, float sensorVoltage, float *mass)
FX1901_GetMassFromSensorVoltage Computes force (weight) value from voltage value. ...
float kg2lbs(float weight)
kg2lbs Converts kilograms to pounds
float FX1901_GetOffset()
FX1901_GetOffset Calibrated offset getter.