From: mahi Date: Thu, 13 Sep 2012 07:22:24 +0000 (+0200) Subject: Minor corrections to EcuM/GPT X-Git-Url: http://rtime.felk.cvut.cz/gitweb/arc.git/commitdiff_plain/bc6a977b097fbc35f420078a5d3e8a8b41486450 Minor corrections to EcuM/GPT --- diff --git a/boards/generic/EcuM_Generated_Types.h b/boards/generic/EcuM_Generated_Types.h deleted file mode 100644 index b9e0417f..00000000 --- a/boards/generic/EcuM_Generated_Types.h +++ /dev/null @@ -1,159 +0,0 @@ -/* -------------------------------- Arctic Core ------------------------------ - * Arctic Core - the open source AUTOSAR platform http://arccore.com - * - * Copyright (C) 2009 ArcCore AB - * - * This source code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by the - * Free Software Foundation; See . - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * -------------------------------- Arctic Core ------------------------------*/ - - -#warning "This default file may only be used as an example!" - -#if ((ECUM_SW_MAJOR_VERSION != 2) && (ECUM_SW_MINOR_VERSION != 0)) -#error "EcuM: Configuration file version differs from BSW version." -#endif - - -#ifndef _ECUM_GENERATED_TYPES_H_ -#define _ECUM_GENERATED_TYPES_H_ - -#if defined(USE_MCU) -#include "Mcu.h" -#endif -#if defined(USE_PORT) -#include "Port.h" -#endif -#if defined(USE_CAN) -#include "Can.h" -#endif -#if defined(USE_CANIF) -#include "CanIf.h" -#endif -#if defined(USE_PWM) -#include "Pwm.h" -#endif -#if defined(USE_COM) -#include "Com.h" -#endif -#if defined(USE_PDUR) -#include "PduR.h" -#endif -#if defined(USE_DMA) -#include "Dma.h" -#endif -#if defined(USE_ADC) -#include "Adc.h" -#endif -#if defined(USE_GPT) -#include "Gpt.h" -#endif -#if defined(USE_FLS) -#include "Fls.h" -#endif -#if defined(USE_EEP) -#include "Eep.h" -#endif -#if defined(USE_WDG) -#include "Wdg.h" -#endif -#if defined(USE_WDGM) -#include "WdgM.h" -#endif -#if defined(USE_WDGIF) -#include "WdgIf.h" -#endif -#if defined(USE_COMM) -#include "ComM.h" -#endif -#if defined(USE_NM) -#include "Nm.h" -#endif -#if defined(USE_CANNM) -#include "CanNm.h" -#endif -#if defined(USE_CANSM) -#include "CanSM.h" -#endif -#if defined(USE_LINSM) -#include "LinSM.h" -#endif - -typedef struct EcuM_Config -{ - EcuM_StateType EcuMDefaultShutdownTarget; - uint8 EcuMDefaultSleepMode; - AppModeType EcuMDefaultAppMode; - uint32 EcuMRunMinimumDuration; - uint32 EcuMNvramReadAllTimeout; - uint32 EcuMNvramWriteAllTimeout; - -#if defined(USE_MCU) - const Mcu_ConfigType* McuConfig; -#endif -#if defined(USE_PORT) - const Port_ConfigType* PortConfig; -#endif -#if defined(USE_CAN) - const Can_ConfigType* CanConfig; -#endif -#if defined(USE_CANIF) - const CanIf_ConfigType* CanIfConfig; -#endif -#if defined(USE_CANSM) - const CanSM_ConfigType* CanSMConfig; -#endif -#if defined(USE_NM) - const Nm_ConfigType* NmConfig; -#endif -#if defined(USE_CANNM) - const CanNm_ConfigType* CanNmConfig; -#endif -#if defined(USE_COMM) - const ComM_ConfigType* ComMConfig; -#endif -#if defined(USE_COM) - const Com_ConfigType* ComConfig; -#endif -#if defined(USE_PDUR) - const PduR_PBConfigType* PduRConfig; -#endif -#if defined(USE_PWM) - const Pwm_ConfigType* PwmConfig; -#endif -#if defined(USE_DMA) - const Dma_ConfigType* DmaConfig; -#endif -#if defined(USE_ADC) - const Adc_ConfigType* AdcConfig; -#endif -#if defined(USE_WDG) - const Wdg_ConfigType* WdgConfig; -#endif -#if defined(USE_WDGIF) - const WdgIf_ConfigType* WdgIfConfig; -#endif -#if defined(USE_WDGM) - const WdgM_ConfigType* WdgMConfig; -#endif -#if defined(USE_GPT) - const Gpt_ConfigType* GptConfig; -#endif -#if defined(USE_FLS) - const Fls_ConfigType* FlashConfig; -#endif -#if defined(USE_EEP) - const Eep_ConfigType* EepConfig; -#endif -#if defined(USE_SPI) - const Spi_ConfigType* SpiConfig; -#endif -} EcuM_ConfigType; - -#endif /*_ECUM_GENERATED_TYPES_H_*/ diff --git a/include/Gpt.h b/include/Gpt.h index f0ce66db..703d1d1c 100644 --- a/include/Gpt.h +++ b/include/Gpt.h @@ -97,9 +97,9 @@ typedef uint8_t Gpt_ChannelType; #define GPT_AR_MINOR_VERSION 2 #define GPT_AR_PATCH_VERSION 1 -//#if (GPT_REPORT_WAKEUP_SOURCE==STD_ON) +#if (GPT_REPORT_WAKEUP_SOURCE==STD_ON) #include "EcuM_Cbk.h" /* @req 4.0.3/GPT271 */ -//#endif +#endif /* Needs Gpt_ConfigType */ #include "Gpt_Cfg.h" /* @req 4.0.3/GPT259 */ diff --git a/system/EcuM/EcuM_Callout_Stubs.c b/system/EcuM/EcuM_Callout_Stubs.c new file mode 100644 index 00000000..30680323 --- /dev/null +++ b/system/EcuM/EcuM_Callout_Stubs.c @@ -0,0 +1,408 @@ +/* +* Configuration of module: EcuM (EcuM_Callout_Stubs.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): MPC5567 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#include "EcuM.h" +#include "EcuM_Generated_Types.h" +#include "Det.h" +#if defined(USE_DEM) +#include "Dem.h" +#endif +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_CANTP) +#include "CanTp.h" +#endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#endif +#if defined(USE_DCM) +#include "Dcm.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_IOHWAB) +#include "IoHwAb.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_FEE) +#include "Fee.h" +#endif +#if defined(USE_EA) +#include "Ea.h" +#endif +#if defined(USE_NVM) +#include "NvM.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_UDPNM) +#include "UdpNm.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif +#if defined(USE_WDG) +#include "Wdg.h" +#endif +#if defined(USE_WDGM) +#include "WdgM.h" +#endif + +#define VALIDATE_STATE(_state) \ + do { \ + EcuM_StateType ecuMState; \ + EcuM_GetState(&ecuMState); \ + assert(ecuMState == (_state) ); \ + } while(0) + + +void EcuM_AL_DriverInitZero(void) +{ + Det_Init();/** @req EcuM2783 */ + Det_Start();/** @req EcuM2634 */ +} + +extern EcuM_ConfigType EcuMConfig; + +EcuM_ConfigType* EcuM_DeterminePbConfiguration(void) +{ + return &EcuMConfig; +} + +void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_MCU) + Mcu_Init(ConfigPtr->McuConfig); + + /* Set up default clock (Mcu_InitClock requires initRun==1) */ + /* Ignoring return value */ + (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings ); + + // Wait for PLL to sync. + while (Mcu_GetPllStatus() != MCU_PLL_LOCKED) + { + ; + } +#endif + +#if defined(USE_DEM) + // Preinitialize DEM + Dem_PreInit(); +#endif + +#if defined(USE_PORT) + // Setup Port + Port_Init(ConfigPtr->PortConfig); +#endif + + +#if defined(USE_GPT) + // Setup the GPT + Gpt_Init(ConfigPtr->GptConfig); +#endif + + // Setup watchdog +#if defined(USE_WDG) + Wdg_Init(ConfigPtr->WdgConfig); +#endif +#if defined(USE_WDGM) + WdgM_Init(ConfigPtr->WdgMConfig); +#endif + +#if defined(USE_DMA) + // Setup DMA + Dma_Init(ConfigPtr->DmaConfig); +#endif + +#if defined(USE_ADC) + // Setup ADC + Adc_Init(ConfigPtr->AdcConfig); +#endif + + // Setup ICU + // TODO + + // Setup PWM +#if defined(USE_PWM) + // Setup PWM + Pwm_Init(ConfigPtr->PwmConfig); +#endif +} + +void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_SPI) + // Setup SPI + Spi_Init(ConfigPtr->SpiConfig); +#endif + +#if defined(USE_EEP) + // Setup EEP + Eep_Init(ConfigPtr->EepConfig); +#endif + +#if defined(USE_FLS) + // Setup Flash + Fls_Init(ConfigPtr->FlashConfig); +#endif + +#if defined(USE_FEE) + // Setup FEE + Fee_Init(); +#endif + +#if defined(USE_EA) + // Setup EA + Ea_Init(); +#endif + +#if defined(USE_NVM) + // Setup NVRAM Manager and start the read all job + NvM_Init(); + NvM_ReadAll(); +#endif + + // Setup CAN tranceiver + // TODO + +#if defined(USE_CAN) + // Setup Can driver + Can_Init(ConfigPtr->CanConfig); +#endif + +#if defined(USE_CANIF) + // Setup CanIf + CanIf_Init(ConfigPtr->CanIfConfig); +#endif + +#if defined(USE_CANTP) + // Setup CAN TP + CanTp_Init(); +#endif + +#if defined(USE_CANSM) + CanSM_Init(ConfigPtr->CanSMConfig); +#endif + +#if defined(USE_J1939TP) + // Setup J1939Tp + J1939Tp_Init(ConfigPtr->J1939TpConfig); +#endif + + + // Setup LIN + // TODO + +#if defined(USE_PDUR) + // Setup PDU Router + PduR_Init(ConfigPtr->PduRConfig); +#endif + +#if defined(USE_CANNM) + // Setup Can Network Manager + CanNm_Init(ConfigPtr->CanNmConfig); +#endif + +#if defined(USE_UDPNM) + // Setup Udp Network Manager + UdpNm_Init(ConfigPtr->UdpNmConfig); +#endif + +#if defined(USE_NM) + // Setup Network Management Interface + Nm_Init(ConfigPtr->NmConfig); +#endif + +#if defined(USE_COM) + // Setup COM layer + Com_Init(ConfigPtr->ComConfig); +#endif + +#if defined(USE_DCM) + // Setup DCM + Dcm_Init(); +#endif + +#if defined(USE_IOHWAB) + // Setup IO hardware abstraction layer + IoHwAb_Init(); +#endif + +} + +void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_DEM) + // Setup DEM + Dem_Init(); +#endif + +#if defined(USE_COMM) + // Setup Communication Manager + ComM_Init(ConfigPtr->ComMConfig); +#endif +} + +void EcuM_OnEnterRun(void) +{ + +} + +void EcuM_OnExitRun(void) +{ + +} + +void EcuM_OnExitPostRun(void) +{ + +} + +void EcuM_OnPrepShutdown(void) +{ + +} + +void EcuM_OnGoSleep(void) +{ + +} + +void EcuM_OnGoOffOne(void) +{ + +} + +void EcuM_OnGoOffTwo(void) +{ + +} + +void EcuM_AL_SwitchOff(void) +{ + +} + +void EcuM_CheckWakeup(EcuM_WakeupSourceType source) { +} + +void EcuM_EnableWakeupSources( EcuM_WakeupSourceType source ) { +} + +void EcuM_DisableWakeupSources(EcuM_WakeupSourceType wakeupSource) { +} + + +/** + * + * + * + * @param wakeupSource + */ +void EcuM_StartWakeupSources(EcuM_WakeupSourceType wakeupSource) { + VALIDATE_STATE( ECUM_STATE_WAKEUP_VALIDATION ); + +} + + +/** + * Restart drivers.. + */ +void EcuM_AL_DriverRestart( void ) { + + VALIDATE_STATE( ECUM_STATE_WAKEUP_VALIDATION ); + +} + + +/** + * + * @param wact + * @return + */ +EcuM_WakeupReactionType EcuM_OnWakeupReaction( EcuM_WakeupReactionType wact ) { + + VALIDATE_STATE( ECUM_STATE_WAKEUP_REACTION ); + + return wact; +} + +/** + * Generate RAM hash. + * We are in ECUM_STATE_SLEEP here. + * + */ +void EcuM_GenerateRamHash( void ) { + VALIDATE_STATE( ECUM_STATE_SLEEP ); +} + +/** + * Check RAM hash. + * We are still in ECUM_STATE_SLEEP here. + * + * @return + */ +uint8 EcuM_CheckRamHash( void ) { + VALIDATE_STATE( ECUM_STATE_SLEEP ); + + return 0; +} + + +