就是配置UART0是没有用UARTEnable函数,而在配置ADC、SPI等的时候有对应的这个ADCSequenceEnable、SSIEnable。额,这是为什么???
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
就是配置UART0是没有用UARTEnable函数,而在配置ADC、SPI等的时候有对应的这个ADCSequenceEnable、SSIEnable。额,这是为什么???
在调用这个函数中使能UART
void
UARTConfigSetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk,
uint32_t ui32Baud, uint32_t ui32Config)
{
uint32_t ui32Div;
//
// Check the arguments.
//
ASSERT(_UARTBaseValid(ui32Base));
ASSERT(ui32Baud != 0);
ASSERT(ui32UARTClk >= (ui32Baud * UART_CLK_DIVIDER));
//
// Stop the UART.
//
UARTDisable(ui32Base);
//
// Is the required baud rate greater than the maximum rate supported
// without the use of high speed mode?
//
if((ui32Baud * 16) > ui32UARTClk)
{
//
// Enable high speed mode.
//
HWREG(ui32Base + UART_O_CTL) |= UART_CTL_HSE;
//
// Half the supplied baud rate to compensate for enabling high speed
// mode. This allows the following code to be common to both cases.
//
ui32Baud /= 2;
}
else
{
//
// Disable high speed mode.
//
HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_HSE);
}
//
// Compute the fractional baud rate divider.
//
ui32Div = (((ui32UARTClk * 8) / ui32Baud) + 1) / 2;
//
// Set the baud rate.
//
HWREG(ui32Base + UART_O_IBRD) = ui32Div / 64;
HWREG(ui32Base + UART_O_FBRD) = ui32Div % 64;
//
// Set parity, data length, and number of stop bits.
//
HWREG(ui32Base + UART_O_LCRH) = ui32Config;
//
// Clear the flags register.
//
HWREG(ui32Base + UART_O_FR) = 0;
//
// Start the UART.
//
UARTEnable(ui32Base);
}