LevelMeter-Display  2.0
An ultrasonic Level Meter for Stormwater Cisterns
Functions
sensors.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double P3FromADC (uint16_t)
 Converts a P3-Raw ADC Value to Voltage. More...
 
double P5FromADC (uint16_t)
 Converts a P5-Raw ADC Value to Voltage. More...
 
double SWUnregFromADC (uint16_t)
 Converts a SWUnreg-Raw ADC Value to Voltage. More...
 
double TempFromADC (void)
 Converts the ADC-Temp Value to Celsius. More...
 
double UnregFromADC (uint16_t)
 Converts a Unreg-Raw ADC Value to Voltage. More...
 

Function Documentation

◆ P3FromADC()

double P3FromADC ( uint16_t  val)

Converts a P3-Raw ADC Value to Voltage.

Note
The JTAGEN-Fuse has to be cleared to receive accurate values for P3 since the ADC4 (PORTF4) pin will source current while JTAG is enabled! The error may well exceed 15% FSR. This has to be done before the final calibration!
During debugging via JTAG, P3 is not measurable and Jumper X11 has to be disconnected for the voltage dividers not to interfere with the JTAG interface!
Parameters
valThe ADC Value
Returns
The Voltage

References config, and confStruct_t::P3VoltsPerLSB.

Referenced by CmdStat(), EnterDouble(), FTestSupply(), and ShowScreen().

Here is the caller graph for this function:

◆ P5FromADC()

double P5FromADC ( uint16_t  val)

Converts a P5-Raw ADC Value to Voltage.

Parameters
valThe ADC Value
Returns
The Voltage

References config, and confStruct_t::P5VoltsPerLSB.

Referenced by CmdStat(), EnterDouble(), FTestSupply(), ShowScreen(), and TempFromADC().

Here is the caller graph for this function:

◆ SWUnregFromADC()

double SWUnregFromADC ( uint16_t  val)

Converts a SWUnreg-Raw ADC Value to Voltage.

Parameters
valThe ADC Value
Returns
The Voltage

References config, and confStruct_t::SWUnregVoltsPerLSB.

Referenced by CmdStat(), EnterDouble(), FTestSWUnreg(), and ShowScreen().

Here is the caller graph for this function:

◆ TempFromADC()

double TempFromADC ( void  )

Converts the ADC-Temp Value to Celsius.

Note
This function takes extensive floating point operations and may thus block for about 400us.
Returns
The Temperature in Celsius

References ADCData_t::ADC_P5, ADCData_t::ADC_Temp, ADCData, ADCDataAvg, ADCData_t::named, and P5FromADC().

Referenced by CmdStat(), and ShowScreen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnregFromADC()

double UnregFromADC ( uint16_t  val)

Converts a Unreg-Raw ADC Value to Voltage.

Parameters
valThe ADC Value
Returns
The Voltage

References config, and confStruct_t::UnregVoltsPerLSB.

Referenced by CmdStat(), EnterDouble(), FTestSupply(), FTestSWUnreg(), main(), and ShowScreen().

Here is the caller graph for this function: