FreeEMS  0.2.0-SNAPSHOT-282-g9efc524
Data Structures | Macros | Variables
freeEMS.h File Reference

The main project header file. More...

#include "memory.h"
#include "9S12XDP512.h"
#include "flashGlobals.h"
#include "systemConfig.h"
#include "errorDefines.h"
#include "globalDefines.h"
#include "scalerDefines.h"
#include "constantsLibrary.h"
#include "9S12XDP512flags.h"
#include "generalTypes.h"
#include "counterTypes.h"
#include "containerTypes.h"
#include "tableTypes.h"
#include "FixedConfigs.h"
#include "TunableConfigs.h"
#include "typeChecks.h"
#include "globalConstants.h"
Include dependency graph for freeEMS.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  Tables1
 main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc. More...
union  Tables2
union  Tables3
union  Tables4
union  LongTime

Macros

#define EXTERN   extern
 include "registerMasks.h
#define FUEL_PUMP_PRIME   BIT0 /* 0 */
#define STAGED_REQUIRED   BIT1 /* 1 Fire the staged injectors */
#define CALC_FUEL_IGN   BIT2 /* 2 Fuel and ignition require calculation (i.e. variables have been updated) */
#define FORCE_READING   BIT3 /* 3 Flag to force ADC sampling at low rpm/stall */
#define BENCH_TEST_ON   BIT4 /* 4 Bench test running TEMPORARY */
#define COREA05   BIT5 /* 5 */
#define COREA06   BIT6 /* 6 */
#define COREA07   BIT7 /* 7 */
#define CLEAR_FUEL_PUMP_PRIME   NBIT0 /* */
#define STAGED_NOT_REQUIRED   NBIT1 /* 9 Do not fire the staged injectors */
#define CLEAR_CALC_FUEL_IGN   NBIT2 /* 10 Fuel and ignition don't require calculation */
#define CLEAR_FORCE_READING   NBIT3 /* 11 Clear flag to force ADC sampling at low rpm/stall */
#define CLEAR_BENCH_TEST_ON   NBIT4
#define DECODER_BENCHMARKS   FALSE
#define DEBUG_TURN_PIN_ON(BENCHMARK_ENABLED, PIN_ON_MASK, PORT_ADDRESS)
 This macro turns a pin ON based on an enable flag, a port address and a pin mask for that port.
#define DEBUG_TURN_PIN_OFF(BENCHMARK_ENABLED, PIN_OFF_MASK, PORT_ADDRESS)
 This macro turns a pin OFF based on an enable flag, a port address and a pin mask for that port.

Variables

EXTERN unsigned char portHDebounce
EXTERN Clock Clocks
 Timer Clocks for various functions.
EXTERN Counter Counters
 Execution count for various blocks of code.
EXTERN KeyUserDebug KeyUserDebugs
 Formalised key logging vars in one place.
EXTERN Flaggable Flaggables
 The single instance of our flaggable struct.
EXTERN Flaggable2 Flaggables2
 The single instance of our flaggable2 struct.
EXTERN CoreVarCoreVars
EXTERN CoreVar CoreVars0
 Pointer to the core running variables.
EXTERN DerivedVarDerivedVars
 Bank 0 core running variables.
EXTERN DerivedVar DerivedVars0
 Pointer to the secondary running variables.
EXTERN ADCBufferADCBuffers
 Bank 0 secondary running variables.
EXTERN ADCBufferADCBuffersRecord
 main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
EXTERN ADCBuffer ADCBuffers0
 main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
EXTERN ADCBuffer ADCBuffers1
 main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
EXTERN unsigned char TXBuffer[TX_BUFFER_SIZETXBUF
EXTERN unsigned char RXBuffer[RX_BUFFER_SIZERXBUF
EXTERN Tables1 TablesA RWINDOW
EXTERN unsigned char currentFuelRPage
EXTERN unsigned char currentTuneRPage
EXTERN unsigned char currentTimeRPage
unsigned short masterPulseWidth
EXTERN unsigned long bootFuelConst
EXTERN unsigned short TPSADCRange
EXTERN unsigned char coreStatusA
unsigned short timerExtensionClock

Detailed Description

The main project header file.

The central header for all source files to include. This pulls in the device header, all other shared headers, all global defines, all global constant declarations, all type definitions and all global variables. Other variables that are actually in global space but only shared between a few select files should be placed in the header for the main file that uses them.

Definition in file freeEMS.h.

Macro Definition Documentation

#define EXTERN   extern

include "registerMasks.h

Todo:
TODO For Sean to integrate back in
Todo:
TODO we should define the register masks that we use in one place, but probably not in the main device header.

Definition at line 92 of file freeEMS.h.

#define FUEL_PUMP_PRIME   BIT0 /* 0 */

Definition at line 267 of file freeEMS.h.

Referenced by initVariables(), and RTIISR().

#define STAGED_REQUIRED   BIT1 /* 1 Fire the staged injectors */

Definition at line 268 of file freeEMS.h.

#define CALC_FUEL_IGN   BIT2 /* 2 Fuel and ignition require calculation (i.e. variables have been updated) */

Definition at line 269 of file freeEMS.h.

Referenced by main(), PrimaryRPMISR(), and SecondaryRPMISR().

#define FORCE_READING   BIT3 /* 3 Flag to force ADC sampling at low rpm/stall */

Definition at line 270 of file freeEMS.h.

Referenced by main(), and RTIISR().

#define BENCH_TEST_ON   BIT4 /* 4 Bench test running TEMPORARY */

Definition at line 271 of file freeEMS.h.

Referenced by decodePacketAndRespond().

#define COREA05   BIT5 /* 5 */

Definition at line 272 of file freeEMS.h.

#define COREA06   BIT6 /* 6 */

Definition at line 273 of file freeEMS.h.

#define COREA07   BIT7 /* 7 */

Definition at line 274 of file freeEMS.h.

#define CLEAR_FUEL_PUMP_PRIME   NBIT0 /* */

Definition at line 277 of file freeEMS.h.

Referenced by RTIISR().

#define STAGED_NOT_REQUIRED   NBIT1 /* 9 Do not fire the staged injectors */

Definition at line 278 of file freeEMS.h.

#define CLEAR_CALC_FUEL_IGN   NBIT2 /* 10 Fuel and ignition don't require calculation */

Definition at line 279 of file freeEMS.h.

Referenced by main().

#define CLEAR_FORCE_READING   NBIT3 /* 11 Clear flag to force ADC sampling at low rpm/stall */

Definition at line 280 of file freeEMS.h.

Referenced by main().

#define CLEAR_BENCH_TEST_ON   NBIT4

Definition at line 281 of file freeEMS.h.

Referenced by PrimaryRPMISR().

#define DECODER_BENCHMARKS   FALSE
#define DEBUG_TURN_PIN_ON (   BENCHMARK_ENABLED,
  PIN_ON_MASK,
  PORT_ADDRESS 
)
Value:
if(BENCHMARK_ENABLED){ \
PORT_ADDRESS |= PIN_ON_MASK; \
}

This macro turns a pin ON based on an enable flag, a port address and a pin mask for that port.

It is used to keep the code clean and free from ifdefs whilst allowing a developer to turn on benchmarking outputs very easily. Note that it gets optimised out due to the constant literal conditional required.

Definition at line 303 of file freeEMS.h.

Referenced by InjectorXISR(), IRQISR(), LowVoltageISR(), PLLLockISR(), PortHISR(), PortJISR(), PortPISR(), PrimaryRPMISR(), RAMViolationISR(), RTIISR(), SCI0ISR(), SecondaryRPMISR(), SelfClockISR(), SpuriousISR(), TimerOverflow(), UISR(), UnimplOpcodeISR(), XGATEErrorISR(), and XIRQISR().

#define DEBUG_TURN_PIN_OFF (   BENCHMARK_ENABLED,
  PIN_OFF_MASK,
  PORT_ADDRESS 
)
Value:
if(BENCHMARK_ENABLED){ \
PORT_ADDRESS &= PIN_OFF_MASK; \
}

This macro turns a pin OFF based on an enable flag, a port address and a pin mask for that port.

It is used to keep the code clean and free from ifdefs whilst allowing a developer to turn on benchmarking outputs very easily. Note that it gets optimised out due to the constant literal conditional required.

Definition at line 314 of file freeEMS.h.

Referenced by InjectorXISR(), IRQISR(), LowVoltageISR(), PLLLockISR(), PortHISR(), PortJISR(), PortPISR(), PrimaryRPMISR(), RAMViolationISR(), RTIISR(), SCI0ISR(), SecondaryRPMISR(), SelfClockISR(), SpuriousISR(), TimerOverflow(), UISR(), UnimplOpcodeISR(), XGATEErrorISR(), and XIRQISR().

Variable Documentation

EXTERN unsigned char portHDebounce

Definition at line 115 of file freeEMS.h.

Referenced by PortHISR(), and RTIISR().

EXTERN Clock Clocks

Timer Clocks for various functions.

Definition at line 119 of file freeEMS.h.

Referenced by decodePacketAndRespond(), lookupBlockDetails(), populateBasicDatalog(), PrimaryRPMISR(), RTIISR(), and SecondaryRPMISR().

EXTERN Counter Counters

Execution count for various blocks of code.

Definition at line 120 of file freeEMS.h.

Referenced by decodePacketAndRespond(), InjectorXISR(), lookupBlockDetails(), main(), PrimaryRPMISR(), scheduleOutputs(), schedulePortTPin(), and SecondaryRPMISR().

EXTERN KeyUserDebug KeyUserDebugs
EXTERN Flaggable Flaggables

The single instance of our flaggable struct.

Definition at line 122 of file freeEMS.h.

Referenced by decodePacketAndRespond(), and lookupBlockDetails().

EXTERN Flaggable2 Flaggables2

The single instance of our flaggable2 struct.

Definition at line 123 of file freeEMS.h.

Referenced by decodePacketAndRespond(), and lookupBlockDetails().

EXTERN CoreVar* CoreVars
EXTERN CoreVar CoreVars0

Pointer to the core running variables.

Definition at line 159 of file freeEMS.h.

Referenced by initVariables().

EXTERN DerivedVar* DerivedVars

Bank 0 core running variables.

Definition at line 162 of file freeEMS.h.

Referenced by calculateFuelAndIgnition(), decodePacketAndRespond(), generateDerivedVars(), initVariables(), lookupBlockDetails(), main(), and scheduleOutputs().

EXTERN DerivedVar DerivedVars0

Pointer to the secondary running variables.

Definition at line 163 of file freeEMS.h.

Referenced by initVariables().

EXTERN ADCBuffer* ADCBuffers

Bank 0 secondary running variables.

Definition at line 166 of file freeEMS.h.

Referenced by generateCoreVars(), initVariables(), lookupBlockDetails(), main(), PrimaryRPMISR(), and SecondaryRPMISR().

EXTERN ADCBuffer* ADCBuffersRecord

main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.

Definition at line 167 of file freeEMS.h.

Referenced by initVariables(), and main().

EXTERN ADCBuffer ADCBuffers0

main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.

Definition at line 168 of file freeEMS.h.

Referenced by initVariables(), and main().

EXTERN ADCBuffer ADCBuffers1

main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.

Definition at line 169 of file freeEMS.h.

Referenced by initVariables(), and main().

EXTERN unsigned char TXBuffer [TX_BUFFER_SIZE] TXBUF

Definition at line 216 of file freeEMS.h.

EXTERN unsigned char RXBuffer [RX_BUFFER_SIZE] RXBUF

Definition at line 217 of file freeEMS.h.

EXTERN Tables4 TablesD RWINDOW

Definition at line 218 of file freeEMS.h.

EXTERN unsigned char currentFuelRPage

Definition at line 225 of file freeEMS.h.

Referenced by setupPagedRAM().

EXTERN unsigned char currentTuneRPage

Definition at line 226 of file freeEMS.h.

Referenced by setupPagedRAM().

EXTERN unsigned char currentTimeRPage

Definition at line 227 of file freeEMS.h.

Referenced by setupPagedRAM().

unsigned short masterPulseWidth
  • Pointers to main tables to aid readability */* Pointers to SmallTablesA */

Definition at line 44 of file staticInit.c.

Referenced by calculateFuelAndIgnition(), and scheduleOutputs().

EXTERN unsigned long bootFuelConst

Definition at line 258 of file freeEMS.h.

Referenced by calculateFuelAndIgnition(), and initConfiguration().

EXTERN unsigned short TPSADCRange

Definition at line 259 of file freeEMS.h.

Referenced by generateCoreVars(), and initConfiguration().

EXTERN unsigned char coreStatusA
unsigned short timerExtensionClock

Definition at line 285 of file freeEMS.h.

Referenced by InjectorXISR(), main(), PrimaryRPMISR(), SecondaryRPMISR(), and TimerOverflow().