diff --git a/boards/nucleo-common/include/arduino_pinmap.h b/boards/nucleo-common/include/arduino_pinmap.h index 16b62106327235c5d9d5610d1b5f36068ee4d959..3d1c98e5289505ef5a2f5b37ffa71b720b533a48 100644 --- a/boards/nucleo-common/include/arduino_pinmap.h +++ b/boards/nucleo-common/include/arduino_pinmap.h @@ -44,9 +44,15 @@ extern "C" { #define ARDUINO_PIN_8 GPIO_PIN(PORT_A, 9) #define ARDUINO_PIN_9 GPIO_PIN(PORT_C, 7) #define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 6) +#ifdef CPU_MODEL_STM32F302R8 +#define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 15) +#define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 14) +#define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 13) /* on-board LED */ +#else #define ARDUINO_PIN_11 GPIO_PIN(PORT_A, 7) #define ARDUINO_PIN_12 GPIO_PIN(PORT_A, 6) #define ARDUINO_PIN_13 GPIO_PIN(PORT_A, 5) /* on-board LED */ +#endif #define ARDUINO_PIN_A0 GPIO_PIN(PORT_C, 0) #define ARDUINO_PIN_A1 GPIO_PIN(PORT_C, 1) diff --git a/boards/nucleo-common/include/board_common.h b/boards/nucleo-common/include/board_common.h index 85fe4ea721c19186ea02fc3897cc7d8177d29b9d..2c5b62b3d0b8e3fbe100a29824b7cadeec8ca7d7 100644 --- a/boards/nucleo-common/include/board_common.h +++ b/boards/nucleo-common/include/board_common.h @@ -23,6 +23,7 @@ #include "cpu.h" #include "periph_conf.h" +#include "arduino_pinmap.h" #ifdef __cplusplus extern "C" { @@ -32,9 +33,13 @@ extern "C" { * @brief LED pin definitions and handlers * @{ */ +#ifdef CPU_MODEL_STM32F302R8 +#define LED0_PIN GPIO_PIN(PORT_B, 13) +#define LED0_MASK (1 << 13) +#else #define LED0_PIN GPIO_PIN(PORT_A, 5) - #define LED0_MASK (1 << 5) +#endif #define LED0_ON (GPIOA->BSRR = LED0_MASK) #define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16)) diff --git a/boards/nucleo-f302/include/board.h b/boards/nucleo-f302/include/board.h index 2fde66d2d6255aa29e23bfc7417fea11f8dc4166..bac65240bac7cdde4f28646c71a845e399476ccd 100755 --- a/boards/nucleo-f302/include/board.h +++ b/boards/nucleo-f302/include/board.h @@ -27,35 +27,10 @@ #include "cpu.h" #include "periph_conf.h" +#include "board_common.h" #ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief LED pin definitions and handlers - * @{ - */ -#define LED0_PIN GPIO_PIN(PORT_B, 13) -#define LED0_MASK (1 << 13) - -#define LED0_ON (GPIOB->BSRR = LED0_MASK) -#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16)) -#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) -/** @} */ - -/** - * @brief User button - */ -#define BTN_B1_PIN GPIO_PIN(PORT_C, 13) - -/** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO - */ -void board_init(void); - -#ifdef __cplusplus -} +extern "C" {} #endif #endif /* BOARD_H */ diff --git a/boards/nucleo32-common/include/board_common.h b/boards/nucleo32-common/include/board_common.h index a72092f038f1e6328f3580531a2311741ea84ba9..ef71de382d6bf44158116811df0b65cfba61be92 100644 --- a/boards/nucleo32-common/include/board_common.h +++ b/boards/nucleo32-common/include/board_common.h @@ -23,6 +23,7 @@ #include "cpu.h" #include "periph_conf.h" +#include "arduino_pinmap.h" #ifdef __cplusplus extern "C" {