void platform_early_init(void) { /* set up clocking for a board with an external oscillator */ Chip_SetupXtalClocking(); /* Set USB PLL input to main oscillator */ Chip_Clock_SetUSBPLLSource(SYSCTL_PLLCLKSRC_MAINOSC); /* Setup USB PLL (FCLKIN = 12MHz) * 4 = 48MHz MSEL = 3 (this is pre-decremented), PSEL = 1 (for P = 2) FCLKOUT = FCLKIN * (MSEL + 1) = 12MHz * 4 = 48MHz FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */ Chip_Clock_SetupUSBPLL(3, 1); /* Powerup USB PLL */ Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPLL_PD); /* Wait for PLL to lock */ while (!Chip_Clock_IsUSBPLLLocked()) {} /* Set default system tick divder to 1 */ Chip_Clock_SetSysTickClockDiv(1); /* start the generic systick driver */ arm_cm_systick_init(Chip_Clock_GetMainClockRate()); lpc_debug_early_init(); }
static void initHardware(void) { Chip_SetupXtalClocking(); Chip_SYSCTL_SetFLASHAccess(FLASHTIM_100MHZ_CPU); SystemCoreClockUpdate(); /*====================[PARA MODULO RF]====================*/ Chip_GPIO_WriteDirBit(LPC_GPIO, CE_PIN, 1); //Puerto CE Chip_GPIO_SetPinOutLow(LPC_GPIO, CE_PIN); //Puerto CE InitSPI (); begin(); setPALevel(RF24_PA_LOW); openWritingPipe(&addresses2[0]); openReadingPipe(1,&addresses1[0]); //1Node: Transmite paquetes el tx por este pide (addres) startListening(); /*========================================================*/ // Board_Init(); // Board_LED_Set(0, false); SysTick_Config(SystemCoreClock/1000); //1000 ticks por segundo InitPWM_motores(0); //Función inicialización modulo PWM InitPWM_motores(1); //Función inicialización modulo PWM InitPWM_motores(2); //Función inicialización modulo PWM InitPWM_motores(3); //Función inicialización modulo PWM InitPWM0(); InitGPIO(0); //Llamo función para inicializar GPIO InitGPIO(1); //Llamo función para inicializar GPIO InitGPIO(2); //Llamo función para inicializar GPIO InitGPIO(3); //Llamo función para inicializar GPIO Stop_and_Default(0); //Condiciones iniciales Stop_and_Default(1); //Condiciones iniciales Stop_and_Default(2); //Condiciones iniciales Stop_and_Default(3); //Condiciones iniciales P2_6ER = 1; P2_7ER = 1; P2_8ER = 1; P2_6EF = 1; P2_7EF = 1; P2_8EF = 1; P0_15ER = 1; P0_16ER = 1; P2_9ER = 1; P0_15EF = 1; P0_16EF = 1; P2_9EF = 1; NVIC_SetPriority(EINT3_IRQn,1); //Le pongo la mayor prioridad a la interrupcion NVIC_EnableIRQ(EINT3_IRQn); }
/* Set up and initialize hardware prior to call to main */ void Board_SystemInit(void) { /* Setup system clocking and memory. This is done early to allow the application and tools to clear memory and use scatter loading to external memory. */ Board_SetupMuxing(); Chip_SetupXtalClocking(); }
void InitHardware(void) { Chip_SetupXtalClocking(); Chip_SYSCTL_SetFLASHAccess(FLASHTIM_100MHZ_CPU); SystemCoreClockUpdate(); InitI2C(); SysTick_Config(SystemCoreClock/1000); }
/* Set up and initialize hardware prior to call to main */ void Chip_SystemInit(void) { /* Setup Chip clocking */ //Chip_SetupIrcClocking(); Chip_SetupXtalClocking(); }
/* Set up and initialize hardware prior to call to main */ void Chip_SystemInit(void) { Chip_SetupXtalClocking(); }
/* Set up and initialize hardware prior to call to main */ void Chip_SystemInit(void) { /* Initial internal clocking */ // Chip_SetupIrcClocking(); Chip_SetupXtalClocking(); }
/* Set up and initialize clocking prior to call to main */ void Board_SetupClocking(void) { Chip_SetupXtalClocking(); }