Skip to content
Snippets Groups Projects
Commit e9e9656e authored by Sebastian Meiling's avatar Sebastian Meiling Committed by GitHub
Browse files

Merge pull request #6795 from aabadie/fix_nucleo_arduino

boards/nucleo: include arduino pinmap in board definitions
parents 20d5c3ee 3798472e
No related branches found
No related tags found
No related merge requests found
...@@ -44,9 +44,15 @@ extern "C" { ...@@ -44,9 +44,15 @@ extern "C" {
#define ARDUINO_PIN_8 GPIO_PIN(PORT_A, 9) #define ARDUINO_PIN_8 GPIO_PIN(PORT_A, 9)
#define ARDUINO_PIN_9 GPIO_PIN(PORT_C, 7) #define ARDUINO_PIN_9 GPIO_PIN(PORT_C, 7)
#define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 6) #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_11 GPIO_PIN(PORT_A, 7)
#define ARDUINO_PIN_12 GPIO_PIN(PORT_A, 6) #define ARDUINO_PIN_12 GPIO_PIN(PORT_A, 6)
#define ARDUINO_PIN_13 GPIO_PIN(PORT_A, 5) /* on-board LED */ #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_A0 GPIO_PIN(PORT_C, 0)
#define ARDUINO_PIN_A1 GPIO_PIN(PORT_C, 1) #define ARDUINO_PIN_A1 GPIO_PIN(PORT_C, 1)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "cpu.h" #include "cpu.h"
#include "periph_conf.h" #include "periph_conf.h"
#include "arduino_pinmap.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -32,9 +33,13 @@ extern "C" { ...@@ -32,9 +33,13 @@ extern "C" {
* @brief LED pin definitions and handlers * @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_PIN GPIO_PIN(PORT_A, 5)
#define LED0_MASK (1 << 5) #define LED0_MASK (1 << 5)
#endif
#define LED0_ON (GPIOA->BSRR = LED0_MASK) #define LED0_ON (GPIOA->BSRR = LED0_MASK)
#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16)) #define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
......
...@@ -27,35 +27,10 @@ ...@@ -27,35 +27,10 @@
#include "cpu.h" #include "cpu.h"
#include "periph_conf.h" #include "periph_conf.h"
#include "board_common.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { 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
}
#endif #endif
#endif /* BOARD_H */ #endif /* BOARD_H */
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "cpu.h" #include "cpu.h"
#include "periph_conf.h" #include "periph_conf.h"
#include "arduino_pinmap.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment