mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Correct several errors in STM32 serial port configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3744 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -162,9 +162,9 @@
|
|||||||
|
|
||||||
#define STM32_USARTDIV32 (STM32_APBCLOCK / (STM32_CONSOLE_BAUD >> 1))
|
#define STM32_USARTDIV32 (STM32_APBCLOCK / (STM32_CONSOLE_BAUD >> 1))
|
||||||
|
|
||||||
/* The mantissa is then usartdiv32 * 32:
|
/* The mantissa is then usartdiv32 / 32:
|
||||||
*
|
*
|
||||||
* mantissa = 32 * usartdiv32
|
* mantissa = usartdiv32 / 32/
|
||||||
*
|
*
|
||||||
* Eg. usartdiv32=1250, mantissa = 39
|
* Eg. usartdiv32=1250, mantissa = 39
|
||||||
*/
|
*/
|
||||||
@@ -247,7 +247,7 @@ void stm32_lowsetup(void)
|
|||||||
uint32_t cr;
|
uint32_t cr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable the selected USARTs and configure GPIO pins need byed the
|
/* Enable the selected USARTs and configure GPIO pins need by the
|
||||||
* the selected USARTs. NOTE: The serial driver later depends on
|
* the selected USARTs. NOTE: The serial driver later depends on
|
||||||
* this pin configuration -- whether or not a serial console is selected.
|
* this pin configuration -- whether or not a serial console is selected.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -425,8 +425,8 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
|
|||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
uint32_t uartdiv32;
|
uint32_t usartdiv32;
|
||||||
uint32_t mantissa;
|
uint32_t mantissa;
|
||||||
uint32_t fraction;
|
uint32_t fraction;
|
||||||
uint32_t brr;
|
uint32_t brr;
|
||||||
@@ -483,7 +483,7 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
/* Configure hardware flow control -- Not yet supported */
|
/* Configure hardware flow control -- Not yet supported */
|
||||||
|
|
||||||
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
up_serialout(priv, STM32_USART_CR3_OFFSET, regval);
|
||||||
|
|
||||||
/* Configure the USART Baud Rate. The baud rate for the receiver and
|
/* Configure the USART Baud Rate. The baud rate for the receiver and
|
||||||
* transmitter (Rx and Tx) are both set to the same value as programmed
|
* transmitter (Rx and Tx) are both set to the same value as programmed
|
||||||
@@ -521,7 +521,7 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up the cache interrupt enables value */
|
/* Set up the cached interrupt enables value */
|
||||||
|
|
||||||
priv->ie = 0;
|
priv->ie = 0;
|
||||||
return OK;
|
return OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user