FreeEMS  0.2.0-SNAPSHOT-282-g9efc524
generalTypes.h
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2008-2011 Fred Cooke
4  *
5  * This file is part of the FreeEMS project.
6  *
7  * FreeEMS software is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * FreeEMS software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
19  *
20  * We ask that if you make any changes to this file you email them upstream to
21  * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
22  *
23  * Thank you for choosing FreeEMS to run your engine!
24  */
25 
26 
27 /** @file
28  *
29  * @ingroup allHeaders
30  * @ingroup globalHeaders
31  * @ingroup dataStructures
32  *
33  * @brief General struct typedefs
34  *
35  * This file contains all of the general purpose and smaller struct typedefs.
36  */
37 
38 
39 /* Header file multiple inclusion protection courtesy eclipse Header Template */
40 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */
41 #ifndef FILE_GENERAL_TYPES_H_SEEN
42 #define FILE_GENERAL_TYPES_H_SEEN
43 
44 
45 /* block_ prefixed defines have Masks for the flag field in the blockDetails struct. */
46 
47 /** Memory block has parent */
48 #define block_has_parent BIT0_16
49 #define block_is_in_ram BIT1_16
50 #define block_is_in_flash BIT2_16
51 #define block_is_indexable BIT3_16
52 #define block_is_read_only BIT4_16
53 #define block_gets_verified BIT5_16
54 #define block_for_backup_restore BIT6_16
55 #define block_spare_flag_7 BIT7_16
56 #define block_spare_flag_8 BIT8_16
57 #define block_spare_flag_9 BIT9_16
58 #define block_spare_flag_10 BIT10_16
59 #define block_spare_flag_11 BIT11_16
60 #define block_is_2dus_table BIT12_16
61 #define block_is_main_table BIT13_16
62 #define block_is_lookup_data BIT14_16
63 #define block_is_configuration BIT15_16
64 
65 /** Addressable memory block description.
66  *
67  * This structure holds all details required to manipulate a particular block.
68  *
69  * It is used for passing around the details of a memory block to allow serial
70  * operations on RAM and flash data structures in a safe and protected way.
71  *
72  * block_ prefixed defines are masks for the flag field in the this struct.
73  */
74 typedef struct {
75  unsigned short flags; ///< Property flags, see flag masks above
76  unsigned short parent; ///< Location ID of parent block if sub block
77  unsigned char RAMPage; ///< RAM page number
78  unsigned char FlashPage; ///< Flash page number
79  void* RAMAddress; ///< RAM address
80  void* FlashAddress; ///< Flash address
81  unsigned short size; ///< Memory block size
82 } blockDetails;
83 
84 
85 #else
86  /* let us know if we are being untidy with headers */
87  #warning "Header file GENERAL_TYPES_H seen before, sort it out!"
88 /* end of the wrapper ifdef from the very top */
89 #endif