Speeduino
Loading...
Searching...
No Matches
Macros | Functions | Variables
sensors.h File Reference
#include "globals.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ADCFILTER_TPS_DEFAULT   50U
 
#define ADCFILTER_CLT_DEFAULT   180U
 
#define ADCFILTER_IAT_DEFAULT   180U
 
#define ADCFILTER_O2_DEFAULT   128U
 
#define ADCFILTER_BAT_DEFAULT   128U
 
#define ADCFILTER_MAP_DEFAULT   20U
 
#define ADCFILTER_BARO_DEFAULT   64U
 
#define ADCFILTER_PSI_DEFAULT   150U
 
#define FILTER_FLEX_DEFAULT   75U
 
#define VSS_GEAR_HYSTERESIS   10U
 
#define VSS_SAMPLES   4U
 
#define TPS_READ_FREQUENCY   30
 
#define READ_FLEX()   digitalRead(pinFlex)
 

Functions

void initialiseADC (void)
 
void readTPS (bool useFilter=true)
 
void readO2_2 (void)
 
void flexPulse (void)
 
void knockPulse (void)
 
uint32_t vssGetPulseGap (byte toothHistoryIndex)
 Returns the VSS pulse gap for a given history point.
 
void vssPulse (void)
 The ISR function for VSS pulses.
 
uint16_t getSpeed (void)
 
byte getGear (void)
 
byte getFuelPressure (void)
 
byte getOilPressure (void)
 
uint16_t readAuxanalog (uint8_t analogPin)
 
uint16_t readAuxdigital (uint8_t digitalPin)
 
void readCLT (bool useFilter=true)
 
void readIAT (void)
 
void readO2 (void)
 
void readBat (void)
 
void readBaro (void)
 
void initialiseMAPBaro (void)
 Initialize the MAP calculation & Baro values.
 
void readMAP (void)
 
uint8_t getAnalogKnock (void)
 
int16_t getMAPDelta (void)
 Get the MAP change between the last 2 readings.
 
uint32_t getMAPDeltaTime (void)
 Get the time in µS between the last 2 MAP readings.
 

Variables

volatile byte flexCounter
 
volatile uint32_t flexPulseWidth
 
bool auxIsEnabled
 

Macro Definition Documentation

◆ ADCFILTER_BARO_DEFAULT

#define ADCFILTER_BARO_DEFAULT   64U

◆ ADCFILTER_BAT_DEFAULT

#define ADCFILTER_BAT_DEFAULT   128U

◆ ADCFILTER_CLT_DEFAULT

#define ADCFILTER_CLT_DEFAULT   180U

◆ ADCFILTER_IAT_DEFAULT

#define ADCFILTER_IAT_DEFAULT   180U

◆ ADCFILTER_MAP_DEFAULT

#define ADCFILTER_MAP_DEFAULT   20U

◆ ADCFILTER_O2_DEFAULT

#define ADCFILTER_O2_DEFAULT   128U

◆ ADCFILTER_PSI_DEFAULT

#define ADCFILTER_PSI_DEFAULT   150U

◆ ADCFILTER_TPS_DEFAULT

#define ADCFILTER_TPS_DEFAULT   50U

◆ FILTER_FLEX_DEFAULT

#define FILTER_FLEX_DEFAULT   75U

◆ READ_FLEX

#define READ_FLEX ( )    digitalRead(pinFlex)

◆ TPS_READ_FREQUENCY

#define TPS_READ_FREQUENCY   30

◆ VSS_GEAR_HYSTERESIS

#define VSS_GEAR_HYSTERESIS   10U

◆ VSS_SAMPLES

#define VSS_SAMPLES   4U

Function Documentation

◆ flexPulse()

void flexPulse ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAnalogKnock()

uint8_t getAnalogKnock ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFuelPressure()

byte getFuelPressure ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGear()

byte getGear ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMAPDelta()

int16_t getMAPDelta ( void  )

Get the MAP change between the last 2 readings.

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

◆ getMAPDeltaTime()

uint32_t getMAPDeltaTime ( void  )

Get the time in µS between the last 2 MAP readings.

Here is the caller graph for this function:

◆ getOilPressure()

byte getOilPressure ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSpeed()

uint16_t getSpeed ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseADC()

void initialiseADC ( void  )

Init all ADC conversions by setting resolutions, etc.

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

◆ initialiseMAPBaro()

void initialiseMAPBaro ( void  )

Initialize the MAP calculation & Baro values.

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

◆ knockPulse()

void knockPulse ( void  )
Here is the caller graph for this function:

◆ readAuxanalog()

uint16_t readAuxanalog ( uint8_t  analogPin)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readAuxdigital()

uint16_t readAuxdigital ( uint8_t  digitalPin)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBaro()

void readBaro ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBat()

void readBat ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCLT()

void readCLT ( bool  useFilter = true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readIAT()

void readIAT ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readMAP()

void readMAP ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readO2()

void readO2 ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readO2_2()

void readO2_2 ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readTPS()

void readTPS ( bool  useFilter = true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vssGetPulseGap()

uint32_t vssGetPulseGap ( uint8_t  historyIndex)

Returns the VSS pulse gap for a given history point.

Parameters
historyIndexThe gap number that is wanted. EG: historyIndex = 0 = Latest entry historyIndex = 1 = 2nd entry entry
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vssPulse()

void vssPulse ( void  )

The ISR function for VSS pulses.

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

Variable Documentation

◆ auxIsEnabled

bool auxIsEnabled
extern

◆ flexCounter

volatile byte flexCounter
extern

◆ flexPulseWidth

volatile uint32_t flexPulseWidth
extern