2 * Configuration of module: EcuM (EcuM_Callout_template.c)
\r
7 * Configured for (MCU): HCS12
\r
9 * Module vendor: ArcCore
\r
10 * Generator version: 2.0.2
\r
12 * Generated by Arctic Studio (http://arccore.com)
\r
13 * on Mon Jun 27 21:49:46 CEST 2011
\r
18 #include "EcuM_Cbk.h"
\r
20 #if defined(USE_DEM)
\r
23 #if defined(USE_MCU)
\r
26 #if defined(USE_GPT)
\r
29 #if defined(USE_CAN)
\r
32 #if defined(USE_CANIF)
\r
35 #if defined(USE_PDUR)
\r
38 #if defined(USE_COM)
\r
41 #if defined(USE_CANTP)
\r
44 #if defined(USE_DCM)
\r
47 #if defined(USE_PWM)
\r
50 #if defined(USE_IOHWAB)
\r
53 #if defined(USE_FLS)
\r
56 #if defined(USE_EEP)
\r
59 #if defined(USE_FEE)
\r
65 #if defined(USE_NVM)
\r
68 #if defined(USE_COMM)
\r
74 #if defined(USE_CANNM)
\r
77 #if defined(USE_CANSM)
\r
80 #if defined(USE_LINSM)
\r
83 #if defined(USE_SPI)
\r
86 #if defined(USE_WDG)
\r
89 #if defined(USE_WDGM)
\r
93 void EcuM_AL_DriverInitZero(void)
\r
95 Det_Init();/** @req EcuM2783 */
\r
96 Det_Start();/** @req EcuM2634 */
\r
99 EcuM_ConfigType* EcuM_DeterminePbConfiguration(void)
\r
101 return &EcuMConfig;
\r
104 void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)
\r
107 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
109 #if defined(USE_MCU)
\r
110 Mcu_Init(ConfigPtr->McuConfig);
\r
112 /* Set up default clock (Mcu_InitClock requires initRun==1) */
\r
113 /* Ignoring return value */
\r
114 (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );
\r
116 // Wait for PLL to sync.
\r
117 while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)
\r
123 #if defined(USE_DEM)
\r
124 // Preinitialize DEM
\r
128 #if defined(USE_PORT)
\r
130 Port_Init(ConfigPtr->PortConfig);
\r
134 #if defined(USE_GPT)
\r
136 Gpt_Init(ConfigPtr->GptConfig);
\r
140 #if defined(USE_WDG)
\r
141 Wdg_Init(ConfigPtr->WdgConfig);
\r
143 #if defined(USE_WDGM)
\r
144 WdgM_Init(ConfigPtr->WdgMConfig);
\r
147 #if defined(USE_DMA)
\r
149 Dma_Init(ConfigPtr->DmaConfig);
\r
152 #if defined(USE_ADC)
\r
154 Adc_Init(ConfigPtr->AdcConfig);
\r
161 #if defined(USE_PWM)
\r
163 Pwm_Init(ConfigPtr->PwmConfig);
\r
167 void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
\r
170 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
172 #if defined(USE_SPI)
\r
174 Spi_Init(ConfigPtr->SpiConfig);
\r
177 #if defined(USE_EEP)
\r
179 Eep_Init(ConfigPtr->EepConfig);
\r
182 #if defined(USE_FLS)
\r
184 Fls_Init(ConfigPtr->FlashConfig);
\r
187 #if defined(USE_FEE)
\r
192 #if defined(USE_EA)
\r
197 #if defined(USE_NVM)
\r
198 // Setup NVRAM Manager and start the read all job
\r
203 // Setup CAN tranceiver
\r
206 #if defined(USE_CAN)
\r
207 // Setup Can driver
\r
208 Can_Init(ConfigPtr->CanConfig);
\r
211 #if defined(USE_CANIF)
\r
213 CanIf_Init(ConfigPtr->CanIfConfig);
\r
216 #if defined(USE_CANTP)
\r
221 #if defined(USE_CANSM)
\r
222 CanSM_Init(ConfigPtr->CanSMConfig);
\r
228 #if defined(USE_PDUR)
\r
229 // Setup PDU Router
\r
230 PduR_Init(ConfigPtr->PduRConfig);
\r
233 #if defined(USE_CANNM)
\r
234 // Setup Can Network Manager
\r
235 CanNm_Init(ConfigPtr->CanNmConfig);
\r
238 #if defined(USE_NM)
\r
239 // Setup Network Management Interface
\r
240 Nm_Init(ConfigPtr->NmConfig);
\r
243 #if defined(USE_COM)
\r
245 Com_Init(ConfigPtr->ComConfig);
\r
248 #if defined(USE_DCM)
\r
253 #if defined(USE_IOHWAB)
\r
254 // Setup IO hardware abstraction layer
\r
260 void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr)
\r
263 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
265 #if defined(USE_DEM)
\r
270 #if defined(USE_COMM)
\r
271 // Setup Communication Manager
\r
272 ComM_Init(ConfigPtr->ComMConfig);
\r
276 void EcuM_OnEnterRUN(void)
\r
281 void EcuM_OnExitRun(void)
\r
286 void EcuM_OnExitPostRun(void)
\r
291 void EcuM_OnPrepShutdown(void)
\r
296 void EcuM_OnGoSleep(void)
\r
301 void EcuM_OnGoOffOne(void)
\r
306 void EcuM_OnGoOffTwo(void)
\r
311 void EcuM_AL_SwitchOff(void)
\r