|
但是不会改debug.c中这一段代码啊,希望前辈指导指导
void OEMInitDebugSerial(void)
{
volatile UART1reg *s2410UART1 = (UART1reg *)UART0_BASE;
volatile IOPreg *s2410IOP = (IOPreg *)IOP_BASE;
// UART1 (TXD1 & RXD1) used for debug serial.
//
// Configure port H for UART.
//
s2410IOP->rGPHCON &= ~((3 < < 4) | (3 < < 6)); // Configure GPH2 and GHP3 for UART1 Tx and Rx, respectively.
s2410IOP->rGPHCON |= ((2 < < 4) | (2 < < 6)); //
s2410IOP->rGPHUP |= (1 < < 2) | (1 < < 3); // Disable pull-up on TXD1 and RXD1.
// Configure UART.
//
s2410UART1->rUFCON = 0x0; // Disable the FIFO (TODO: do we need to enable the FIFO?)
s2410UART1->rUMCON = 0x0; // Disable AFC.
s2410UART1->rULCON = 0x3; // Normal mode, N81.
s2410UART1->rUCON = 0x245; // Rx pulse interrupt, Tx level interrupt, Rx error status interrupt enabled.
s2410UART1->rUBRDIV = ( (int)(S2410PCLK/16.0/UART1BaudRate + 0.5) -1 ); // Set up baudrate (38400).
} |
|