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   50
 
#define ADCFILTER_CLT_DEFAULT   180
 
#define ADCFILTER_IAT_DEFAULT   180
 
#define ADCFILTER_O2_DEFAULT   128
 
#define ADCFILTER_BAT_DEFAULT   128
 
#define ADCFILTER_MAP_DEFAULT   20
 
#define ADCFILTER_BARO_DEFAULT   64
 
#define ADCFILTER_PSI_DEFAULT   150
 
#define FILTER_FLEX_DEFAULT   75
 
#define BARO_MIN   65
 
#define BARO_MAX   108
 
#define VSS_GEAR_HYSTERESIS   10
 
#define VSS_SAMPLES   4
 
#define TPS_READ_FREQUENCY   30
 
#define READ_FLEX()   digitalRead(pinFlex)
 
#define ADMUX_DEFAULT_CONFIG   0x40
 
#define ADC_FILTER(input, alpha, prior)   (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8
 Simple low pass IIR filter macro for the analog inputs This is effectively implementing the smooth filter from playground.arduino.cc/Main/Smooth But removes the use of floats and uses 8 bits of fixed precision.
 

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 readMAP (void)
 
void instanteneousMAPReading (void)
 
uint8_t getAnalogKnock (void)
 

Variables

volatile byte flexCounter
 
volatile unsigned long flexStartTime
 
volatile unsigned long flexPulseWidth
 
unsigned int MAPcount
 
uint32_t MAPcurRev
 
bool auxIsEnabled
 
uint16_t MAPlast
 
unsigned long MAP_time
 
unsigned long MAPlast_time
 

Macro Definition Documentation

◆ ADC_FILTER

#define ADC_FILTER (   input,
  alpha,
  prior 
)    (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8

Simple low pass IIR filter macro for the analog inputs This is effectively implementing the smooth filter from playground.arduino.cc/Main/Smooth But removes the use of floats and uses 8 bits of fixed precision.

◆ ADCFILTER_BARO_DEFAULT

#define ADCFILTER_BARO_DEFAULT   64

◆ ADCFILTER_BAT_DEFAULT

#define ADCFILTER_BAT_DEFAULT   128

◆ ADCFILTER_CLT_DEFAULT

#define ADCFILTER_CLT_DEFAULT   180

◆ ADCFILTER_IAT_DEFAULT

#define ADCFILTER_IAT_DEFAULT   180

◆ ADCFILTER_MAP_DEFAULT

#define ADCFILTER_MAP_DEFAULT   20

◆ ADCFILTER_O2_DEFAULT

#define ADCFILTER_O2_DEFAULT   128

◆ ADCFILTER_PSI_DEFAULT

#define ADCFILTER_PSI_DEFAULT   150

◆ ADCFILTER_TPS_DEFAULT

#define ADCFILTER_TPS_DEFAULT   50

◆ ADMUX_DEFAULT_CONFIG

#define ADMUX_DEFAULT_CONFIG   0x40

◆ BARO_MAX

#define BARO_MAX   108

◆ BARO_MIN

#define BARO_MIN   65

◆ FILTER_FLEX_DEFAULT

#define FILTER_FLEX_DEFAULT   75

◆ READ_FLEX

#define READ_FLEX ( )    digitalRead(pinFlex)

◆ TPS_READ_FREQUENCY

#define TPS_READ_FREQUENCY   30

◆ VSS_GEAR_HYSTERESIS

#define VSS_GEAR_HYSTERESIS   10

◆ VSS_SAMPLES

#define VSS_SAMPLES   4

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:

◆ 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:

◆ instanteneousMAPReading()

void instanteneousMAPReading ( void  )
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 ( byte  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 unsigned long flexPulseWidth
extern

◆ flexStartTime

volatile unsigned long flexStartTime
extern

◆ MAP_time

unsigned long MAP_time
extern

◆ MAPcount

unsigned int MAPcount
extern

◆ MAPcurRev

uint32_t MAPcurRev
extern

◆ MAPlast

uint16_t MAPlast
extern

The previous MAP reading

◆ MAPlast_time

unsigned long MAPlast_time
extern