LevelMeter-Display  2.0
An ultrasonic Level Meter for Stormwater Cisterns
Data Structures | Functions | Variables
adc.h File Reference
Include dependency graph for adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  ADCData_t
 Holds raw ADC Values for all Channels. More...
 

Functions

static void ADCcli (void)
 
static void ADCResetMinMax (void)
 Resets the Min/Max values of the Analog Values. More...
 
static void ADCsei (void)
 
void InitADC (void)
 Initializes the ADC. More...
 

Variables

volatile ADCData_t ADCData
 ADC-Values for the last measurement. More...
 
volatile ADCData_t ADCDataAvg
 Averaged ADC-Values. More...
 
volatile ADCData_t ADCDataMax
 Maximum ADC-Values during last average Period. More...
 
volatile ADCData_t ADCDataMaxTmp
 Maximum ADC-Values in the current Period. More...
 
volatile ADCData_t ADCDataMin
 Minimum ADC-Values during last average Period. More...
 
volatile ADCData_t ADCDataMinTmp
 Minimum ADC-Values in the current Period. More...
 
static const uint8_t ADCFLAG_NEWAVERAGES =2
 All Averages have been updated. More...
 
static const uint8_t ADCFLAG_NEWRESULTS =1
 All Channels have been updated. More...
 
volatile uint8_t adcFlags
 
volatile uint16_t channelMismatchCnt
 

Function Documentation

◆ ADCcli()

static void ADCcli ( void  )
inlinestatic

Referenced by ADCResetMinMax(), and DoTflags().

Here is the caller graph for this function:

◆ ADCResetMinMax()

static void ADCResetMinMax ( void  )
inlinestatic

Resets the Min/Max values of the Analog Values.

References ADCcli(), ADCDataMax, ADCDataMaxTmp, ADCDataMin, ADCDataMinTmp, ADCsei(), and ADCData_t::array.

Referenced by DoTflags().

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

◆ ADCsei()

static void ADCsei ( void  )
inlinestatic

Referenced by ADCResetMinMax(), and DoTflags().

Here is the caller graph for this function:

◆ InitADC()

void InitADC ( void  )

Initializes the ADC.

The ADC is set to free running mode at 115.2kHz clock. This gives one result every 113us or one complete set every 564us.

References channel, and muxChannel.

Referenced by CmdCalibrate(), and Init().

Here is the caller graph for this function:

Variable Documentation

◆ ADCData

volatile ADCData_t ADCData

ADC-Values for the last measurement.

Referenced by CmdStat(), FTestSWUnreg(), ISR(), and TempFromADC().

◆ ADCDataAvg

volatile ADCData_t ADCDataAvg

◆ ADCDataMax

volatile ADCData_t ADCDataMax

Maximum ADC-Values during last average Period.

Referenced by ADCResetMinMax(), CmdStat(), and main().

◆ ADCDataMaxTmp

volatile ADCData_t ADCDataMaxTmp

Maximum ADC-Values in the current Period.

Referenced by ADCResetMinMax(), DoTflags(), and ISR().

◆ ADCDataMin

volatile ADCData_t ADCDataMin

Minimum ADC-Values during last average Period.

Referenced by ADCResetMinMax(), CmdStat(), and main().

◆ ADCDataMinTmp

volatile ADCData_t ADCDataMinTmp

Minimum ADC-Values in the current Period.

Referenced by ADCResetMinMax(), DoTflags(), and ISR().

◆ ADCFLAG_NEWAVERAGES

const uint8_t ADCFLAG_NEWAVERAGES =2
static

All Averages have been updated.

Referenced by EnterDouble(), and ISR().

◆ ADCFLAG_NEWRESULTS

const uint8_t ADCFLAG_NEWRESULTS =1
static

All Channels have been updated.

Referenced by FTestSWUnreg(), and ISR().

◆ adcFlags

volatile uint8_t adcFlags

Referenced by EnterDouble(), FTestSWUnreg(), and ISR().

◆ channelMismatchCnt

volatile uint16_t channelMismatchCnt