boards/opencm904: remap uart pins

This commit is contained in:
Loïc Dauphin 2017-03-09 19:47:13 +01:00
parent d559428cc6
commit 46bac6c69b
3 changed files with 15 additions and 3 deletions

View File

@ -39,4 +39,7 @@ void board_init(void)
/* configure the RIOT vector table location to internal flash + bootloader offset */ /* configure the RIOT vector table location to internal flash + bootloader offset */
SCB->VTOR = LOCATION_VTABLE; SCB->VTOR = LOCATION_VTABLE;
/* remap USART1 to PB7 and PB6 */
AFIO->MAPR |= AFIO_MAPR_USART1_REMAP;
} }

View File

@ -59,6 +59,15 @@ extern "C" {
*/ */
#define BTN_B1_PIN GPIO_PIN(PORT_C, 15) #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 * @brief Use the USART2 for STDIO on this board
*/ */

View File

@ -106,8 +106,8 @@ static const uart_conf_t uart_config[] = {
{ {
.dev = USART1, .dev = USART1,
.rcc_mask = RCC_APB2ENR_USART1EN, .rcc_mask = RCC_APB2ENR_USART1EN,
.rx_pin = GPIO_PIN(PORT_A, 10), .rx_pin = GPIO_PIN(PORT_B, 7),
.tx_pin = GPIO_PIN(PORT_A, 9), .tx_pin = GPIO_PIN(PORT_B, 6),
.bus = APB2, .bus = APB2,
.irqn = USART1_IRQn .irqn = USART1_IRQn
}, },