]> rtime.felk.cvut.cz Git - arc.git/blob - boards/generic/EcuM_Callout_template.c
PCLint fixes for EcuM template.
[arc.git] / boards / generic / EcuM_Callout_template.c
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15 \r
16 #warning "This default file may only be used as an example!"
17
18 #include "EcuM.h"
19 #include "EcuM_Cbk.h"\r
20 #include "Det.h"\r
21 #if defined(USE_DEM)\r
22 #include "Dem.h"\r
23 #endif\r
24 #if defined(USE_MCU)\r
25 #include "Mcu.h"\r
26 #endif\r
27 #if defined(USE_GPT)\r
28 #include "Gpt.h"\r
29 #endif\r
30 #if defined(USE_CAN)\r
31 #include "Can.h"\r
32 #endif\r
33 #if defined(USE_CANIF)\r
34 #include "CanIf.h"\r
35 #endif\r
36 #if defined(USE_PDUR)\r
37 #include "PduR.h"\r
38 #endif\r
39 #if defined(USE_COM)\r
40 #include "Com.h"\r
41 #endif\r
42 #if defined(USE_CANTP)\r
43 #include "CanTp.h"\r
44 #endif\r
45 #if defined(USE_DCM)\r
46 #include "Dcm.h"\r
47 #endif\r
48 #if defined(USE_PWM)\r
49 #include "Pwm.h"\r
50 #endif\r
51 #if defined(USE_IOHWAB)\r
52 #include "IoHwAb.h"\r
53 #endif
54 #if defined(USE_FLS)
55 #include "Fls.h"
56 #endif
57 #if defined(USE_EEP)
58 #include "Eep.h"
59 #endif
60 #if defined(USE_FEE)
61 #include "Fee.h"
62 #endif\r
63 #if defined(USE_EA)
64 #include "Ea.h"
65 #endif
66 #if defined(USE_NVM)
67 #include "NvM.h"
68 #endif
69 #if defined(USE_COMM)
70 #include "ComM.h"
71 #endif
72 #if defined(USE_NM)
73 #include "Nm.h"
74 #endif
75 #if defined(USE_CANNM)
76 #include "CanNm.h"
77 #endif
78 #if defined(USE_CANSM)
79 #include "CanSM.h"
80 #endif
81 #if defined(USE_LINSM)
82 #include "LinSM.h"
83 #endif
84 \r
85 void EcuM_AL_DriverInitZero(void)\r
86 {\r
87         Det_Init();\r
88     Det_Start();\r
89 }\r
90 \r
91 EcuM_ConfigType* EcuM_DeterminePbConfiguration(void)\r
92 {\r
93         return &EcuMConfig;\r
94 }\r
95
96 void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)\r
97 {
98   //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules\r
99 #if defined(USE_MCU)\r
100         Mcu_Init(ConfigPtr->McuConfig);\r
101 \r
102         /* Set up default clock (Mcu_InitClock requires initRun==1) */
103         /* Ignoring return value */\r
104         (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );\r
105 \r
106         // Wait for PLL to sync.\r
107         while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)
108         {\r
109           ;
110         }\r
111 #endif\r
112 \r
113 #if defined(USE_DEM)\r
114         // Preinitialize DEM\r
115         Dem_PreInit();\r
116 #endif\r
117 \r
118 #if defined(USE_PORT)\r
119         // Setup Port\r
120         Port_Init(ConfigPtr->PortConfig);\r
121 #endif\r
122 \r
123 \r
124 #if defined(USE_GPT)\r
125         // Setup the GPT\r
126         Gpt_Init(ConfigPtr->GptConfig);\r
127 #endif\r
128 \r
129         // Setup watchdog\r
130         // TODO\r
131 \r
132 #if defined(USE_DMA)\r
133         // Setup DMA\r
134         Dma_Init(ConfigPtr->DmaConfig);\r
135 #endif\r
136 \r
137 #if defined(USE_ADC)\r
138         // Setup ADC\r
139         Adc_Init(ConfigPtr->AdcConfig);\r
140 #endif\r
141 \r
142         // Setup ICU\r
143         // TODO\r
144 \r
145         // Setup PWM\r
146 #if defined(USE_PWM)\r
147         // Setup PWM\r
148         Pwm_Init(ConfigPtr->PwmConfig);\r
149 #endif\r
150 }\r
151 \r
152 void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)\r
153 {
154   //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules
155 \r
156 #if defined(USE_SPI)\r
157         // Setup SPI\r
158         Spi_Init(ConfigPtr->SpiConfig);\r
159 #endif\r
160 \r
161 #if defined(USE_EEP)\r
162         // Setup EEP\r
163         Eep_Init(ConfigPtr->EEpConfig);\r
164 #endif\r
165 \r
166 #if defined(USE_FLS)\r
167         // Setup Flash\r
168         Fls_Init(ConfigPtr->FlashConfig);\r
169 #endif\r
170 \r
171 #if defined(USE_FEE)
172         // Setup FEE
173         Fee_Init();
174 #endif
175
176 #if defined(USE_EA)
177         // Setup EA
178         Ea_init();
179 #endif
180
181 #if defined(USE_NVM)
182         // Setup NVRAM Manager and start the read all job
183         NvM_Init();
184         NvM_ReadAll();
185 #endif
186
187         // Setup CAN tranceiver\r
188         // TODO\r
189 \r
190 #if defined(USE_CAN)\r
191         // Setup Can driver\r
192         Can_Init(ConfigPtr->CanConfig);\r
193 #endif\r
194 \r
195 #if defined(USE_CANIF)\r
196         // Setup CanIf\r
197         CanIf_Init(ConfigPtr->CanIfConfig);\r
198 #endif\r
199 \r
200 #if defined(USE_CANTP)\r
201         // Setup CAN TP\r
202         CanTp_Init();\r
203 #endif
204
205 #if defined(USE_CANSM)
206         CanSM_Init(ConfigPtr->CanSMConfig);
207 #endif
208 \r
209         // Setup LIN\r
210         // TODO\r
211 \r
212 #if defined(USE_PDUR)\r
213         // Setup PDU Router\r
214         PduR_Init(ConfigPtr->PduRConfig);\r
215 #endif\r
216
217 #if defined(USE_CANNM)
218         // Setup Can Network Manager
219         CanNm_Init(ConfigPtr->CanNmConfig);
220 #endif
221
222 #if defined(USE_NM)
223         // Setup Network Management Interface
224         Nm_Init(ConfigPtr->NmConfig);
225 #endif
226 \r
227 #if defined(USE_COM)\r
228         // Setup COM layer\r
229         Com_Init(ConfigPtr->ComConfig);\r
230 #endif\r
231 \r
232 #if defined(USE_DCM)\r
233         // Setup DCM\r
234         Dcm_Init();\r
235 #endif\r
236 \r
237 #if defined(USE_IOHWAB)\r
238         // Setup IO hardware abstraction layer\r
239         IoHwAb_Init();\r
240 #endif\r
241 }\r
242 \r
243 void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr)\r
244 {
245   //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules
246 \r
247 #if defined(USE_DEM)\r
248         // Setup DEM\r
249         Dem_Init();\r
250 #endif\r
251 \r
252 #if defined(USE_COMM)
253         // Setup Communication Manager
254         ComM_Init(ConfigPtr->ComMConfig);
255 #endif
256 }\r
257
258 void EcuM_OnEnterRUN(void)
259 {
260
261 }
262
263 void EcuM_OnExitRun(void)
264 {
265
266 }
267
268 void EcuM_OnExitPostRun(void)
269 {
270
271 }
272
273 void EcuM_OnPrepShutdown(void)
274 {
275
276 }
277
278 void EcuM_OnGoSleep(void)
279 {
280
281 }
282
283 void EcuM_OnGoOffOne(void)
284 {
285
286 }
287
288 void EcuM_OnGoOffTwo(void)
289 {
290
291 }
292
293 void EcuM_AL_SwitchOff(void)
294 {
295
296 }