]> rtime.felk.cvut.cz Git - arc.git/blob - boards/mpc5516it/config/Eep_Cfg.h
Cleanup of some drivers. Re-generated examples for mpc551xsim
[arc.git] / boards / mpc5516it / config / Eep_Cfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 #warning "This default file may only be used as an example!"\r
24 \r
25 #ifndef EEP_CFG_H_\r
26 #define EEP_CFG_H_\r
27 \r
28 #include "Spi.h"\r
29 \r
30 /* EepGeneral */\r
31 \r
32 // Switches to activate or deactivate interrupt controlled job processing. true:\r
33 // Interrupt controlled job processing enabled. false: Interrupt controlled job\r
34 // processing disabled.\r
35 #define EEP_USE_INTERRUPTS                            STD_OFF\r
36 \r
37 // Pre-processor switch to enable and disable development error detection.\r
38 // true: Development error detection enabled. false: Development error\r
39 // detection disabled.\r
40 #define EEP_DEV_ERROR_DETECT                  STD_ON\r
41 \r
42 // Pre-processor switch to enable / disable the API to read out the modules\r
43 // version information. true: Version info API enabled. false: Version info API\r
44 // disabled.\r
45 #define EEP_VERSION_INFO_API                  STD_ON\r
46 \r
47 // ndex of the driver, used by EA.\r
48 #define EEP_DRIVER_INDEX                                1\r
49 \r
50 // Switches to activate or deactivate write cycle reduction (EEPROM value is\r
51 // read and compared before being overwritten). true: Write cycle reduction\r
52 // enabled. false: Write cycle reduction disabled.\r
53 #define EEP_WRITE_CYCLE_REDUCTION         STD_OFF\r
54 \r
55 // Container for runtime configuration parameters of the EEPROM driver.\r
56 // Implementation Type: Eep_ConfigType.\r
57 \r
58 /*  EepPublishedInformation\r
59  *\r
60  * TODO\r
61  *\r
62  * 3.0 additions?\r
63  */\r
64 \r
65 // Total size of EEPROM in bytes. Implementation Type: Eep_LengthType.\r
66 #define EEP_TOTAL_SIZE          TBD\r
67 \r
68 // Size of smallest erasable EEPROM data unit in bytes.\r
69 #define EEP_ERASE_UNIT_SIZE TBD\r
70 \r
71 // EepMinimumLengthType {EEP_MINIMUM_LENGTH_TYPE}\r
72 // Minimum expected size of Eep_LengthType.\r
73 #define EEP_MINIMUM_LENGTH_TYPE TBD\r
74 \r
75 // Minimum expected size of Eep_AddressType.\r
76 #define EEP_MINIMUM_ADDRESS_TYPE TBD\r
77 \r
78 // Size of smallest writable EEPROM data unit in bytes.\r
79 #define EEP_WRITE_UNIT_SIZE TBD\r
80 \r
81 // Value of an erased EEPROM cell.\r
82 #define EEP_ERASE_VALUE                 0\r
83 \r
84 // Number of erase cycles specified for the EEP device (usually given in the\r
85 // device data sheet).\r
86 #define EEP_SPECIFIED_ERASE_CYCLES TBD\r
87 \r
88 // Size of smallest readable EEPROM data unit in bytes.\r
89 #define EEP_READ_UNIT_SIZE TBD\r
90 \r
91 // Time for writing one EEPROM data unit.\r
92 #define EEP_WRITE_TIME  TBD\r
93 \r
94 // Time for erasing one EEPROM data unit\r
95 #define EEP_ERASE_TIME  TBD\r
96 \r
97 // Specified maximum number of write cycles under worst case conditions of\r
98 // specific EEPROM hardware (e.g. +90°C)\r
99 #define EEP_ALLOWED_WRITE_CYCLES x\r
100 \r
101 \r
102 typedef struct {\r
103 \r
104   /* EEP094 */\r
105 \r
106   Spi_SequenceType EepCmdSequence;\r
107   Spi_SequenceType EepCmd2Sequence;\r
108   Spi_SequenceType EepReadSequence;\r
109   Spi_SequenceType EepWriteSequence;\r
110 \r
111   Spi_ChannelType EepAddrChannel;\r
112   Spi_ChannelType EepCmdChannel;\r
113   Spi_ChannelType EepDataChannel;\r
114   Spi_ChannelType EepWrenChannel;\r
115 \r
116   // number of bytes read within one job processing cycle in normal mode.\r
117   Eep_LengthType EepNormalReadBlockSize;\r
118 \r
119   // call cycle of the job processing function during write/erase operations. Unit: [s]\r
120   float  EepJobCallCycle;\r
121 \r
122   // This parameter is the used size of EEPROM device in bytes.\r
123   Eep_LengthType        EepSize;\r
124 \r
125   // This parameter is a reference to a callback function for positive job result\r
126   void (*Eep_JobEndNotification)();\r
127 \r
128   // This parameter is the default EEPROM device mode after initialization.\r
129   MemIf_ModeType EepDefaultMode;\r
130 \r
131   // This parameter is the number of bytes read within one job processing cycle in fast mode\r
132   Eep_LengthType EepFastReadBlockSize;\r
133 \r
134   // Number of bytes written within one job processing cycle in normal mode.\r
135   Eep_LengthType EepNormalWriteBlockSize;\r
136 \r
137   // This parameter is a reference to a callback function for negative job result\r
138   void (*Eep_JobErrorNotification)();\r
139 \r
140   // This parameter is the number of bytes written within one job processing cycle in fast mode\r
141   Eep_LengthType EepFastWriteBlockSize;\r
142 \r
143   // This parameter is the EEPROM page size, i.e. number of bytes.
144   Eep_LengthType EepPageSize;
145
146   // This parameter is the EEPROM device base address.\r
147   Eep_AddressType EepBaseAddress;\r
148 } Eep_ConfigType;\r
149 \r
150 // This container is present for external EEPROM drivers only. Internal\r
151 // EEPROM drivers do not use the parameter listed in this container, hence\r
152 // its multiplicity is 0 for internal drivers.\r
153 typedef struct {\r
154   // Reference to SPI sequence (required for external EEPROM drivers).\r
155   // TODO: hmmm....\r
156   uint32  SpiReference;\r
157 } Eep_ExternalDriverType;\r
158 \r
159 extern const Eep_ConfigType EepConfigData[];\r
160 \r
161 #define EEP_DEFAULT_CONFIG EepConfigData[0]\r
162 \r
163 #endif /*EEP_CFG_H_*/\r