void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
{
	(void)ConfigPtr;

#if defined(USE_SPI)
	// Setup SPI
	Spi_Init(ConfigPtr->SpiConfig);
#endif

#if defined(USE_EEP)
	// Setup EEP
	NO_DRIVER(Eep_Init(ConfigPtr->EepConfig));
#endif

#if defined(USE_FLS)
	// Setup Flash
	NO_DRIVER(Fls_Init(ConfigPtr->FlashConfig));
#endif

#if defined(USE_FEE)
	// Setup FEE
	NO_DRIVER(Fee_Init());
#endif

#if defined(USE_EA)
	// Setup EA
	NO_DRIVER(Ea_Init());
#endif

#if defined(USE_NVM)
	// Setup NVRAM Manager and start the read all job
	NO_DRIVER(NvM_Init());
	NO_DRIVER(NvM_ReadAll());
#endif


#if defined(USE_LIN)
    // Setup Lin driver
	Lin_Init(ConfigPtr->LinConfig);
#endif

#if defined(USE_LINIF)
    // Setup LinIf
	LinIf_Init(ConfigPtr->LinIfConfig);
#endif

#if defined(USE_LINSM)
    // Setup LinSM
	LinSM_Init(ConfigPtr->LinSMConfig);
#endif

	// Setup CAN tranceiver
	// NOTE: Add when adding supoprt for CanTranceiver

#if defined(USE_CAN)
	// Setup Can driver
	Can_Init(ConfigPtr->CanConfig);
#endif

#if defined(USE_CANIF)
	// Setup CanIf
	NO_DRIVER(CanIf_Init(ConfigPtr->PostBuildConfig->CanIf_ConfigPtr));
#endif

#if defined(USE_CANTP)
	// Setup CAN TP
	NO_DRIVER(CanTp_Init(ConfigPtr->PostBuildConfig->CanTp_ConfigPtr));
#endif

#if defined(USE_CANSM)
	NO_DRIVER(CanSM_Init(ConfigPtr->CanSMConfig));
#endif

#if defined(USE_J1939TP)
	// Setup J1939Tp
	NO_DRIVER(J1939Tp_Init(ConfigPtr->J1939TpConfig));
#endif

#if defined(USE_PDUR)
	// Setup PDU Router
	NO_DRIVER(PduR_Init(ConfigPtr->PostBuildConfig->PduR_ConfigPtr));
#endif

#if defined(USE_CANNM)
    // Setup Can Network Manager
	NO_DRIVER(CanNm_Init(ConfigPtr->PostBuildConfig->CanNm_ConfigPtr));
#endif

#if defined(USE_UDPNM)
        // Setup Udp Network Manager
	NO_DRIVER(UdpNm_Init(ConfigPtr->UdpNmConfig));
#endif

#if defined(USE_NM)
        // Setup Network Management Interface
	NO_DRIVER(Nm_Init());
#endif

#if defined(USE_COM)
	// Setup COM layer
	NO_DRIVER(Com_Init(ConfigPtr->PostBuildConfig->ComConfigurationPtr));
#endif

#if defined(USE_DCM)
	// Setup DCM
	NO_DRIVER(Dcm_Init(ConfigPtr->DcmConfig));
#endif

#if defined(USE_IOHWAB)
	// Setup IO hardware abstraction layer
	IoHwAb_Init();
#endif

#if defined(USE_XCP)
	// Setup XCP
	NO_DRIVER(Xcp_Init(ConfigPtr->XcpConfig));
#endif

}
示例#2
0
void EcuM_AL_DriverInitOne(const EcuM_ConfigType* configPtr) {

   /* provide a proper clock */
   Mcu_Init(configPtr->bsw_driver.init_one.mcu_cfg);
   Mcu_InitClock(0);
   Mcu_DistributePllClock();

   /* -----------------------------------------------------------------------
	      Interrupt System:
	      -----------------------------------------------------------------------
	      - four arbitration cycles (max. 255 interrupt sources)
	      - two clocks per arbitration cycle */

   __mtcr(0xFE2C,  0x00000000);     /* load CPU interrupt control register */
   __isync();

   /* -----------------------------------------------------------------------
	      Peripheral Control Processor (PCP):
	      -----------------------------------------------------------------------
	      - the PCP internal clock is always running

	      - use Full Context save area (R[0] - R[7])
	      - start progam counter as left by last invocation
	      - channel watchdog is disabled
	      - maximum channel number checking is disabled */

   /* - four arbitration cycles (max. 255 PCP channels) */
   /* - two clocks per arbitration cycle */
   PCP_ICR.U        =  0x00000000;  /* load PCP interrupt control register */

   /* - the PCP warning mechanism is disabled */
   PCP_ITR.U        =  0x00000000;  /* load PCP interrupt threshold register */

   /* - type of service of PCP node 4 is CPU interrupt */
   PCP_SRC4.U       =  0x00001000;  /* load service request control register 4 */

   /* - type of service of PCP node 5 is CPU interrupt */
   PCP_SRC5.U       =  0x00001000;  /* load service request control register 5 */

   /* - type of service of PCP node 6 is CPU interrupt */
   PCP_SRC6.U       =  0x00001000;  /* load service request control register 6 */

   /* - type of service of PCP node 7 is CPU interrupt */
   PCP_SRC7.U       =  0x00001000;  /* load service request control register 7 */

   /* - type of service of PCP node 8 is CPU interrupt */
   PCP_SRC8.U       =  0x00001000;  /* load service request control register 8 */


   ts_initGPTAInt();

   Port_Init(configPtr->bsw_driver.init_one.port_cfg);

   Adc_Init(configPtr->bsw_driver.init_one.adc_cfg);
   Fls_Init(configPtr->bsw_driver.init_one.fls_cfg);
   Gpt_Init(configPtr->bsw_driver.init_one.gpt_cfg);
   Pwm_Init(configPtr->bsw_driver.init_one.pwm_cfg);
   Spi_Init(configPtr->bsw_driver.init_one.spi_cfg);
   Wdg_Init(configPtr->bsw_driver.init_one.wdg_cfg);
#ifdef ECUM_WDGM_INCLUDED
   WdgM_Init(configPtr->bsw_driver.init_one.wdgm_cfg);
#endif

   /* setup end of init protected registers for OS */
   ts_endinit_clear();
   osInitProtected();
   ts_endinit_set();

   /* Overlay Ram:
    * Init registers and mem areas for switching from
    * working page (overlay ram) <-> reference page (flash)
    */
   RAM_OverlayRamReset();

   /* - the CPU interrupt system is globally disabled */
   __enable();


   Spi_SetAsyncMode(SPI_INTERRUPT_MODE);
   Adc_StartGroupConversion(0);
   Adc_StartGroupConversion(1);
   EcuM_SelectApplicationMode(OSDEFAULTAPPMODE);

}
示例#3
0
void EcuM_Callout_DriverInitListTwo(void)
{
  /* status of NvM initialization */
  NvM_RequestResultType Result;
  BswM_Init(BswM_ConfigPtr);
  
  
  Fls_Init(NULL_PTR);
#ifdef BASE_EA_ENABLED
  EA_INIT_FUNC();
#endif
#ifdef BASE_FEE_ENABLED
  FEE_INIT_FUNC();
  
  /* wait for FEE to complete the init sequence */
  do
  {
    Fee_MainFunction();
    Fls_MainFunction();
  }
  while (MEMIF_IDLE != Fee_GetStatus());

#endif
#ifdef BASE_NVM_ENABLED
  NVM_INIT_FUNC();
  NvM_ReadAll();
  
  /* wait for the NvM_ReadAll() to complete - some of the remaining
     modules need valid NvRam data...       */
  do
  {
    NvM_MainFunction();
    Fee_MainFunction();
    Fls_MainFunction();

    (void)NvM_GetErrorStatus(NvMConf_NvMBlockDescriptor_NvMBlock_ConfigID, &Result);
  }
  while (Result == NVM_REQ_PENDING);

#endif
  LinEmuUart_Init();
  
  Can_InitMemory();
  Can_Init(&CanConfigSet);

  CanIf_InitMemory();
  CanIf_Init(&CanIf_Config);
  //CanNm_Init(&CanNmGlobalConfig);
  //Nm_Init(&Nm_Configuration0);
  PduR_InitMemory();
  PduR_Init(&PduRGlobalConfig);
  Com_InitMemory();
  Com_Init(&ComConfig);
  CanSM_InitMemory();
  CanSM_Init();
  CanTp_InitMemory();
  CanTp_Init();  
  ComM_InitMemory();
  ComM_Init(&ComMConfig);
  Xcp_Init(NULL);
  FiM_Init(&FiM_Config_0);
  DiagMeas_Init();
  DiagCtrl_Init();
  SCI_B6Bridge_Init();
    SCI_Pfc_Init();
  SCI_IOHW_Init();
  
#ifdef BASE_DEM_ENABLED
  DEM_INIT_FUNC();
  /* start the standard operation cycle */
  /* (void) Dem_SetOperationCycleState(DEM_OPCYC_POWER, DEM_CYCLE_STATE_START); */
#endif  
  Dcm_Init();
}
示例#4
0
void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
{
	(void)ConfigPtr;
  //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules
//	VALIDATE_STATE(ECUM_STATE_STARTUP_TWO);
#if defined(USE_ETH)
	buffer_init();
	Eth_Init();
#endif
//#undef USE_USB
#if defined(USE_USB)
//    usb_heap_init();
//    mailboxInit();
//    usb_sem_init();
    usbinit();
#endif
#if defined(USE_SPI)
	// Setup SPI
	Spi_Init(ConfigPtr->SpiConfig);
#endif

#if defined(USE_EEP)
	// Setup EEP
	NO_DRIVER(Eep_Init(ConfigPtr->EepConfig));
#endif

#if defined(USE_FLS)
	// Setup Flash
	NO_DRIVER(Fls_Init(ConfigPtr->FlashConfig));
#endif

#if defined(USE_FEE)
	// Setup FEE
	NO_DRIVER(Fee_Init());
#endif

#if defined(USE_EA)
	// Setup EA
	NO_DRIVER(Ea_Init());
#endif

#if defined(USE_NVM)
	// Setup NVRAM Manager and start the read all job
	NO_DRIVER(NvM_Init());
	NO_DRIVER(NvM_ReadAll());
#endif


#if defined(USE_LIN)
    // Setup Lin driver
	Lin_Init(ConfigPtr->LinConfig);
#endif

#if defined(USE_LINIF)
    // Setup LinIf
	LinIf_Init(ConfigPtr->LinIfConfig);
#endif

#if defined(USE_LINSM)
    // Setup LinSM
	LinSM_Init(ConfigPtr->LinSMConfig);
#endif

	// Setup CAN tranceiver
	// TODO

#if defined(USE_CAN)
	// Setup Can driver
	Can_Init(ConfigPtr->CanConfig);
#endif

#if defined(USE_CANIF)
	// Setup CanIf
	NO_DRIVER(CanIf_Init(ConfigPtr->PostBuildConfig->CanIf_ConfigPtr));
#endif

#if defined(USE_CANTP)
	// Setup CAN TP
	NO_DRIVER(CanTp_Init(ConfigPtr->PostBuildConfig->CanTp_ConfigPtr));
#endif

#if defined(USE_CANSM)
	NO_DRIVER(CanSM_Init(ConfigPtr->CanSMConfig));
#endif

#if defined(USE_J1939TP)
	// Setup J1939Tp
	NO_DRIVER(J1939Tp_Init(ConfigPtr->J1939TpConfig));
#endif

	// Setup LIN
	// TODO

#if defined(USE_PDUR)
	// Setup PDU Router
	NO_DRIVER(PduR_Init(ConfigPtr->PostBuildConfig->PduR_ConfigPtr));
#endif

#if defined(USE_CANNM)
    // Setup Can Network Manager
	NO_DRIVER(CanNm_Init(ConfigPtr->PostBuildConfig->CanNm_ConfigPtr));
#endif

#if defined(USE_UDPNM)
        // Setup Udp Network Manager
	NO_DRIVER(UdpNm_Init(ConfigPtr->UdpNmConfig));
#endif

#if defined(USE_NM)
        // Setup Network Management Interface
	NO_DRIVER(Nm_Init());
#endif

#if defined(USE_COM)
	// Setup COM layer
	NO_DRIVER(Com_Init(ConfigPtr->PostBuildConfig->ComConfigurationPtr));
#endif

#if defined(USE_DCM)
	// Setup DCM
	NO_DRIVER(Dcm_Init(ConfigPtr->DcmConfig));
#endif

#if defined(USE_IOHWAB)
	// Setup IO hardware abstraction layer
	IoHwAb_Init();
#endif

}