summaryrefslogtreecommitdiff
path: root/board/discovery-stm32f072
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-07-14 15:33:29 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-17 00:39:52 +0000
commit7746b32e17571b0e0cbdcbd101787b742d35c825 (patch)
tree5b4374d93630dda800996687239aac5cec681dc7 /board/discovery-stm32f072
parent1e73a1ba06b7879de3b03c7cefec9135bf73fcf5 (diff)
downloadchrome-ec-7746b32e17571b0e0cbdcbd101787b742d35c825.tar.gz
GPIO: Move definition of alternate functions to gpio.inc
This is a straightforward conversion of existing tables into X-Macro style definitions for the GPIO alternate functions. This change in itself, is not particularly powerful, but having all GPIO settings in a single file makes a board easier to understand. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=none TEST=make buildall -j Followed by manual testing of interrupt on change and UART functionality on STM32F0 based discovery board. Change-Id: Ib7f1f014f4bd289d7c0ac3100470ba2dc71ca579 Reviewed-on: https://chromium-review.googlesource.com/207987 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'board/discovery-stm32f072')
-rw-r--r--board/discovery-stm32f072/board.c6
-rw-r--r--board/discovery-stm32f072/gpio.inc2
2 files changed, 2 insertions, 6 deletions
diff --git a/board/discovery-stm32f072/board.c b/board/discovery-stm32f072/board.c
index 546b07d8d9..9d736dcaf5 100644
--- a/board/discovery-stm32f072/board.c
+++ b/board/discovery-stm32f072/board.c
@@ -33,9 +33,3 @@ static void board_init(void)
gpio_enable_interrupt(GPIO_USER_BUTTON);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-
-/* Pins with alternate functions */
-const struct gpio_alt_func gpio_alt_funcs[] = {
- {GPIO_A, 0xC000, 1, MODULE_UART}, /* USART2: PA14/PA15 */
-};
-const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs);
diff --git a/board/discovery-stm32f072/gpio.inc b/board/discovery-stm32f072/gpio.inc
index f3e2106452..d0bd0b2f3e 100644
--- a/board/discovery-stm32f072/gpio.inc
+++ b/board/discovery-stm32f072/gpio.inc
@@ -17,3 +17,5 @@ GPIO(LED_R, C, 9, GPIO_OUT_LOW, NULL)
/* Unimplemented signals which we need to emulate for now */
UNIMPLEMENTED(ENTERING_RW)
UNIMPLEMENTED(WP_L)
+
+ALTERNATE(A, 0xC000, 1, MODULE_UART, 0) /* USART2: PA14/PA15 */