//-----------------------Public functions------------------------------// void InitializeSharp() { //-------------HARDWARE-------------// InitializeRCC( DriverSelectSharp ); InitializeGPIO( DriverSelectSharp ); InitializeADC( DriverSelectSharp ); //-------------SOFTWARE-------------// priv_MeanBufferInitialize(); oSharp.Perform = pub_Perform; }
//-----------------------Public functions------------------------------// void InitializeBattery() { //-------------HARDWARE-------------// InitializeRCC( DriverSelectBattery ); InitializeGPIO( DriverSelectBattery ); InitializeADC( DriverSelectBattery ); //-------------SOFTWARE-------------// priv_MeanBufferInitialize(); oBattery.Perform = pub_Perform; oBattery.AdjustPwm = pub_AdjustPwm; oBattery.IsDischarged = pub_IsDischarged; }
// The following function sets up the LM4F to use RASLib void InitializeMCU(void) { // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. FPULazyStackingEnable(); // Set the clocking to run from PLL, using external oscillator SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); //Initialize System Timer InitializeSystemTime(); //Initialize GPIO Interrupt Handlers InitializeGPIO(); //Initialize UART for communication InitializeUART(115200); //Enable global interrupts IntMasterEnable(); }
//------------------------------------------------------------------------------ // // Function: OEMInit // // This is Windows CE OAL initialization function. It is called from kernel // after basic initialization is made. // void OEMInit() { UINT32 logMask_Backup; extern DWORD CEProcessorType; // From nkarm.h in the private tree. //volatile S3C6410_VIC_REG *pIntr = (S3C6410_VIC_REG*)OALPAtoVA(S3C6410_BASE_REG_PA_VIC0, FALSE); //NKForceCleanBoot(); OALMSG(OAL_FUNC, (L"[OAL] ++OEMInit()\r\n")); OALMSG(TRUE, (L"[OAL] ++OEMInit()\r\n")); OALMSG(OAL_FUNC, ((L"[OAL] APLLCLK : %d\n\r"), System_GetAPLLCLK())); OALMSG(OAL_FUNC, ((L"[OAL] ARMCLK : %d\n\r"), System_GetARMCLK())); OALMSG(OAL_FUNC, ((L"[OAL] HCLK : %d\n\r"), System_GetHCLK())); OALMSG(OAL_FUNC, ((L"[OAL] PCLK : %d\n\r"), System_GetPCLK())); g_oalIoCtlClockSpeed = System_GetARMCLK(); // Lie about the Processor Type (we do this so that the visual C tools work) CEProcessorType = PROCESSOR_STRONGARM; logMask_Backup = g_oalLogMask; OALLogSetZones( (1<<OAL_LOG_ERROR) | (1<<OAL_LOG_WARN) | (1<<OAL_LOG_FUNC) ); RETAILMSG(TRUE, (TEXT("CEProcessorType = 0x%x\r\n"),CEProcessorType)); RETAILMSG(TRUE, (TEXT("APLLCLK: %d, FCLK: %d, HCLK: %d, PCLK: %d\r\n"), System_GetAPLLCLK(), System_GetARMCLK(), System_GetHCLK(), System_GetPCLK())); // Set memory size for DrWatson kernel support if (dwOEMDrWatsonSize != NOT_FIXEDUP) { dwNKDrWatsonSize = dwOEMDrWatsonSize; // set size of reserved memory for Watson dump } // Intialize optional kernel functions. (Processor Extended Feature) // pOEMIsProcessorFeaturePresent = OALIsProcessorFeaturePresent; // Set OEMSetMemoryAttributes function pfnOEMSetMemoryAttributes = OEMSetMemoryAttributes; // Turn Off all Debug LED // OEMWriteDebugLED(0, 0x0); // Initialize INFORM SFR // This function should be called for CPU Identification. InitializeINFORMSFR(); // Initialize Clock Source // InitializeCLKSource(); // Initialize Clock Gating // InitializeCLKGating(); // Initialize Block Power // InitializeBlockPower(); // Initialize OTG PHY Clock // InitializeOTGCLK(); // Initilize cache globals OALCacheGlobalsInit(); OALLogSerial( L"DCache: %d sets, %d ways, %d line size, %d size\r\n", g_oalCacheInfo.L1DSetsPerWay, g_oalCacheInfo.L1DNumWays, g_oalCacheInfo.L1DLineSize, g_oalCacheInfo.L1DSize ); OALLogSerial( L"ICache: %d sets, %d ways, %d line size, %d size\r\n", g_oalCacheInfo.L1ISetsPerWay, g_oalCacheInfo.L1INumWays, g_oalCacheInfo.L1ILineSize, g_oalCacheInfo.L1ISize ); // Initialize Interrupts // if (!OALIntrInit()) { OALMSG(OAL_ERROR, (L"[OAL:ERR] OEMInit() : failed to initialize interrupts\r\n")); } // Initialize system clock OALTimerInit(RESCHED_PERIOD, OEM_COUNT_1MS, 0); // Initialize GPIO // InitializeGPIO(); // Initialize the KITL connection if required RETAILMSG(1, (TEXT("OALKitlStart() \n\r"))); OALKitlStart(); Init_BspArgs(); OALMSG(OAL_FUNC, (L"-OEMInit\r\n")); OALLogSetZones(logMask_Backup); }
void InitializeLedEye() { InitializeRCC(DriverSelectLedEye); InitializeGPIO(DriverSelectLedEye); }
void InitializeLed14() { InitializeRCC(DriverSelectLed14); InitializeGPIO(DriverSelectLed14); }
//-----------------------Public functions------------------------------// void InitializeLedNucleo() { InitializeRCC(DriverSelectLedNucleo); InitializeGPIO(DriverSelectLedNucleo); }