memory.h

Go to the documentation of this file.
00001 /*      memory.h
00002 
00003         Copyright 2008 Fred Cooke
00004 
00005         This file is part of the FreeEMS project.
00006 
00007         FreeEMS software is free software: you can redistribute it and/or modify
00008         it under the terms of the GNU General Public License as published by
00009         the Free Software Foundation, either version 3 of the License, or
00010         (at your option) any later version.
00011 
00012         FreeEMS software is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016 
00017         You should have received a copy of the GNU General Public License
00018         along with any FreeEMS software.  If not, see <http://www.gnu.org/licenses/>.
00019 
00020         We ask that if you make any changes to this file you send them upstream to us at admin@diyefi.org
00021 
00022         Thank you for choosing FreeEMS to run your engine! */
00023 
00024 /* Header file multiple inclusion protection courtesy eclipse Header Template   */
00025 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual              */
00026 #ifndef FILE_MEMORY_H_SEEN
00027 #define FILE_MEMORY_H_SEEN
00028 
00029 /* http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Variable-Attributes.html */
00030 
00031 /* EEPROM */
00032 //#define EEPROM __attribute__ ((section (".eeprom")))
00033 /* EEPROM would appear to not be loadable by hcs12mem           */
00034 /* Furthermore it isn't really needed except in code anyway     */
00035 
00036 /* RAM divided up into special purpose blocks */
00037 #define RWINDOW         __attribute__ ((section (".rpage")))            /* ~4k paged RAM window */
00038 #define RXBUF           __attribute__ ((section (".rxbuf")))            /* ~2k block of RAM for receive buffer */
00039 #define TXBUF           __attribute__ ((section (".txbuf")))            /* ~2k block of RAM for transmit buffer */
00040 
00041 /* Direct flash blocks */
00042 #define FIXEDCONF1      __attribute__ ((section (".fixedconf1"))) /*  1k unpaged block, primary static configuration.           */
00043 #define FIXEDCONF2      __attribute__ ((section (".fixedconf2"))) /*  1k unpaged block, secondary static configuration.         */
00044 #define TEXT1           __attribute__ ((section (".text1")))      /* 14k unpaged block, must be explicitly used.                        */
00045 #define TEXT            __attribute__ ((section (".text")))               /* 14k unpaged block, code defaults to being stored here.     */
00046 /*define SERMON         __attribute__ ((section (".sermon")))         2k unpaged block, occupied by AN2548 serial monitor.      */
00047 
00048 
00049 /* far shortcut for data */
00050 #define DFAR(label) __attribute__ ((section (label)))
00051 /* far shortcut for functions */
00052 #define FFAR(label) __attribute__ ((far)) __attribute__ ((section (label)))
00053 
00054 
00055 /* Paged flash blocks for functions */
00056 #define FPPAGE_E0 FFAR(".ppageE0")
00057 #define FPPAGE_E1 FFAR(".ppageE1")
00058 #define FPPAGE_E2 FFAR(".ppageE2")
00059 #define FPPAGE_E3 FFAR(".ppageE3")
00060 #define FPPAGE_E4 FFAR(".ppageE4")
00061 #define FPPAGE_E5 FFAR(".ppageE5")
00062 #define FPPAGE_E6 FFAR(".ppageE6")
00063 #define FPPAGE_E7 FFAR(".ppageE7")
00064 #define FPPAGE_E8 FFAR(".ppageE8")
00065 #define FPPAGE_E9 FFAR(".ppageE9")
00066 #define FPPAGE_EA FFAR(".ppageEA")
00067 #define FPPAGE_EB FFAR(".ppageEB")
00068 #define FPPAGE_EC FFAR(".ppageEC")
00069 #define FPPAGE_ED FFAR(".ppageED")
00070 #define FPPAGE_EE FFAR(".ppageEE")
00071 #define FPPAGE_EF FFAR(".ppageEF")
00072 #define FPPAGE_F0 FFAR(".ppageF0")
00073 #define FPPAGE_F1 FFAR(".ppageF1")
00074 #define FPPAGE_F2 FFAR(".ppageF2")
00075 #define FPPAGE_F3 FFAR(".ppageF3")
00076 #define FPPAGE_F4 FFAR(".ppageF4")
00077 #define FPPAGE_F5 FFAR(".ppageF5")
00078 #define FPPAGE_F6 FFAR(".ppageF6")
00079 #define FPPAGE_F7 FFAR(".ppageF7")
00080 
00081 /* Paged flash blocks for data */
00082 #define PPAGE_E0 DFAR(".ppageE0")
00083 #define PPAGE_E1 DFAR(".ppageE1")
00084 #define PPAGE_E2 DFAR(".ppageE2")
00085 #define PPAGE_E3 DFAR(".ppageE3")
00086 #define PPAGE_E4 DFAR(".ppageE4")
00087 #define PPAGE_E5 DFAR(".ppageE5")
00088 #define PPAGE_E6 DFAR(".ppageE6")
00089 #define PPAGE_E7 DFAR(".ppageE7")
00090 #define PPAGE_E8 DFAR(".ppageE8")
00091 #define PPAGE_E9 DFAR(".ppageE9")
00092 #define PPAGE_EA DFAR(".ppageEA")
00093 #define PPAGE_EB DFAR(".ppageEB")
00094 #define PPAGE_EC DFAR(".ppageEC")
00095 #define PPAGE_ED DFAR(".ppageED")
00096 #define PPAGE_EE DFAR(".ppageEE")
00097 #define PPAGE_EF DFAR(".ppageEF")
00098 #define PPAGE_F0 DFAR(".ppageF0")
00099 #define PPAGE_F1 DFAR(".ppageF1")
00100 #define PPAGE_F2 DFAR(".ppageF2")
00101 #define PPAGE_F3 DFAR(".ppageF3")
00102 #define PPAGE_F4 DFAR(".ppageF4")
00103 #define PPAGE_F5 DFAR(".ppageF5")
00104 #define PPAGE_F6 DFAR(".ppageF6")
00105 #define PPAGE_F7 DFAR(".ppageF7")
00106 
00107 /* ONLY use the pages below this line for now (Or you won't be able to load them...) */
00108 
00109 /* General Purpose Page with PPAGE = 0xF8 */
00110 #define FPAGE_F8 FFAR(".ppageF8")
00111 #define DPAGE_F8 DFAR(".ppageF8")
00112 #define PAGE_F8_PPAGE 0xF8
00113 
00114 /* Function and large lookup tables for ADC to value mapping */
00115 #define LOOKUPF FFAR(".fpageF9")
00116 #define LOOKUPD DFAR(".dpageF9")
00117 #define LOOKUP_PPAGE 0xF9
00118 
00119 /* Fuel tables and the function for copying it up to RAM */
00120 #define FUELTABLESF FFAR(".fpageFA")
00121 #define FUELTABLESD DFAR(".dpageFA")
00122 #define FUELTABLES_PPAGE 0xFA
00123 
00124 /* Tunable tables etc and the function for copying them up to RAM */
00125 #define TUNETABLESF FFAR(".fpageFB")
00126 #define TUNETABLESD1 DFAR(".dpageFB1")
00127 #define TUNETABLESD2 DFAR(".dpageFB2")
00128 #define TUNETABLESD3 DFAR(".dpageFB3")
00129 #define TUNETABLESD4 DFAR(".dpageFB4")
00130 #define TUNETABLESD5 DFAR(".dpageFB5")
00131 #define TUNETABLESD6 DFAR(".dpageFB6")
00132 #define TUNETABLESD7 DFAR(".dpageFB7")
00133 #define TUNETABLESD8 DFAR(".dpageFB8")
00134 #define TUNETABLES_PPAGE 0xFB
00135 
00136 /* Timing tables and the function for copying them up to RAM */
00137 #define TIMETABLESF FFAR(".fpageFC")
00138 #define TIMETABLESD DFAR(".dpageFC")
00139 #define TIMETABLES_PPAGE 0xFC
00140 
00141 /* General Purpose Page with PPAGE = 0xFE */
00142 #define FPAGE_FE FFAR(".ppageFE")       /* This is the block that is present in the page window using linear addressing, represents 0x8000 - 0xBFFF ("text2" paged) */
00143 #define DPAGE_FE DFAR(".ppageFE")       /* This is the block that is present in the page window using linear addressing, represents 0x8000 - 0xBFFF ("text2" paged) */
00144 //#define FPAGE_FD FFAR(".ppageFD")     /* Represents 0x4000 - 0x7FFF ("text1" paged) */
00145 //#define DPAGE_FD DFAR(".ppageFD")     /* Represents 0x4000 - 0x7FFF ("text1" paged) */
00146 //#define FPAGE_FF FFAR(".ppageFF")     /* Represents 0xC000 - 0xFFFF ("text" paged) */
00147 //#define DPAGE_FF DFAR(".ppageFF")     /* Represents 0xC000 - 0xFFFF ("text" paged) */
00148 /* The previous four lines are included for clarity only. */
00149 /* Changes to the memory layout should be reflected in memory.x and Makefile also */
00150 
00151 
00152 #else
00153         /* let us know if we are being untidy with headers */
00154         #warning "Header file MEMORY_H seen before, sort it out!"
00155 /* end of the wrapper ifdef from the very top */
00156 #endif

Generated on Mon Dec 22 21:29:18 2008 for freeems by  doxygen 1.5.2