diff options
author | kunhuahuang <huangkunhua@gmail.com> | 2015-04-28 03:01:19 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-05-10 07:29:38 -0400 |
commit | 60570df19c7e7bc9f1f10d228bfe1ac2bea52d9b (patch) | |
tree | ab5ff6c81127b3c4090755734d780b834c862b43 /arch/arm/include | |
parent | 85e5f5b7a7f8d889271f94791606cde62d81d53f (diff) |
stm32f4: add serial print port
Add the stm32F4 board's serial ports support.
User can use it easily.
The user only need to edit the number of the usart.
The patch also fix the serial print out.
Last, this version of patch fix the first patch checkpatch.pl error.
Thanks to Kamil Lulko.
Signed-off-by: kunhuahuang <huangkunhua@gmail.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/arch-stm32f4/gpio.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-stm32f4/gpio.h b/arch/arm/include/asm/arch-stm32f4/gpio.h index 7cd866ea2a..dd33b96c48 100644 --- a/arch/arm/include/asm/arch-stm32f4/gpio.h +++ b/arch/arm/include/asm/arch-stm32f4/gpio.h @@ -11,6 +11,38 @@ #ifndef _STM32_GPIO_H_ #define _STM32_GPIO_H_ +#if (CONFIG_STM32_USART == 1) +#define STM32_GPIO_PORT_X STM32_GPIO_PORT_A +#define STM32_GPIO_PIN_TX STM32_GPIO_PIN_9 +#define STM32_GPIO_PIN_RX STM32_GPIO_PIN_10 +#define STM32_GPIO_USART STM32_GPIO_AF7 + +#elif (CONFIG_STM32_USART == 2) +#define STM32_GPIO_PORT_X STM32_GPIO_PORT_D +#define STM32_GPIO_PIN_TX STM32_GPIO_PIN_5 +#define STM32_GPIO_PIN_RX STM32_GPIO_PIN_6 +#define STM32_GPIO_USART STM32_GPIO_AF7 + +#elif (CONFIG_STM32_USART == 3) +#define STM32_GPIO_PORT_X STM32_GPIO_PORT_C +#define STM32_GPIO_PIN_TX STM32_GPIO_PIN_10 +#define STM32_GPIO_PIN_RX STM32_GPIO_PIN_11 +#define STM32_GPIO_USART STM32_GPIO_AF7 + +#elif (CONFIG_STM32_USART == 6) +#define STM32_GPIO_PORT_X STM32_GPIO_PORT_G +#define STM32_GPIO_PIN_TX STM32_GPIO_PIN_14 +#define STM32_GPIO_PIN_RX STM32_GPIO_PIN_9 +#define STM32_GPIO_USART STM32_GPIO_AF8 + +#else +#define STM32_GPIO_PORT_X STM32_GPIO_PORT_A +#define STM32_GPIO_PIN_TX STM32_GPIO_PIN_9 +#define STM32_GPIO_PIN_RX STM32_GPIO_PIN_10 +#define STM32_GPIO_USART STM32_GPIO_AF7 + +#endif + enum stm32_gpio_port { STM32_GPIO_PORT_A = 0, STM32_GPIO_PORT_B, |