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 Thu Jun 16 21:22:58 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
87 void EcuM_AL_DriverInitZero(void)
\r
93 EcuM_ConfigType* EcuM_DeterminePbConfiguration(void)
\r
98 void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)
\r
100 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
102 #if defined(USE_MCU)
\r
103 Mcu_Init(ConfigPtr->McuConfig);
\r
105 // Set up default clock (Mcu_InitClock requires initRun==1)
\r
106 // Ignoring return value
\r
107 (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );
\r
109 // Wait for PLL to sync.
\r
110 while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)
\r
116 #if defined(USE_DEM)
\r
117 // Preinitialize DEM
\r
121 #if defined(USE_PORT)
\r
123 Port_Init(ConfigPtr->PortConfig);
\r
127 #if defined(USE_GPT)
\r
129 Gpt_Init(ConfigPtr->GptConfig);
\r
135 #if defined(USE_DMA)
\r
137 Dma_Init(ConfigPtr->DmaConfig);
\r
140 #if defined(USE_ADC)
\r
142 Adc_Init(ConfigPtr->AdcConfig);
\r
149 #if defined(USE_PWM)
\r
151 Pwm_Init(ConfigPtr->PwmConfig);
\r
155 void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
\r
157 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
159 #if defined(USE_SPI)
\r
161 Spi_Init(ConfigPtr->SpiConfig);
\r
164 #if defined(USE_EEP)
\r
166 Eep_Init(ConfigPtr->EEpConfig);
\r
169 #if defined(USE_FLS)
\r
171 Fls_Init(ConfigPtr->FlashConfig);
\r
174 #if defined(USE_FEE)
\r
179 #if defined(USE_EA)
\r
184 #if defined(USE_NVM)
\r
185 // Setup NVRAM Manager and start the read all job
\r
190 // Setup CAN tranceiver
\r
193 #if defined(USE_CAN)
\r
194 // Setup Can driver
\r
195 Can_Init(ConfigPtr->CanConfig);
\r
198 #if defined(USE_CANIF)
\r
200 CanIf_Init(ConfigPtr->CanIfConfig);
\r
203 #if defined(USE_CANTP)
\r
208 #if defined(USE_CANSM)
\r
209 CanSM_Init(ConfigPtr->CanSMConfig);
\r
215 #if defined(USE_PDUR)
\r
216 // Setup PDU Router
\r
217 PduR_Init(ConfigPtr->PduRConfig);
\r
220 #if defined(USE_CANNM)
\r
221 // Setup Can Network Manager
\r
222 CanNm_Init(ConfigPtr->CanNmConfig);
\r
225 #if defined(USE_NM)
\r
226 // Setup Network Management Interface
\r
227 Nm_Init(ConfigPtr->NmConfig);
\r
230 #if defined(USE_COM)
\r
232 Com_Init(ConfigPtr->ComConfig);
\r
235 #if defined(USE_DCM)
\r
240 #if defined(USE_IOHWAB)
\r
241 // Setup IO hardware abstraction layer
\r
247 void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr)
\r
249 //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules
\r
251 #if defined(USE_DEM)
\r
256 #if defined(USE_COMM)
\r
257 // Setup Communication Manager
\r
258 ComM_Init(ConfigPtr->ComMConfig);
\r
262 void EcuM_OnEnterRUN(void)
\r
267 void EcuM_OnExitRun(void)
\r
272 void EcuM_OnExitPostRun(void)
\r
277 void EcuM_OnPrepShutdown(void)
\r
282 void EcuM_OnGoSleep(void)
\r
287 void EcuM_OnGoOffOne(void)
\r
292 void EcuM_OnGoOffTwo(void)
\r
297 void EcuM_AL_SwitchOff(void)
\r