提交 fcbc7aa7 编写于 作者: B bernard.xiong

remove interrupt Tx and DMA Rx mode in USART.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@549 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 67faf922
...@@ -66,7 +66,6 @@ void SysTick_Configuration(void) ...@@ -66,7 +66,6 @@ void SysTick_Configuration(void)
} }
#if STM32_EXT_SRAM #if STM32_EXT_SRAM
#define Bank1_SRAM3_ADDR ((u32)0x68000000)
void EXT_SRAM_Configuration(void) void EXT_SRAM_Configuration(void)
{ {
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
...@@ -204,9 +203,9 @@ void rt_hw_board_init() ...@@ -204,9 +203,9 @@ void rt_hw_board_init()
#endif #endif
#define CONSOLE_USART USART2 #define CONSOLE_USART USART2
#elif STM32_CONSOLE_USART == 2 #elif STM32_CONSOLE_USART == 3
#define CONSOLE_RX_PIN GPIO_Pin_11
#define CONSOLE_TX_PIN GPIO_Pin_10 #define CONSOLE_TX_PIN GPIO_Pin_10
#define CONSOLE_RX_PIN GPIO_Pin_11
#define CONSOLE_GPIO GPIOB #define CONSOLE_GPIO GPIOB
#define CONSOLE_USART USART3 #define CONSOLE_USART USART3
#define CONSOLE_RCC RCC_APB1Periph_USART3 #define CONSOLE_RCC RCC_APB1Periph_USART3
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2009-01-05 Bernard the first version * 2009-01-05 Bernard the first version
* 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode
*/ */
#include "usart.h" #include "usart.h"
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
* Use UART1 as console output and finsh input * Use UART1 as console output and finsh input
* interrupt Rx and poll Tx (stream mode) * interrupt Rx and poll Tx (stream mode)
* *
* Use UART2 with DMA Rx and poll Tx -- DMA channel 6 * Use UART2 with interrupt Rx and poll Tx
* Use UART3 with DMA Tx and interrupt Rx -- DMA channel 2 * Use UART3 with DMA Tx and interrupt Rx -- DMA channel 2
* *
* USART DMA setting on STM32 * USART DMA setting on STM32
...@@ -78,13 +79,19 @@ struct rt_device uart3_device; ...@@ -78,13 +79,19 @@ struct rt_device uart3_device;
#define USART3_DR_Base 0x40004804 #define USART3_DR_Base 0x40004804
/* USART1_REMAP = 0 */ /* USART1_REMAP = 0 */
#define UART1_GPIO_TX GPIO_Pin_9 #define UART1_GPIO_TX GPIO_Pin_9
#define UART1_GPIO_RX GPIO_Pin_10 #define UART1_GPIO_RX GPIO_Pin_10
#define UART1_GPIO GPIOA #define UART1_GPIO GPIOA
#define RCC_APBPeriph_UART1 RCC_APB2Periph_USART1 #define RCC_APBPeriph_UART1 RCC_APB2Periph_USART1
#define UART1_TX_DMA DMA1_Channel4 #define UART1_TX_DMA DMA1_Channel4
#define UART1_RX_DMA DMA1_Channel5 #define UART1_RX_DMA DMA1_Channel5
#if defined(STM32F10X_LD) || defined(STM32F10X_MD) || defined(STM32F10X_CL)
#define UART2_GPIO_TX GPIO_Pin_5
#define UART2_GPIO_RX GPIO_Pin_6
#define UART2_GPIO GPIOD
#define RCC_APBPeriph_UART2 RCC_APB1Periph_USART2
#else /* for STM32F10X_HD */
/* USART2_REMAP = 0 */ /* USART2_REMAP = 0 */
#define UART2_GPIO_TX GPIO_Pin_2 #define UART2_GPIO_TX GPIO_Pin_2
#define UART2_GPIO_RX GPIO_Pin_3 #define UART2_GPIO_RX GPIO_Pin_3
...@@ -92,6 +99,7 @@ struct rt_device uart3_device; ...@@ -92,6 +99,7 @@ struct rt_device uart3_device;
#define RCC_APBPeriph_UART2 RCC_APB1Periph_USART2 #define RCC_APBPeriph_UART2 RCC_APB1Periph_USART2
#define UART2_TX_DMA DMA1_Channel7 #define UART2_TX_DMA DMA1_Channel7
#define UART2_RX_DMA DMA1_Channel6 #define UART2_RX_DMA DMA1_Channel6
#endif
/* USART3_REMAP[1:0] = 00 */ /* USART3_REMAP[1:0] = 00 */
#define UART3_GPIO_RX GPIO_Pin_11 #define UART3_GPIO_RX GPIO_Pin_11
...@@ -123,7 +131,7 @@ static void RCC_Configuration(void) ...@@ -123,7 +131,7 @@ static void RCC_Configuration(void)
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE);
#endif #endif
#if defined (RT_USING_UART2) || defined (RT_USING_UART3) #if defined (RT_USING_UART3)
/* DMA clock enable */ /* DMA clock enable */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册