Hospital Analyser  1.0
Enumerations | Functions | Variables
FX1901_LC.h File Reference
#include "stdint.h"
#include "MCP3425.h"
Include dependency graph for FX1901_LC.h:

Go to the source code of this file.

Enumerations

enum  FX1901_ModelTypeDef {
  FX1901_10lbf = 0, FX1901_25lbf = 1, FX1901_50lbf = 2, FX1901_100lbf = 3,
  FX1901_200lbf = 4
}
 
enum  FX1901_UnitTypeDef { FX1901_kgf = 0, FX1901_lbf = 1 }
 
enum  FX1901_StatusTypeDef { FX1901_Status_OK, FX1901_Status_ERROR }
 

Functions

FX1901_StatusTypeDef FX1901_GetMassFromSensorVoltage (FX1901_ModelTypeDef model, float sensorVoltage, float *mass)
 FX1901_GetMassFromSensorVoltage Computes force (weight) value from voltage value. More...
 
FX1901_StatusTypeDef FX1901_GetMass (I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, float *mass)
 FX1901_GetMass Computes force (weight) from new A/D reading. More...
 
FX1901_StatusTypeDef FX1901_AverageCalibration (I2C_HandleTypeDef *hi2c, FX1901_ModelTypeDef model, uint8_t samples)
 FX1901_AverageCalibration Calibrate sensor using simple averege calibration. More...
 
void FX1901_CompensateOffset (float *mass)
 FX1901_CompensateOffset Substracts calculated offset from current reading. More...
 
float FX1901_GetOffset ()
 FX1901_GetOffset Calibrated offset getter. More...
 
void FX1901_SetOffset (float newOffset)
 FX1901_SetOffset Offset setter. More...
 
float kg2lbs (float weight)
 kg2lbs Converts kilograms to pounds More...
 
float lbs2kg (float weight)
 lbs2kg Converts pounds to kilograms More...
 

Variables

float offset
 

Function Documentation

FX1901_StatusTypeDef FX1901_AverageCalibration ( I2C_HandleTypeDef *  hi2c,
FX1901_ModelTypeDef  model,
uint8_t  samples 
)

FX1901_AverageCalibration Calibrate sensor using simple averege calibration.

Parameters
hi2cPointer to I2C handle
modelSensor model
samplesNumber of samples to be taken for calibration
Returns
Function success (error) status
void FX1901_CompensateOffset ( float *  mass)

FX1901_CompensateOffset Substracts calculated offset from current reading.

Parameters
massPointer to current reading
FX1901_StatusTypeDef FX1901_GetMass ( I2C_HandleTypeDef *  hi2c,
FX1901_ModelTypeDef  model,
float *  mass 
)

FX1901_GetMass Computes force (weight) from new A/D reading.

Parameters
hi2cPointer to I2C handle
modelSensor model
massPointer to variable where computed value should be saved
Returns
Function success (error) status
FX1901_StatusTypeDef FX1901_GetMassFromSensorVoltage ( FX1901_ModelTypeDef  model,
float  sensorVoltage,
float *  mass 
)

FX1901_GetMassFromSensorVoltage Computes force (weight) value from voltage value.

Parameters
modelCurrent sensor model
sensorVoltageMeasured sensor voltage
massPointer to variable where computed value should be saved
Returns
Function success (error) status
float FX1901_GetOffset ( )

FX1901_GetOffset Calibrated offset getter.

Returns
Offset computed during calibration
void FX1901_SetOffset ( float  newOffset)

FX1901_SetOffset Offset setter.

Parameters
newOffsetNew offset value
float kg2lbs ( float  weight)

kg2lbs Converts kilograms to pounds

Parameters
weightValue in kilograms
Returns
Converted value in pounds
float lbs2kg ( float  weight)

lbs2kg Converts pounds to kilograms

Parameters
weightValue in pounds
Returns
Converted value in kilograms