/* * 函数名:BSP_Init * 描 述:时钟初始化、硬件初始化 * 输 入:无 * 输 出:无 */ void BSP_Init(void) { SystemInit(); /* 配置系统时钟为72M */ BSP_LedInit(); BSP_UsartInit(); BSP_EthernetInit(); BSP_NVICConfiguration(); }
/* ------------------------------------------------------------------------------------------------------ * BSP_Init() * * Description : MCU sysctl init function. * * Argument(s) : none. * */ void BSP_Init(void) { /* If running on Rev A2 silicon, turn the LDO voltage up to 2.75V. This is a workaround to allow the PLL to operate reliably. */ if( DEVICE_IS_REVA2 ) { SysCtlLDOSet( SYSCTL_LDO_2_75V ); } // // Set the clocking to run directly from the crystal. // SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // // Enable the LED. // BSP_LedInit(); // // Enable the peripherals used by this example. // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // // Set GPIO A0 and A1 as UART. // GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Initialize the UART as a console for text I/O. // UARTStdioInit(0); UARTprintf("BSP initialise\n"); }