Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*****************************************************************************
- //
- // Configure the UART and its pins. This must be called before UARTprintf().
- //
- //*****************************************************************************
- void ConfigureUART(uint32_t ui32SysClock)
- {
- //
- // Enable the GPIO Peripheral used by the UART.
- //
- ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP); // PP0 and PP1
- ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // PA0 and PA1
- //
- // Enable UART6
- //
- ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6);
- //
- // Enable UART0
- //
- ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
- //
- // Configure GPIO Pins for UART mode.
- // UART6 and UART0
- ROM_GPIOPinConfigure(GPIO_PP0_U6RX);
- ROM_GPIOPinConfigure(GPIO_PP1_U6TX);
- ROM_GPIOPinTypeUART(GPIO_PORTP_BASE, GPIO_PIN_0 | GPIO_PIN_1);
- ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
- ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
- ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
- //
- // Use the system clock for the UART.
- //
- UARTClockSourceSet(UART6_BASE, UART_CLOCK_SYSTEM);
- UARTClockSourceSet(UART0_BASE, UART_CLOCK_SYSTEM);
- //
- // Initialize the UART for console I/O.
- //
- //
- UARTStdioConfig(UART6_IDX, 9600, ui32SysClock);
- UARTStdioConfig(UART0_IDX, 115200, ui32SysClock);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement