From 46bac6c69ba091cde4a3589ecd5620845ab8c45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dauphin?= Date: Thu, 9 Mar 2017 19:47:13 +0100 Subject: [PATCH] boards/opencm904: remap uart pins --- boards/opencm904/board.c | 3 +++ boards/opencm904/include/board.h | 11 ++++++++++- boards/opencm904/include/periph_conf.h | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/boards/opencm904/board.c b/boards/opencm904/board.c index f6d2c741c7..c59dc919f8 100644 --- a/boards/opencm904/board.c +++ b/boards/opencm904/board.c @@ -39,4 +39,7 @@ void board_init(void) /* configure the RIOT vector table location to internal flash + bootloader offset */ SCB->VTOR = LOCATION_VTABLE; + + /* remap USART1 to PB7 and PB6 */ + AFIO->MAPR |= AFIO_MAPR_USART1_REMAP; } diff --git a/boards/opencm904/include/board.h b/boards/opencm904/include/board.h index 3fab40867b..00cbae203f 100755 --- a/boards/opencm904/include/board.h +++ b/boards/opencm904/include/board.h @@ -55,10 +55,19 @@ extern "C" { /** @} */ /** - * @brief User button + * @brief User button */ #define BTN_B1_PIN GPIO_PIN(PORT_C, 15) +/** + * @brief Pin used to switch RX and TX mode for the Dynamixel TTL bus + * + * set = TX mode + * clear = RX mode + * + */ +#define DXL_DIR_PIN GPIO_PIN(PORT_B, 5) + /** * @brief Use the USART2 for STDIO on this board */ diff --git a/boards/opencm904/include/periph_conf.h b/boards/opencm904/include/periph_conf.h index 6d8fc5ebe1..321b477d34 100644 --- a/boards/opencm904/include/periph_conf.h +++ b/boards/opencm904/include/periph_conf.h @@ -106,8 +106,8 @@ static const uart_conf_t uart_config[] = { { .dev = USART1, .rcc_mask = RCC_APB2ENR_USART1EN, - .rx_pin = GPIO_PIN(PORT_A, 10), - .tx_pin = GPIO_PIN(PORT_A, 9), + .rx_pin = GPIO_PIN(PORT_B, 7), + .tx_pin = GPIO_PIN(PORT_B, 6), .bus = APB2, .irqn = USART1_IRQn },