aboutsummaryrefslogtreecommitdiff
path: root/board/st/stm32f429-discovery
diff options
context:
space:
mode:
authorkunhuahuang2015-04-28 03:01:19 +0800
committerTom Rini2015-05-10 07:29:38 -0400
commit60570df19c7e7bc9f1f10d228bfe1ac2bea52d9b (patch)
treeab5ff6c81127b3c4090755734d780b834c862b43 /board/st/stm32f429-discovery
parent85e5f5b7a7f8d889271f94791606cde62d81d53f (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 'board/st/stm32f429-discovery')
-rw-r--r--board/st/stm32f429-discovery/stm32f429-discovery.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c
index 2c4830f790a..2dd5d935d9e 100644
--- a/board/st/stm32f429-discovery/stm32f429-discovery.c
+++ b/board/st/stm32f429-discovery/stm32f429-discovery.c
@@ -33,21 +33,21 @@ const struct stm32_gpio_ctl gpio_ctl_usart = {
.otype = STM32_GPIO_OTYPE_PP,
.speed = STM32_GPIO_SPEED_50M,
.pupd = STM32_GPIO_PUPD_UP,
- .af = STM32_GPIO_AF7
+ .af = STM32_GPIO_USART
};
-static const struct stm32_gpio_dsc usart1_gpio[] = {
- {STM32_GPIO_PORT_A, STM32_GPIO_PIN_9}, /* TX */
- {STM32_GPIO_PORT_A, STM32_GPIO_PIN_10}, /* RX */
+static const struct stm32_gpio_dsc usart_gpio[] = {
+ {STM32_GPIO_PORT_X, STM32_GPIO_PIN_TX}, /* TX */
+ {STM32_GPIO_PORT_X, STM32_GPIO_PIN_RX}, /* RX */
};
-int uart1_setup_gpio(void)
+int uart_setup_gpio(void)
{
int i;
int rv = 0;
- for (i = 0; i < ARRAY_SIZE(usart1_gpio); i++) {
- rv = stm32_gpio_config(&usart1_gpio[i], &gpio_ctl_usart);
+ for (i = 0; i < ARRAY_SIZE(usart_gpio); i++) {
+ rv = stm32_gpio_config(&usart_gpio[i], &gpio_ctl_usart);
if (rv)
goto out;
}
@@ -272,7 +272,7 @@ int board_early_init_f(void)
{
int res;
- res = uart1_setup_gpio();
+ res = uart_setup_gpio();
if (res)
return res;