diff --git a/boards/alientek-pandora/include/board.h b/boards/alientek-pandora/include/board.h index 76284c8287..90032b7bf1 100644 --- a/boards/alientek-pandora/include/board.h +++ b/boards/alientek-pandora/include/board.h @@ -32,12 +32,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 7 +#define LED0_PORT GPIO_PORT_E /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_E #define LED1_PIN_NUM 8 +#define LED1_PORT GPIO_PORT_E /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_E #define LED2_PIN_NUM 9 +#define LED2_PORT GPIO_PORT_E /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_E /** @} */ diff --git a/boards/b-l072z-lrwan1/include/board.h b/boards/b-l072z-lrwan1/include/board.h index ed2868be97..0e2392771a 100644 --- a/boards/b-l072z-lrwan1/include/board.h +++ b/boards/b-l072z-lrwan1/include/board.h @@ -55,15 +55,19 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 5 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B #define LED2_PIN_NUM 6 +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B #define LED3_PIN_NUM 7 +#define LED3_PORT GPIO_PORT_B /**< GPIO port of LED 3 */ #define LED3_PORT_NUM PORT_B /** @} */ diff --git a/boards/b-l475e-iot01a/include/board.h b/boards/b-l475e-iot01a/include/board.h index a0aecf0b57..43f6c38e79 100644 --- a/boards/b-l475e-iot01a/include/board.h +++ b/boards/b-l475e-iot01a/include/board.h @@ -32,9 +32,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 14 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B /** @} */ diff --git a/boards/b-u585i-iot02a/include/board.h b/boards/b-u585i-iot02a/include/board.h index bcfc76ec62..51b384a1dd 100644 --- a/boards/b-u585i-iot02a/include/board.h +++ b/boards/b-u585i-iot02a/include/board.h @@ -32,12 +32,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_E /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_E #define LED1_PIN_NUM 6 +#define LED1_PORT GPIO_PORT_H /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_H #define LED2_PIN_NUM 7 +#define LED2_PORT GPIO_PORT_H /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_H /** @} */ diff --git a/boards/blackpill-stm32f103c8/include/board.h b/boards/blackpill-stm32f103c8/include/board.h index 55a3918969..8fad855e3f 100644 --- a/boards/blackpill-stm32f103c8/include/board.h +++ b/boards/blackpill-stm32f103c8/include/board.h @@ -35,6 +35,7 @@ extern "C" { * @name Macros for controlling the on-board LED. * @{ */ +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /**< GPIO Port number the LED is connected to */ #define LED0_PIN_NUM 12 /**< Pin number the LED is connected to */ /** @} */ diff --git a/boards/blackpill-stm32f103cb/include/board.h b/boards/blackpill-stm32f103cb/include/board.h index 11f5b57eba..6f1b1962a5 100644 --- a/boards/blackpill-stm32f103cb/include/board.h +++ b/boards/blackpill-stm32f103cb/include/board.h @@ -35,6 +35,7 @@ extern "C" { * @name Macros for controlling the on-board LED. * @{ */ +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /**< GPIO Port number the LED is connected to */ #define LED0_PIN_NUM (12) /**< Pin number the LED is connected to */ /** @} */ diff --git a/boards/bluepill-stm32f030c8/include/board.h b/boards/bluepill-stm32f030c8/include/board.h index ea01deb911..5c96d63abe 100644 --- a/boards/bluepill-stm32f030c8/include/board.h +++ b/boards/bluepill-stm32f030c8/include/board.h @@ -40,6 +40,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C #define LED0_IS_INVERTED 1 /** @} */ diff --git a/boards/common/blxxxpill/include/board_common.h b/boards/common/blxxxpill/include/board_common.h index cf10b02003..d9c79dd786 100644 --- a/boards/common/blxxxpill/include/board_common.h +++ b/boards/common/blxxxpill/include/board_common.h @@ -33,6 +33,7 @@ extern "C" { * @{ */ #ifndef LED0_PORT_NUM +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C /**< GPIO Port number the LED is connected to */ #endif #ifndef LED0_PIN_NUM diff --git a/boards/common/iotlab/include/board_common.h b/boards/common/iotlab/include/board_common.h index 21bfb3d07a..b6a7039502 100644 --- a/boards/common/iotlab/include/board_common.h +++ b/boards/common/iotlab/include/board_common.h @@ -78,12 +78,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 2 +#define LED0_PORT GPIO_PORT_D /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_D #define LED1_PIN_NUM 5 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B #define LED2_PIN_NUM 10 +#define LED2_PORT GPIO_PORT_C /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_C /** @} */ diff --git a/boards/common/nucleo144/include/board.h b/boards/common/nucleo144/include/board.h index 4c249b8684..b79562d3e4 100644 --- a/boards/common/nucleo144/include/board.h +++ b/boards/common/nucleo144/include/board.h @@ -40,23 +40,29 @@ extern "C" { #if defined(CPU_MODEL_STM32L496ZG) || defined(CPU_MODEL_STM32L4R5ZI) || \ defined(CPU_MODEL_STM32L552ZE) || defined(CPU_MODEL_STM32U575ZI) #define LED0_PIN_NUM 7 +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C #else #define LED0_PIN_NUM 0 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #endif #define LED1_PIN_NUM 7 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B #if defined(CPU_MODEL_STM32L552ZE) #define LED2_PIN_NUM 9 +#define LED2_PORT GPIO_PORT_A /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_A #elif defined(CPU_MODEL_STM32U575ZI) #define LED2_PIN_NUM 2 +#define LED2_PORT GPIO_PORT_G /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_G #else #define LED2_PIN_NUM 14 +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B #endif /** @} */ diff --git a/boards/common/nucleo32/include/board.h b/boards/common/nucleo32/include/board.h index b15f59c65c..5cc6cd65f9 100644 --- a/boards/common/nucleo32/include/board.h +++ b/boards/common/nucleo32/include/board.h @@ -34,6 +34,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 3 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /** @} */ diff --git a/boards/common/nucleo64/include/board.h b/boards/common/nucleo64/include/board.h index 7aedd553e6..46de2d26a6 100644 --- a/boards/common/nucleo64/include/board.h +++ b/boards/common/nucleo64/include/board.h @@ -36,9 +36,11 @@ extern "C" { */ #if defined(CPU_MODEL_STM32F302R8) || defined(CPU_MODEL_STM32L433RC) #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #else #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #endif /** @} */ diff --git a/boards/common/stm32/include/stm32_leds.h b/boards/common/stm32/include/stm32_leds.h index 9c243d178b..865f161c2b 100644 --- a/boards/common/stm32/include/stm32_leds.h +++ b/boards/common/stm32/include/stm32_leds.h @@ -16,16 +16,17 @@ * * @author Marian Buschsieweke * - * This idea is that STM32 boards only define the pin and port number of LEDs - * and this header provides the rest of the defines + * The idea is that STM32 boards only define the pin number, port number and + * port of LEDs and this header provides the rest of the defines */ #ifndef STM32_LEDS_H #define STM32_LEDS_H -/* Using gpio_ll_arch for the gpio_port() function. This even works when - * GPIO LL is not in used */ -#include "gpio_ll_arch.h" +/* Using gpio_ll_arch for GPIO access. On STM32, accessing the GPIO output + * buffer via GPIO LL even works when the GPIO LL feature/module is not in + * use */ +#include "periph/gpio_ll.h" #include "kernel_defines.h" #ifdef __cplusplus @@ -37,115 +38,107 @@ extern "C" { * @{ */ #if defined(LED0_PORT_NUM) && defined (LED0_PIN_NUM) -# define LED0_PORT ((GPIO_TypeDef *)gpio_port(LED0_PORT_NUM)) -# define LED0_PIN GPIO_PIN(LED0_PORT_NUM, LED0_PIN_NUM) -# define LED0_MASK (1 << LED0_PIN_NUM) +# define LED0_PIN GPIO_PIN(LED0_PORT_NUM, LED0_PIN_NUM) +# define LED0_MASK (1 << LED0_PIN_NUM) # if IS_ACTIVE(LED0_IS_INVERTED) -# define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16)) -# define LED0_OFF (LED0_PORT->BSRR = LED0_MASK) +# define LED0_ON gpio_ll_clear(LED0_PORT, LED0_MASK) +# define LED0_OFF gpio_ll_set(LED0_PORT, LED0_MASK) # else -# define LED0_ON (LED0_PORT->BSRR = LED0_MASK) -# define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16)) +# define LED0_ON gpio_ll_set(LED0_PORT, LED0_MASK) +# define LED0_OFF gpio_ll_clear(LED0_PORT, LED0_MASK) # endif -# define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK) +# define LED0_TOGGLE gpio_ll_toggle(LED0_PORT, LED0_MASK) #endif #if defined(LED1_PORT_NUM) && defined (LED1_PIN_NUM) -# define LED1_PORT ((GPIO_TypeDef *)gpio_port(LED1_PORT_NUM)) -# define LED1_PIN GPIO_PIN(LED1_PORT_NUM, LED1_PIN_NUM) -# define LED1_MASK (1 << LED1_PIN_NUM) +# define LED1_PIN GPIO_PIN(LED1_PORT_NUM, LED1_PIN_NUM) +# define LED1_MASK (1 << LED1_PIN_NUM) # if IS_ACTIVE(LED1_IS_INVERTED) -# define LED1_ON (LED1_PORT->BSRR = (LED1_MASK << 16)) -# define LED1_OFF (LED1_PORT->BSRR = LED1_MASK) +# define LED1_ON gpio_ll_clear(LED1_PORT, LED1_MASK) +# define LED1_OFF gpio_ll_set(LED1_PORT, LED1_MASK) # else -# define LED1_ON (LED1_PORT->BSRR = LED1_MASK) -# define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16)) +# define LED1_ON gpio_ll_set(LED1_PORT, LED1_MASK) +# define LED1_OFF gpio_ll_clear(LED1_PORT, LED1_MASK) # endif -# define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK) +# define LED1_TOGGLE gpio_ll_toggle(LED1_PORT, LED1_MASK) #endif #if defined(LED2_PORT_NUM) && defined (LED2_PIN_NUM) -# define LED2_PORT ((GPIO_TypeDef *)gpio_port(LED2_PORT_NUM)) -# define LED2_PIN GPIO_PIN(LED2_PORT_NUM, LED2_PIN_NUM) -# define LED2_MASK (1 << LED2_PIN_NUM) +# define LED2_PIN GPIO_PIN(LED2_PORT_NUM, LED2_PIN_NUM) +# define LED2_MASK (1 << LED2_PIN_NUM) # if IS_ACTIVE(LED2_IS_INVERTED) -# define LED2_ON (LED2_PORT->BSRR = (LED2_MASK << 16)) -# define LED2_OFF (LED2_PORT->BSRR = LED2_MASK) +# define LED2_ON gpio_ll_clear(LED2_PORT, LED2_MASK) +# define LED2_OFF gpio_ll_set(LED2_PORT, LED2_MASK) # else -# define LED2_ON (LED2_PORT->BSRR = LED2_MASK) -# define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16)) +# define LED2_ON gpio_ll_set(LED2_PORT, LED2_MASK) +# define LED2_OFF gpio_ll_clear(LED2_PORT, LED2_MASK) # endif -# define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK) +# define LED2_TOGGLE gpio_ll_toggle(LED2_PORT, LED2_MASK) #endif #if defined(LED3_PORT_NUM) && defined (LED3_PIN_NUM) -# define LED3_PORT ((GPIO_TypeDef *)gpio_port(LED3_PORT_NUM)) -# define LED3_PIN GPIO_PIN(LED3_PORT_NUM, LED3_PIN_NUM) -# define LED3_MASK (1 << LED3_PIN_NUM) +# define LED3_PIN GPIO_PIN(LED3_PORT_NUM, LED3_PIN_NUM) +# define LED3_MASK (1 << LED3_PIN_NUM) # if IS_ACTIVE(LED3_IS_INVERTED) -# define LED3_ON (LED3_PORT->BSRR = (LED3_MASK << 16)) -# define LED3_OFF (LED3_PORT->BSRR = LED3_MASK) +# define LED3_ON gpio_ll_clear(LED3_PORT, LED3_MASK) +# define LED3_OFF gpio_ll_set(LED3_PORT, LED3_MASK) # else -# define LED3_ON (LED3_PORT->BSRR = LED3_MASK) -# define LED3_OFF (LED3_PORT->BSRR = (LED3_MASK << 16)) +# define LED3_ON gpio_ll_set(LED3_PORT, LED3_MASK) +# define LED3_OFF gpio_ll_clear(LED3_PORT, LED3_MASK) # endif -# define LED3_TOGGLE (LED3_PORT->ODR ^= LED3_MASK) +# define LED3_TOGGLE gpio_ll_toggle(LED3_PORT, LED3_MASK) #endif #if defined(LED4_PORT_NUM) && defined (LED4_PIN_NUM) -# define LED4_PORT ((GPIO_TypeDef *)gpio_port(LED4_PORT_NUM)) -# define LED4_PIN GPIO_PIN(LED4_PORT_NUM, LED4_PIN_NUM) -# define LED4_MASK (1 << LED4_PIN_NUM) +# define LED4_PIN GPIO_PIN(LED4_PORT_NUM, LED4_PIN_NUM) +# define LED4_MASK (1 << LED4_PIN_NUM) # if IS_ACTIVE(LED4_IS_INVERTED) -# define LED4_ON (LED4_PORT->BSRR = (LED4_MASK << 16)) -# define LED4_OFF (LED4_PORT->BSRR = LED4_MASK) +# define LED4_ON gpio_ll_clear(LED4_PORT, LED4_MASK) +# define LED4_OFF gpio_ll_set(LED4_PORT, LED4_MASK) # else -# define LED4_ON (LED4_PORT->BSRR = LED4_MASK) -# define LED4_OFF (LED4_PORT->BSRR = (LED4_MASK << 16)) +# define LED4_ON gpio_ll_set(LED4_PORT, LED4_MASK) +# define LED4_OFF gpio_ll_clear(LED4_PORT, LED4_MASK) # endif -# define LED4_TOGGLE (LED4_PORT->ODR ^= LED4_MASK) +# define LED4_TOGGLE gpio_ll_toggle(LED4_PORT, LED4_MASK) #endif #if defined(LED5_PORT_NUM) && defined (LED5_PIN_NUM) -# define LED5_PORT ((GPIO_TypeDef *)gpio_port(LED5_PORT_NUM)) -# define LED5_PIN GPIO_PIN(LED5_PORT_NUM, LED5_PIN_NUM) -# define LED5_MASK (1 << LED5_PIN_NUM) +# define LED5_PIN GPIO_PIN(LED5_PORT_NUM, LED5_PIN_NUM) +# define LED5_MASK (1 << LED5_PIN_NUM) # if IS_ACTIVE(LED5_IS_INVERTED) -# define LED5_ON (LED5_PORT->BSRR = (LED5_MASK << 16)) -# define LED5_OFF (LED5_PORT->BSRR = LED5_MASK) +# define LED5_ON gpio_ll_clear(LED5_PORT, LED5_MASK) +# define LED5_OFF gpio_ll_set(LED5_PORT, LED5_MASK) # else -# define LED5_ON (LED5_PORT->BSRR = LED5_MASK) -# define LED5_OFF (LED5_PORT->BSRR = (LED5_MASK << 16)) +# define LED5_ON gpio_ll_set(LED5_PORT, LED5_MASK) +# define LED5_OFF gpio_ll_clear(LED5_PORT, LED5_MASK) # endif -# define LED5_TOGGLE (LED5_PORT->ODR ^= LED5_MASK) +# define LED5_TOGGLE gpio_ll_toggle(LED5_PORT, LED5_MASK) #endif #if defined(LED6_PORT_NUM) && defined (LED6_PIN_NUM) -# define LED6_PORT ((GPIO_TypeDef *)gpio_port(LED6_PORT_NUM)) -# define LED6_PIN GPIO_PIN(LED6_PORT_NUM, LED6_PIN_NUM) -# define LED6_MASK (1 << LED6_PIN_NUM) +# define LED6_PIN GPIO_PIN(LED6_PORT_NUM, LED6_PIN_NUM) +# define LED6_MASK (1 << LED6_PIN_NUM) # if IS_ACTIVE(LED6_IS_INVERTED) -# define LED6_ON (LED6_PORT->BSRR = (LED6_MASK << 16)) -# define LED6_OFF (LED6_PORT->BSRR = LED6_MASK) +# define LED6_ON gpio_ll_clear(LED6_PORT, LED6_MASK) +# define LED6_OFF gpio_ll_set(LED6_PORT, LED6_MASK) # else -# define LED6_ON (LED6_PORT->BSRR = LED6_MASK) -# define LED6_OFF (LED6_PORT->BSRR = (LED6_MASK << 16)) +# define LED6_ON gpio_ll_set(LED6_PORT, LED6_MASK) +# define LED6_OFF gpio_ll_clear(LED6_PORT, LED6_MASK) # endif -# define LED6_TOGGLE (LED6_PORT->ODR ^= LED6_MASK) +# define LED6_TOGGLE gpio_ll_toggle(LED6_PORT, LED6_MASK) #endif #if defined(LED7_PORT_NUM) && defined (LED7_PIN_NUM) -# define LED7_PORT ((GPIO_TypeDef *)gpio_port(LED7_PORT_NUM)) -# define LED7_PIN GPIO_PIN(LED7_PORT_NUM, LED7_PIN_NUM) -# define LED7_MASK (1 << LED7_PIN_NUM) +# define LED7_PIN GPIO_PIN(LED7_PORT_NUM, LED7_PIN_NUM) +# define LED7_MASK (1 << LED7_PIN_NUM) # if IS_ACTIVE(LED7_IS_INVERTED) -# define LED7_ON (LED7_PORT->BSRR = (LED7_MASK << 16)) -# define LED7_OFF (LED7_PORT->BSRR = LED7_MASK) +# define LED7_ON gpio_ll_clear(LED7_PORT, LED7_MASK) +# define LED7_OFF gpio_ll_set(LED7_PORT, LED7_MASK) # else -# define LED7_ON (LED7_PORT->BSRR = LED7_MASK) -# define LED7_OFF (LED7_PORT->BSRR = (LED7_MASK << 16)) +# define LED7_ON gpio_ll_set(LED7_PORT, LED7_MASK) +# define LED7_OFF gpio_ll_clear(LED7_PORT, LED7_MASK) # endif -# define LED7_TOGGLE (LED7_PORT->ODR ^= LED7_MASK) +# define LED7_TOGGLE gpio_ll_toggle(LED7_PORT, LED7_MASK) #endif /** @} */ diff --git a/boards/common/weact-f4x1cx/include/board.h b/boards/common/weact-f4x1cx/include/board.h index eeb4b8a109..d77f0c3c7b 100644 --- a/boards/common/weact-f4x1cx/include/board.h +++ b/boards/common/weact-f4x1cx/include/board.h @@ -40,6 +40,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C #define LED0_IS_INVERTED 1 /** @} */ diff --git a/boards/f4vi1/include/board.h b/boards/f4vi1/include/board.h index 7b84a45af3..0409202ffa 100644 --- a/boards/f4vi1/include/board.h +++ b/boards/f4vi1/include/board.h @@ -32,12 +32,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 1 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 3 +#define LED1_PORT GPIO_PORT_A /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_A #define LED2_PIN_NUM 2 +#define LED2_PORT GPIO_PORT_A /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_A /** @} */ diff --git a/boards/limifrog-v1/include/board.h b/boards/limifrog-v1/include/board.h index ebca70c1f8..d16d364de6 100644 --- a/boards/limifrog-v1/include/board.h +++ b/boards/limifrog-v1/include/board.h @@ -33,6 +33,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 3 +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C /** @} */ diff --git a/boards/lobaro-lorabox/include/board.h b/boards/lobaro-lorabox/include/board.h index 23f2b1f5d2..0794927666 100644 --- a/boards/lobaro-lorabox/include/board.h +++ b/boards/lobaro-lorabox/include/board.h @@ -38,6 +38,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 1 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED0_IS_INVERTED 1 diff --git a/boards/lora-e5-dev/include/board.h b/boards/lora-e5-dev/include/board.h index 66dae373cb..242d80fddd 100644 --- a/boards/lora-e5-dev/include/board.h +++ b/boards/lora-e5-dev/include/board.h @@ -46,6 +46,7 @@ extern void lora_e5_dev_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_mo * @name LED pin definitions and handlers * @{ */ +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #define LED0_PIN_NUM 5 /** @} */ diff --git a/boards/maple-mini/include/board.h b/boards/maple-mini/include/board.h index 237c5fae5d..bfd50236b2 100644 --- a/boards/maple-mini/include/board.h +++ b/boards/maple-mini/include/board.h @@ -37,6 +37,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 1 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /** @} */ diff --git a/boards/msbiot/include/board.h b/boards/msbiot/include/board.h index 493bc745bd..93ff8a5091 100644 --- a/boards/msbiot/include/board.h +++ b/boards/msbiot/include/board.h @@ -49,12 +49,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 8 /**< Pin number of red LED */ +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /**< Port number of red LED */ #define LED1_PIN_NUM 14 /**< Pin number of yellow LED */ +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B /**< Port number of yellow LED */ #define LED2_PIN_NUM 15 /**< Pin number of green LED */ +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B /**< Port number of green LED */ /** @} */ diff --git a/boards/nucleo-wl55jc/include/board.h b/boards/nucleo-wl55jc/include/board.h index 98be19149a..2bf5f4b93d 100644 --- a/boards/nucleo-wl55jc/include/board.h +++ b/boards/nucleo-wl55jc/include/board.h @@ -49,12 +49,15 @@ extern void nucleo_wl55jc_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_ * @{ */ #define LED0_PIN_NUM 15 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #define LED1_PIN_NUM 9 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B #define LED2_PIN_NUM 11 +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B /** @} */ diff --git a/boards/nz32-sc151/include/board.h b/boards/nz32-sc151/include/board.h index 943e8c5f4d..b47be64ee6 100644 --- a/boards/nz32-sc151/include/board.h +++ b/boards/nz32-sc151/include/board.h @@ -33,6 +33,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 2 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /** @} */ diff --git a/boards/olimexino-stm32/include/board.h b/boards/olimexino-stm32/include/board.h index c0d8888278..09fbf2f431 100644 --- a/boards/olimexino-stm32/include/board.h +++ b/boards/olimexino-stm32/include/board.h @@ -39,9 +39,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 1 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 5 +#define LED1_PORT GPIO_PORT_A /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_A #define LED_PANIC LED0_ON diff --git a/boards/opencm904/include/board.h b/boards/opencm904/include/board.h index e28151887d..364de01db8 100644 --- a/boards/opencm904/include/board.h +++ b/boards/opencm904/include/board.h @@ -37,6 +37,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 9 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /** @} */ diff --git a/boards/p-l496g-cell02/include/board.h b/boards/p-l496g-cell02/include/board.h index 2b62476016..33ff4df284 100644 --- a/boards/p-l496g-cell02/include/board.h +++ b/boards/p-l496g-cell02/include/board.h @@ -32,9 +32,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 13 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B /** @} */ diff --git a/boards/p-nucleo-wb55/include/board.h b/boards/p-nucleo-wb55/include/board.h index 3864003aff..f82c92ed75 100644 --- a/boards/p-nucleo-wb55/include/board.h +++ b/boards/p-nucleo-wb55/include/board.h @@ -30,12 +30,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #define LED1_PIN_NUM 0 +#define LED1_PORT GPIO_PORT_B /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_B #define LED2_PIN_NUM 1 +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B /** @} */ diff --git a/boards/pyboard/include/board.h b/boards/pyboard/include/board.h index a632f19b07..115b826e1b 100644 --- a/boards/pyboard/include/board.h +++ b/boards/pyboard/include/board.h @@ -34,6 +34,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 4 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B /** @} */ diff --git a/boards/spark-core/include/board.h b/boards/spark-core/include/board.h index c32e74a346..0dc6e1864c 100644 --- a/boards/spark-core/include/board.h +++ b/boards/spark-core/include/board.h @@ -38,15 +38,19 @@ * @{ */ #define LED0_PIN_NUM 9 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 10 +#define LED1_PORT GPIO_PORT_A /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_A #define LED2_PIN_NUM 8 +#define LED2_PORT GPIO_PORT_A /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_A #define LED3_PIN_NUM 13 +#define LED3_PORT GPIO_PORT_A /**< GPIO port of LED 3 */ #define LED3_PORT_NUM PORT_A /** @} */ diff --git a/boards/stm32f030f4-demo/include/board.h b/boards/stm32f030f4-demo/include/board.h index 75aa6bb17f..5326617568 100644 --- a/boards/stm32f030f4-demo/include/board.h +++ b/boards/stm32f030f4-demo/include/board.h @@ -40,6 +40,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 4 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED0_IS_INVERTED 1 /** @} */ diff --git a/boards/stm32f0discovery/include/board.h b/boards/stm32f0discovery/include/board.h index 9386a47019..5e7eb49a86 100644 --- a/boards/stm32f0discovery/include/board.h +++ b/boards/stm32f0discovery/include/board.h @@ -31,9 +31,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 9 +#define LED0_PORT GPIO_PORT_C /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_C #define LED1_PIN_NUM 8 +#define LED1_PORT GPIO_PORT_C /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_C /** @} */ diff --git a/boards/stm32f3discovery/include/board.h b/boards/stm32f3discovery/include/board.h index b6271d930a..b9ec254d49 100644 --- a/boards/stm32f3discovery/include/board.h +++ b/boards/stm32f3discovery/include/board.h @@ -31,27 +31,35 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 9 +#define LED0_PORT GPIO_PORT_E /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_E #define LED1_PIN_NUM 8 +#define LED1_PORT GPIO_PORT_E /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_E #define LED2_PIN_NUM 10 +#define LED2_PORT GPIO_PORT_E /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_E #define LED3_PIN_NUM 15 +#define LED3_PORT GPIO_PORT_E /**< GPIO port of LED 3 */ #define LED3_PORT_NUM PORT_E #define LED4_PIN_NUM 11 +#define LED4_PORT GPIO_PORT_E /**< GPIO port of LED 4 */ #define LED4_PORT_NUM PORT_E #define LED5_PIN_NUM 14 +#define LED5_PORT GPIO_PORT_E /**< GPIO port of LED 5 */ #define LED5_PORT_NUM PORT_E #define LED6_PIN_NUM 12 +#define LED6_PORT GPIO_PORT_E /**< GPIO port of LED 6 */ #define LED6_PORT_NUM PORT_E #define LED7_PIN_NUM 13 +#define LED7_PORT GPIO_PORT_E /**< GPIO port of LED 7 */ #define LED7_PORT_NUM PORT_E /** @} */ diff --git a/boards/stm32f429i-disc1/include/board.h b/boards/stm32f429i-disc1/include/board.h index f81a9f1e56..1b24ee8923 100644 --- a/boards/stm32f429i-disc1/include/board.h +++ b/boards/stm32f429i-disc1/include/board.h @@ -31,9 +31,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_G /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_G #define LED1_PIN_NUM 14 +#define LED1_PORT GPIO_PORT_G /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_G /** @} */ diff --git a/boards/stm32f469i-disco/include/board.h b/boards/stm32f469i-disco/include/board.h index 84ac6dadd4..6e319ce314 100644 --- a/boards/stm32f469i-disco/include/board.h +++ b/boards/stm32f469i-disco/include/board.h @@ -30,21 +30,25 @@ extern "C" * @name Macros for controlling the on-board LEDs * @{ */ -#define LED0_PIN_NUM 6 -#define LED0_PORT_NUM PORT_G -#define LED0_IS_INVERTED 1 +#define LED0_PIN_NUM 6 /**< pin number of LED 0*/ +#define LED0_PORT GPIO_PORT_G /**< GPIO port of LED 0 */ +#define LED0_PORT_NUM PORT_G /**< GPIO port number of LED 0 */ +#define LED0_IS_INVERTED 1 /**< LED 0 is active-low */ -#define LED1_PIN_NUM 4 -#define LED1_PORT_NUM PORT_D -#define LED1_IS_INVERTED 1 +#define LED1_PIN_NUM 4 /**< pin number of LED 1*/ +#define LED1_PORT GPIO_PORT_D /**< GPIO port of LED 1 */ +#define LED1_PORT_NUM PORT_D /**< GPIO port number of LED 0 */ +#define LED1_IS_INVERTED 1 /**< LED 1 is active-low */ -#define LED2_PIN_NUM 5 -#define LED2_PORT_NUM PORT_D -#define LED2_IS_INVERTED 1 +#define LED2_PIN_NUM 5 /**< pin number of LED 2*/ +#define LED2_PORT GPIO_PORT_D /**< GPIO port of LED 2 */ +#define LED2_PORT_NUM PORT_D /**< GPIO port number of LED 0 */ +#define LED2_IS_INVERTED 1 /**< LED 2 is active-low */ -#define LED3_PIN_NUM 3 -#define LED3_PORT_NUM PORT_K -#define LED3_IS_INVERTED 1 +#define LED3_PIN_NUM 3 /**< pin number of LED 3*/ +#define LED3_PORT GPIO_PORT_K /**< GPIO port of LED 3 */ +#define LED3_PORT_NUM PORT_K /**< GPIO port number of LED 0 */ +#define LED3_IS_INVERTED 1 /**< LED 3 is active-low */ /** @} */ /** diff --git a/boards/stm32f4discovery/include/board.h b/boards/stm32f4discovery/include/board.h index 514290ae49..5c9dfe0a51 100644 --- a/boards/stm32f4discovery/include/board.h +++ b/boards/stm32f4discovery/include/board.h @@ -39,15 +39,19 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_D /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_D #define LED1_PIN_NUM 12 +#define LED1_PORT GPIO_PORT_D /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_D #define LED2_PIN_NUM 14 +#define LED2_PORT GPIO_PORT_D /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_D #define LED3_PIN_NUM 15 +#define LED3_PORT GPIO_PORT_D /**< GPIO port of LED 3 */ #define LED3_PORT_NUM PORT_D /** @} */ diff --git a/boards/stm32f723e-disco/include/board.h b/boards/stm32f723e-disco/include/board.h index 6c7d331603..b5c18482f9 100644 --- a/boards/stm32f723e-disco/include/board.h +++ b/boards/stm32f723e-disco/include/board.h @@ -117,12 +117,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 5 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define LED1_PIN_NUM 7 +#define LED1_PORT GPIO_PORT_A /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_A #define LED2_PIN_NUM 1 +#define LED2_PORT GPIO_PORT_B /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_B /** @} */ diff --git a/boards/stm32f746g-disco/include/board.h b/boards/stm32f746g-disco/include/board.h index e87c09913b..f7294fff94 100644 --- a/boards/stm32f746g-disco/include/board.h +++ b/boards/stm32f746g-disco/include/board.h @@ -62,6 +62,7 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 1 /**< LD1 pin number */ +#define LED0_PORT GPIO_PORT_I /**< GPIO port of LD1 */ #define LED0_PORT_NUM PORT_I /**< LD1 port */ /** @} */ diff --git a/boards/stm32f769i-disco/include/board.h b/boards/stm32f769i-disco/include/board.h index 16f7552f7c..7236966313 100644 --- a/boards/stm32f769i-disco/include/board.h +++ b/boards/stm32f769i-disco/include/board.h @@ -32,15 +32,19 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 13 +#define LED0_PORT GPIO_PORT_J /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_J #define LED1_PIN_NUM 5 +#define LED1_PORT GPIO_PORT_J /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_J #define LED2_PIN_NUM 12 +#define LED2_PORT GPIO_PORT_A /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_A #define LED3_PIN_NUM 4 +#define LED3_PORT GPIO_PORT_D /**< GPIO port of LED 3 */ #define LED3_PORT_NUM PORT_D /** @} */ diff --git a/boards/stm32g0316-disco/include/board.h b/boards/stm32g0316-disco/include/board.h index a52981a303..67d218e8d7 100644 --- a/boards/stm32g0316-disco/include/board.h +++ b/boards/stm32g0316-disco/include/board.h @@ -29,6 +29,7 @@ extern "C" { #define LED0_PIN_NUM 12 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define BTN0_PIN GPIO_PIN(PORT_A, 0) diff --git a/boards/stm32l0538-disco/include/board.h b/boards/stm32l0538-disco/include/board.h index 7ef4284181..c15b526293 100644 --- a/boards/stm32l0538-disco/include/board.h +++ b/boards/stm32l0538-disco/include/board.h @@ -37,9 +37,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 4 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #define LED1_PIN_NUM 5 +#define LED1_PORT GPIO_PORT_A /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_A /** @} */ diff --git a/boards/stm32l476g-disco/include/board.h b/boards/stm32l476g-disco/include/board.h index 7736c867f2..910cccaf77 100644 --- a/boards/stm32l476g-disco/include/board.h +++ b/boards/stm32l476g-disco/include/board.h @@ -33,9 +33,11 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 2 +#define LED0_PORT GPIO_PORT_B /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_B #define LED1_PIN_NUM 8 +#define LED1_PORT GPIO_PORT_E /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_E /** @} */ diff --git a/boards/stm32l496g-disco/include/board.h b/boards/stm32l496g-disco/include/board.h index dc0202cd89..55a9dbfa0f 100644 --- a/boards/stm32l496g-disco/include/board.h +++ b/boards/stm32l496g-disco/include/board.h @@ -148,12 +148,14 @@ extern "C" { * - LD3 green, active LOW (connected to PA5) * @{ */ -#define LED0_PIN_NUM 13 /**< green LED (LD2) pin */ -#define LED0_PORT_NUM PORT_B /**< green LED (LD2) port */ +#define LED0_PIN_NUM 13 /**< green LED (LD2) pin */ +#define LED0_PORT GPIO_PORT_B /**< GPIO port of green LED (LD2) */ +#define LED0_PORT_NUM PORT_B /**< green LED (LD2) port */ -#define LED1_PIN_NUM 5 /**< green LED (LD3) pin */ -#define LED1_PORT_NUM PORT_A /**< green LED (LD3) port */ -#define LED1_IS_INVERTED 1 /**< green LED (LD3) is LOW active */ +#define LED1_PIN_NUM 5 /**< green LED (LD3) pin */ +#define LED1_PORT GPIO_PORT_A /**< GPIO port of green LED (LD3) */ +#define LED1_PORT_NUM PORT_A /**< green LED (LD3) port */ +#define LED1_IS_INVERTED 1 /**< green LED (LD3) is LOW active */ /** @} */ /** diff --git a/boards/ublox-c030-u201/include/board.h b/boards/ublox-c030-u201/include/board.h index a2475c68ce..2c25639a57 100644 --- a/boards/ublox-c030-u201/include/board.h +++ b/boards/ublox-c030-u201/include/board.h @@ -34,12 +34,15 @@ extern "C" { * @{ */ #define LED0_PIN_NUM 3 +#define LED0_PORT GPIO_PORT_E /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_E #define LED1_PIN_NUM 4 +#define LED1_PORT GPIO_PORT_E /**< GPIO port of LED 1 */ #define LED1_PORT_NUM PORT_E #define LED2_PIN_NUM 1 +#define LED2_PORT GPIO_PORT_E /**< GPIO port of LED 2 */ #define LED2_PORT_NUM PORT_E /** @} */ diff --git a/boards/weact-g030f6/include/board.h b/boards/weact-g030f6/include/board.h index c798d5f5a1..19e4388730 100644 --- a/boards/weact-g030f6/include/board.h +++ b/boards/weact-g030f6/include/board.h @@ -28,6 +28,7 @@ extern "C" { #endif #define LED0_PIN_NUM 4 +#define LED0_PORT GPIO_PORT_A /**< GPIO port of LED 0 */ #define LED0_PORT_NUM PORT_A #define BTN0_PIN GPIO_PIN(PORT_A, 14)