Exemple #1
0
void EcuM_Callout_DriverInitListOne(void)
{
  Det_Init();
  Dem_PreInit();
  Mcu_Init(&McuModuleConfiguration_0);
  Mcu_AdditionalInit();
  Mcl_Init(NULL_PTR);
  Port_Init(NULL_PTR);
  Adc_Init(NULL_PTR);
  Dio_Init(NULL_PTR);
  Gpt_Init(NULL_PTR);
  Pwm_Init(NULL_PTR);
  Icu_Init(NULL_PTR);
  Spi_Init(NULL_PTR);
  SpiCtrl_Init();
  SwGpt_Init();
  pIcomInstBle = ICOM_Create();
  ICOMChannelStatus_Init(pIcomInstBle);
  ICOMChannelDiag_Init(pIcomInstBle);
  ExtFlashSpiCtrlInit(SpiConf_SpiChannel_Spi_NVM_Command,\
                      SpiConf_SpiSequence_Spi_Seq_NVM,\
                      SpiConf_SpiJob_Spi_Job_NVM);
  CC254xCDD_Init(pIcomInstBle, 
                 DioConf_DioChannel_B6_SPI_SRDY_CU_LPCPU,\
                 SpiConf_SpiChannel_Spi_TICC2540_Command_8,\
                 SpiConf_SpiSequence_Spi_Seq_Ble_Exchange);
                 
  /* *******************************************************************
   * Wdg must be the latest in the initialization sequence
   * otherwise the function call Spi_SetAsyncMode(SPI_INTERRUPT_MODE)
   * returns a negative response when initializing the CC254xCDD_Init
   *********************************************************************/
  Wdg_Init(NULL_PTR);
  WdgM_Init(NULL_PTR);
  WdgM_SetMode(1U,0U);
  
}
/**
 * Part of STARTUP I
 *
 * @param ConfigPtr
 */
void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)
{
	(void)ConfigPtr;

#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) {
		;
	}

	Mcu_DistributePllClock();
#endif

#if defined(USE_DEM)
	// Preinitialize DEM
	NO_DRIVER(Dem_PreInit(ConfigPtr->DemConfig));
#endif

#if defined(USE_PORT)
	// Setup Port
	Port_Init(ConfigPtr->PortConfig);
#endif

#if defined(USE_DIO)
    // Setup Dio
    Dio_Init(ConfigPtr->DioCfg);
#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)
	NO_DRIVER(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

#if defined(USE_BSWM)
	// Setup BSWM - not supporting configustructure for BswM
	BswM_Init(NULL);
#endif

	// Setup ICU
#if defined(USE_ICU)
     Icu_Init(ConfigPtr->IcuConfig);
#endif

	// Setup PWM
#if defined(USE_PWM)
	// Setup PWM
	Pwm_Init(ConfigPtr->PwmConfig);
#endif

    // Setup OCU
#if defined(USE_OCU)
	 Ocu_Init(ConfigPtr->OcuConfig);
#endif

#if defined(CFG_SHELL)
	SHELL_Init();
#endif
}