#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif
//*****************************************************************************
//
// The UART interrupt handler.
//
//*****************************************************************************
unsigned char ch;
void
UART5IntHandler(void)
{
uint32_t ui32Status;
unsigned char ch;
//
// Get the interrrupt status.
//
ui32Status = ROM_UARTIntStatus(UART5_BASE ,true);
//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART5_BASE, ui32Status);
//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART5_BASE))
{
//
// Read the next character from the UART and write it back to the UART.
ch=ROM_UARTCharGetNonBlocking(UART5_BASE);
ROM_UARTCharPutNonBlocking(UART5_BASE,ch);
}
}
//*****************************************************************************
//
// Send a string to the UART.
//
//*****************************************************************************
void
UART5Send(const uint8_t *pui8Buffer)
{
int i;
//
// Loop while there are more characters to send.
//
while(*pui8Buffer)
{
//
// Write the next character to the UART.
//
ROM_UARTCharPutNonBlocking(UART5_BASE,*pui8Buffer++);
for(i=0;i<1200;i++)
{
}
}
}
//*****************************************************************************
//
// This example demonstrates how to send a string of data to the UART.
//
//*****************************************************************************
int
main(void)
{
//
//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_12MHZ);
// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ROM_UARTClockSourceSet(UART5_BASE,UART_CLOCK_PIOSC);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();
//
// Set GPIO A0 and A1 as UART pins.
//
ROM_GPIOPinConfigure(GPIO_PE4_U5RX);
ROM_GPIOPinConfigure(GPIO_PE5_U5TX);
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_4 | GPIO_PIN_5);
//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART5_BASE,ROM_SysCtlClockGet(),115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
ROM_IntEnable(INT_UART5);
ROM_UARTIntEnable(UART5_BASE, UART_INT_RX | UART_INT_RT);
// //
// // Prompt for text to be entered.
// //
// UART5Send((uint8_t *)"Enter text:welcome to india ");
//
// Loop forever echoing data through the UART.
//
while(1)
{
}
}