1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18415 from maribu/boards/common/stm32

boards/common/stm32: clean up LED definitions
This commit is contained in:
Marian Buschsieweke 2022-08-25 20:17:44 +02:00 committed by GitHub
commit 8d1476933b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 445 additions and 2418 deletions

View File

@ -31,26 +31,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_E, 7) /**< LED0 gpio pin */
#define LED0_MASK (1 << 7) /**< LED0 gpio mask */
#define LED0_PIN_NUM 7
#define LED0_PORT_NUM PORT_E
#define LED0_ON (GPIOB->BSRR = LED0_MASK) /**< Turn on LED0 */
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16)) /**< Turn off LED0 */
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) /**< Toggle LED0 */
#define LED1_PIN_NUM 8
#define LED1_PORT_NUM PORT_E
#define LED1_PIN GPIO_PIN(PORT_E, 8) /**< LED1 gpio pin */
#define LED1_MASK (1 << 8) /**< LED1 gpio mask */
#define LED1_ON (GPIOE->BSRR = LED1_MASK) /**< Turn on LED1 */
#define LED1_OFF (GPIOE->BSRR = (LED1_MASK << 16)) /**< Turn off LED1 */
#define LED1_TOGGLE (GPIOE->ODR ^= LED1_MASK) /**< Toggle LED1 */
#define LED2_PIN GPIO_PIN(PORT_E, 9) /**< LED2 gpio pin */
#define LED2_MASK (1 << 9) /**< LED2 gpio mask */
#define LED2_ON (GPIOE->BSRR = LED2_MASK) /**< Turn on LED2 */
#define LED2_OFF (GPIOE->BSRR = (LED2_MASK << 16)) /**< Turn off LED2 */
#define LED2_TOGGLE (GPIOE->ODR ^= LED2_MASK) /**< Toggle LED2 */
#define LED2_PIN_NUM 9
#define LED2_PORT_NUM PORT_E
/** @} */
@ -75,5 +63,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -54,33 +54,17 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 5)
#define LED0_MASK (1 << 5)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_A
#define LED0_ON (GPIOA->BSRR = LED0_MASK)
#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
#define LED1_PIN_NUM 5
#define LED1_PORT_NUM PORT_B
#define LED1_PIN GPIO_PIN(PORT_B, 5)
#define LED1_MASK (1 << 5)
#define LED2_PIN_NUM 6
#define LED2_PORT_NUM PORT_B
#define LED1_ON (GPIOB->BSRR = LED1_MASK)
#define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
#define LED2_PIN GPIO_PIN(PORT_B, 6)
#define LED2_MASK (1 << 6)
#define LED2_ON (GPIOB->BSRR = LED2_MASK)
#define LED2_OFF (GPIOB->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (GPIOB->ODR ^= LED2_MASK)
#define LED3_PIN GPIO_PIN(PORT_B, 7)
#define LED3_MASK (1 << 7)
#define LED3_ON (GPIOB->BSRR = LED3_MASK)
#define LED3_OFF (GPIOB->BSRR = (LED3_MASK << 16))
#define LED3_TOGGLE (GPIOB->ODR ^= LED3_MASK)
#define LED3_PIN_NUM 7
#define LED3_PORT_NUM PORT_B
/** @} */
/**
@ -95,5 +79,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -31,19 +31,11 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 5)
#define LED0_MASK (1 << 5)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_A
#define LED0_ON (GPIOA->BSRR = LED0_MASK)
#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
#define LED1_PIN GPIO_PIN(PORT_B, 14)
#define LED1_MASK (1 << 14)
#define LED1_ON (GPIOB->BSRR = LED1_MASK)
#define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 14
#define LED1_PORT_NUM PORT_B
/** @} */
/**
@ -87,5 +79,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -31,26 +31,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_E, 13)
#define LED0_MASK (1 << 13)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_E
#define LED0_ON (GPIOE->BSRR = LED0_MASK)
#define LED0_OFF (GPIOE->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOE->ODR ^= LED0_MASK)
#define LED1_PIN_NUM 6
#define LED1_PORT_NUM PORT_H
#define LED1_PIN GPIO_PIN(PORT_H, 6)
#define LED1_MASK (1 << 6)
#define LED1_ON (GPIOH->BSRR = LED1_MASK)
#define LED1_OFF (GPIOH->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOH->ODR ^= LED1_MASK)
#define LED2_PIN GPIO_PIN(PORT_H, 7)
#define LED2_MASK (1 << 7)
#define LED2_ON (GPIOH->BSRR = LED2_MASK)
#define LED2_OFF (GPIOH->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (GPIOH->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 7
#define LED2_PORT_NUM PORT_H
/** @} */
/**
@ -79,5 +67,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -35,9 +35,8 @@ extern "C" {
* @name Macros for controlling the on-board LED.
* @{
*/
#define LED0_PORT GPIOB /**< GPIO-Port the LED is connected to */
#define LED0_PORTNUM PORT_B /**< GPIO Port number the LED is connected to */
#define LED0_PINNUM (12) /**< Pin number the LED is connected to */
#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 */
/** @} */
#ifdef __cplusplus

View File

@ -35,9 +35,8 @@ extern "C" {
* @name Macros for controlling the on-board LED.
* @{
*/
#define LED0_PORT GPIOB /**< GPIO-Port the LED is connected to */
#define LED0_PORTNUM PORT_B /**< GPIO Port number the LED is connected to */
#define LED0_PINNUM (12) /**< Pin number the LED is connected to */
#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 */
/** @} */
#ifdef __cplusplus

View File

@ -39,18 +39,16 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOC
#define LED0_PIN GPIO_PIN(PORT_C, 13)
#define LED0_MASK (1 << 13)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 0))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_C
#define LED0_IS_INVERTED 1
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -32,21 +32,15 @@ extern "C" {
* @name Macros for controlling the on-board LED.
* @{
*/
#ifndef LED0_PORT
#define LED0_PORT GPIOC /**< GPIO-Port the LED is connected to */
#ifndef LED0_PORT_NUM
#define LED0_PORT_NUM PORT_C /**< GPIO Port number the LED is connected to */
#endif
#ifndef LED0_PORTNUM
#define LED0_PORTNUM PORT_C /**< GPIO Port number the LED is connected to */
#ifndef LED0_PIN_NUM
#define LED0_PIN_NUM (13) /**< Pin number the LED is connected to */
#endif
#ifndef LED0_PINNUM
#define LED0_PINNUM (13) /**< Pin number the LED is connected to */
#ifndef LED0_IS_INVERTED
#define LED0_IS_INVERTED 1
#endif
#define LED0_PIN GPIO_PIN(LED0_PORTNUM, LED0_PINNUM) /**< GPIO-Pin the LED is connected to */
#define LED0_MASK (1 << LED0_PINNUM)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16)) /**< Turn LED0 on */
#define LED0_OFF (LED0_PORT->BSRR = LED0_MASK) /**< Turn LED0 off */
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK) /**< Toggle LED0 */
/** @} */
/**
@ -74,5 +68,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_COMMON_H */
/** @} */

View File

@ -77,30 +77,21 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_D, 2)
#define LED1_PIN GPIO_PIN(PORT_B, 5)
#define LED2_PIN GPIO_PIN(PORT_C, 10)
#define LED0_PIN_NUM 2
#define LED0_PORT_NUM PORT_D
#define LED0_MASK (1 << 2)
#define LED1_MASK (1 << 5)
#define LED2_MASK (1 << 10)
#define LED1_PIN_NUM 5
#define LED1_PORT_NUM PORT_B
#define LED0_ON (GPIOD->ODR &= ~LED0_MASK)
#define LED0_OFF (GPIOD->ODR |= LED0_MASK)
#define LED0_TOGGLE (GPIOD->ODR ^= LED0_MASK)
#define LED1_ON (GPIOB->ODR &= ~LED1_MASK)
#define LED1_OFF (GPIOB->ODR |= LED1_MASK)
#define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
#define LED2_ON (GPIOC->ODR &= ~LED2_MASK)
#define LED2_OFF (GPIOC->ODR |= LED2_MASK)
#define LED2_TOGGLE (GPIOC->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 10
#define LED2_PORT_NUM PORT_C
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_COMMON_H */
/** @} */

View File

@ -39,36 +39,23 @@ extern "C" {
*/
#if defined(CPU_MODEL_STM32L496ZG) || defined(CPU_MODEL_STM32L4R5ZI) || \
defined(CPU_MODEL_STM32L552ZE)
#define LED0_PORT GPIOC
#define LED0_PIN GPIO_PIN(PORT_C, 7)
#define LED0_MASK (1 << 7)
#define LED0_PIN_NUM 7
#define LED0_PORT_NUM PORT_C
#else
#define LED0_PORT GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 0)
#define LED0_MASK (1 << 0)
#define LED0_PIN_NUM 0
#define LED0_PORT_NUM PORT_B
#endif
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED1_PIN GPIO_PIN(PORT_B, 7)
#define LED1_MASK (1 << 7)
#define LED1_ON (GPIOB->BSRR = LED1_MASK)
#define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 7
#define LED1_PORT_NUM PORT_B
#if defined(CPU_MODEL_STM32L552ZE)
#define LED2_PORT GPIOA
#define LED2_PIN GPIO_PIN(PORT_A, 9)
#define LED2_MASK (1 << 9)
#define LED2_PIN_NUM 9
#define LED2_PORT_NUM PORT_A
#else
#define LED2_PORT GPIOB
#define LED2_PIN GPIO_PIN(PORT_B, 14)
#define LED2_MASK (1 << 14)
#define LED2_PIN_NUM 14
#define LED2_PORT_NUM PORT_B
#endif
#define LED2_ON (LED2_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK)
/** @} */
/**
@ -83,5 +70,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -33,16 +33,15 @@ extern "C" {
* @name Macros for controlling the on-board LED (LD3).
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 3)
#define LED0_MASK (1 << 3)
#define LED0_ON (GPIOB->BSRR = LED0_MASK)
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 3
#define LED0_PORT_NUM PORT_B
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -35,18 +35,12 @@ extern "C" {
* @{
*/
#if defined(CPU_MODEL_STM32F302R8) || defined(CPU_MODEL_STM32L433RC)
#define LED0_PORT GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 13)
#define LED0_MASK (1 << 13)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_B
#else
#define LED0_PORT GPIOA
#define LED0_PIN GPIO_PIN(PORT_A, 5)
#define LED0_MASK (1 << 5)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_A
#endif
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
/** @} */
/**
@ -97,5 +91,7 @@ static const motor_driver_config_t motor_driver_config[] = {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -0,0 +1,157 @@
/*
* Copyright (C) 2022 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_common_stm32
* @brief Common LED macros
* @{
*
* @file
* @brief Common LED macros
*
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
*
* This idea is that STM32 boards only define the pin and port number of LEDs
* and this header provides the rest of the defines
*/
#ifndef STM32_LEDS_H
#define STM32_LEDS_H
/* GPIO_PORT() macro. This define even works when GPIO LL is not in used */
#include "gpio_ll_arch.h"
#include "kernel_defines.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Common LED pin definitions for STM32 boards
* @{
*/
#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)
# if IS_ACTIVE(LED_0_IS_INVERTED)
# define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
# define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
# else
# define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
# define LED0_OFF (LED0_PORT->BSRR = LED0_MASK)
# endif
# define LED0_TOGGLE (LED0_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_1_IS_INVERTED)
# define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
# define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16))
# else
# define LED1_ON (LED1_PORT->BSRR = (LED1_MASK << 16))
# define LED1_OFF (LED1_PORT->BSRR = LED1_MASK)
# endif
# define LED1_TOGGLE (LED1_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_2_IS_INVERTED)
# define LED2_ON (LED2_PORT->BSRR = LED2_MASK)
# define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16))
# else
# define LED2_ON (LED2_PORT->BSRR = (LED2_MASK << 16))
# define LED2_OFF (LED2_PORT->BSRR = LED2_MASK)
# endif
# define LED2_TOGGLE (LED2_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_3_IS_INVERTED)
# define LED3_ON (LED3_PORT->BSRR = LED3_MASK)
# define LED3_OFF (LED3_PORT->BSRR = (LED3_MASK << 16))
# else
# define LED3_ON (LED3_PORT->BSRR = (LED3_MASK << 16))
# define LED3_OFF (LED3_PORT->BSRR = LED3_MASK)
# endif
# define LED3_TOGGLE (LED3_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_4_IS_INVERTED)
# define LED4_ON (LED4_PORT->BSRR = LED4_MASK)
# define LED4_OFF (LED4_PORT->BSRR = (LED4_MASK << 16))
# else
# define LED4_ON (LED4_PORT->BSRR = (LED4_MASK << 16))
# define LED4_OFF (LED4_PORT->BSRR = LED4_MASK)
# endif
# define LED4_TOGGLE (LED4_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_5_IS_INVERTED)
# define LED5_ON (LED5_PORT->BSRR = LED5_MASK)
# define LED5_OFF (LED5_PORT->BSRR = (LED5_MASK << 16))
# else
# define LED5_ON (LED5_PORT->BSRR = (LED5_MASK << 16))
# define LED5_OFF (LED5_PORT->BSRR = LED5_MASK)
# endif
# define LED5_TOGGLE (LED5_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_6_IS_INVERTED)
# define LED6_ON (LED6_PORT->BSRR = LED6_MASK)
# define LED6_OFF (LED6_PORT->BSRR = (LED6_MASK << 16))
# else
# define LED6_ON (LED6_PORT->BSRR = (LED6_MASK << 16))
# define LED6_OFF (LED6_PORT->BSRR = LED6_MASK)
# endif
# define LED6_TOGGLE (LED6_PORT->ODR ^= 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)
# if IS_ACTIVE(LED_7_IS_INVERTED)
# define LED7_ON (LED7_PORT->BSRR = LED7_MASK)
# define LED7_OFF (LED7_PORT->BSRR = (LED7_MASK << 16))
# else
# define LED7_ON (LED7_PORT->BSRR = (LED7_MASK << 16))
# define LED7_OFF (LED7_PORT->BSRR = LED7_MASK)
# endif
# define LED7_TOGGLE (LED7_PORT->ODR ^= LED7_MASK)
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* STM32_LEDS_H */
/** @} */

View File

@ -40,13 +40,9 @@ extern "C" {
* @name LED pin definition and handlers
* @{
*/
#define LED0_PORT GPIOC
#define LED0_PIN GPIO_PIN(PORT_C, 13)
#define LED0_MASK (1 << 13)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 0))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_C
#define LED0_IS_INVERTED 1
/** @} */
/**
@ -85,5 +81,7 @@ extern mtd_dev_t *mtd0;
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -31,31 +31,21 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 1)
#define LED1_PIN GPIO_PIN(PORT_A, 3)
#define LED2_PIN GPIO_PIN(PORT_A, 2)
#define LED0_PIN_NUM 1
#define LED0_PORT_NUM PORT_A
#define LED_PORT GPIOA
#define LED0_MASK (1 << 1)
#define LED1_MASK (1 << 3)
#define LED2_MASK (1 << 2)
#define LED1_PIN_NUM 3
#define LED1_PORT_NUM PORT_A
#define LED0_ON (LED_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED1_ON (LED_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
#define LED2_ON (LED_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 2
#define LED2_PORT_NUM PORT_A
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -32,14 +32,8 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_C, 3)
#define LED0_PORT (GPIOC)
#define LED0_MASK (1 << 3)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 3
#define LED0_PORT_NUM PORT_C
/** @} */
/**
@ -61,5 +55,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -37,13 +37,9 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOA
#define LED0_PIN GPIO_PIN(PORT_A, 1)
#define LED0_MASK (1 << 1)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = LED0_MASK)
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 1
#define LED0_PORT_NUM PORT_A
#define LED0_IS_INVERTED 1
#define EN3V3_PORT GPIOA
#define EN3V3_PIN GPIO_PIN(PORT_A, 11)
@ -72,5 +68,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -46,12 +46,8 @@ 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 GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 5)
#define LED0_MASK (1 << 5)
#define LED0_OFF (LED0_PORT->BSRR = LED0_MASK)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 5))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PORT_NUM PORT_B
#define LED0_PIN_NUM 5
/** @} */
/**
@ -99,5 +95,7 @@ extern void lora_e5_dev_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_mo
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -36,14 +36,8 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 1)
#define LED_PORT GPIOB
#define LED0_MASK (1 << 1)
#define LED0_ON (LED_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BRR = LED0_MASK)
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 1
#define LED0_PORT_NUM PORT_B
/** @} */
/**
@ -63,5 +57,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -48,26 +48,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 8) /**< Pin of red LED */
#define LED1_PIN GPIO_PIN(PORT_B, 14) /**< Pin of yellow LED */
#define LED2_PIN GPIO_PIN(PORT_B, 15) /**< Pin of green LED */
#define LED0_PIN_NUM 8 /**< Pin number of red LED */
#define LED0_PORT_NUM PORT_B /**< Port number of red LED */
#define LED_PORT GPIOB /**< GPIO port LEDs are connected to */
#define LED0_MASK (1 << 8) /**< Bitmask to address red LED in @ref LED_PORT */
#define LED1_MASK (1 << 14) /**< Bitmask to address yellow LED in @ref LED_PORT */
#define LED2_MASK (1 << 15) /**< Bitmask to address green LED in @ref LED_PORT */
#define LED1_PIN_NUM 14 /**< Pin number of yellow LED */
#define LED1_PORT_NUM PORT_B /**< Port number of yellow LED */
#define LED0_ON (LED_PORT->BSRR = LED0_MASK) /**< Turn red LED on */
#define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16)) /**< Turn red LED off */
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK) /**< Toggle red LED */
#define LED1_ON (LED_PORT->BSRR = LED1_MASK) /**< Turn yellow LED on */
#define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16)) /**< Turn yellow LED off */
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK) /**< Toggle yellow LED */
#define LED2_ON (LED_PORT->BSRR = LED2_MASK) /**< Turn green LED on */
#define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16)) /**< Turn green LED off */
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK) /**< Toggle green LED */
#define LED2_PIN_NUM 15 /**< Pin number of green LED */
#define LED2_PORT_NUM PORT_B /**< Port number of green LED */
/** @} */
/**
@ -82,5 +70,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -48,26 +48,14 @@ extern void nucleo_wl55jc_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 15)
#define LED0_MASK (1 << 15)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 15
#define LED0_PORT_NUM PORT_B
#define LED1_PORT GPIOB
#define LED1_PIN GPIO_PIN(PORT_B, 9)
#define LED1_MASK (1 << 9)
#define LED1_ON (LED0_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED0_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED0_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 9
#define LED1_PORT_NUM PORT_B
#define LED2_PORT GPIOB
#define LED2_PIN GPIO_PIN(PORT_B, 11)
#define LED2_MASK (1 << 11)
#define LED2_ON (LED0_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED0_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED0_PORT->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 11
#define LED2_PORT_NUM PORT_B
/** @} */
/**
@ -97,5 +85,7 @@ extern void nucleo_wl55jc_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -32,18 +32,15 @@ extern "C" {
* @name User LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 2)
#define LED0_MASK (1 << 2)
#define LED0_ON (GPIOB->BSRR = LED0_MASK)
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 2
#define LED0_PORT_NUM PORT_B
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -38,21 +38,11 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOA
#define LED0_PIN GPIO_PIN(PORT_A, 1)
#define LED0_MASK (1 << 1)
#define LED0_PIN_NUM 1
#define LED0_PORT_NUM PORT_A
#define LED1_PORT GPIOA
#define LED1_PIN GPIO_PIN(PORT_A, 5)
#define LED1_MASK (1 << 5)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 5
#define LED1_PORT_NUM PORT_A
#define LED_PANIC LED0_ON
/** @} */
@ -69,5 +59,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -36,14 +36,8 @@ extern "C" {
* @name Macros for controlling the on-board LED.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 9)
#define LED_PORT GPIOB
#define LED0_MASK (1 << 9)
#define LED0_ON (LED_PORT->BRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BSRR = LED0_MASK)
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 9
#define LED0_PORT_NUM PORT_B
/** @} */
/**
@ -81,5 +75,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -31,19 +31,11 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 5)
#define LED0_MASK (1 << 5)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_A
#define LED0_ON (GPIOA->BSRR = LED0_MASK)
#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
#define LED1_PIN GPIO_PIN(PORT_B, 13)
#define LED1_MASK (1 << 13)
#define LED1_ON (GPIOB->BSRR = LED1_MASK)
#define LED1_OFF (GPIOB->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 13
#define LED1_PORT_NUM PORT_B
/** @} */
/**
@ -70,5 +62,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -29,26 +29,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 5)
#define LED0_MASK (1 << 5)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_B
#define LED1_PORT GPIOB
#define LED1_PIN GPIO_PIN(PORT_B, 0)
#define LED1_MASK (1 << 0)
#define LED1_ON (LED0_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED0_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED0_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 0
#define LED1_PORT_NUM PORT_B
#define LED2_PORT GPIOB
#define LED2_PIN GPIO_PIN(PORT_B, 1)
#define LED2_MASK (1 << 1)
#define LED2_ON (LED0_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED0_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED0_PORT->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 1
#define LED2_PORT_NUM PORT_B
/** @} */
/**
@ -67,5 +55,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -33,12 +33,8 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 4)
#define LED0_MASK (1 << 4)
#define LED0_ON (GPIOB->BSRR = LED0_MASK)
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 4
#define LED0_PORT_NUM PORT_B
/** @} */
/**
@ -53,5 +49,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -37,32 +37,17 @@
* @name Macros for controlling the on-board LEDs
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 9)
#define LED1_PIN GPIO_PIN(PORT_A, 10)
#define LED2_PIN GPIO_PIN(PORT_A, 8)
#define LED3_PIN GPIO_PIN(PORT_A, 13)
#define LED0_PIN_NUM 9
#define LED0_PORT_NUM PORT_A
#define LED_PORT (GPIOA)
#define LED0_MASK (1 << 9)
#define LED1_MASK (1 << 10)
#define LED2_MASK (1 << 8)
#define LED3_MASK (1 << 13)
#define LED1_PIN_NUM 10
#define LED1_PORT_NUM PORT_A
#define LED0_ON (LED_PORT->BRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BSRR = LED0_MASK)
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED2_PIN_NUM 8
#define LED2_PORT_NUM PORT_A
#define LED1_ON (LED_PORT->BRR = LED1_MASK)
#define LED1_OFF (LED_PORT->BSRR = LED1_MASK)
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
#define LED2_ON (LED_PORT->BRR = LED2_MASK)
#define LED2_OFF (LED_PORT->BSRR = LED2_MASK)
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
#define LED3_ON (LED_PORT->BRR = LED3_MASK)
#define LED3_OFF (LED_PORT->BSRR = LED3_MASK)
#define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
#define LED3_PIN_NUM 13
#define LED3_PORT_NUM PORT_A
/** @} */
/**
@ -94,5 +79,7 @@
} /* end extern "C" */
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -39,18 +39,16 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PORT GPIOA
#define LED0_PIN GPIO_PIN(PORT_A, 4)
#define LED0_MASK (1 << 4)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 0))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 4
#define LED0_PORT_NUM PORT_A
#define LED0_IS_INVERTED 1
/** @} */
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -30,20 +30,11 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_C, 9)
#define LED1_PIN GPIO_PIN(PORT_C, 8)
#define LED0_PIN_NUM 9
#define LED0_PORT_NUM PORT_C
#define LED_PORT GPIOC
#define LED0_MASK (1 << 9)
#define LED1_MASK (1 << 8)
#define LED0_ON (LED_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BRR = LED0_MASK)
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED1_ON (LED_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED_PORT->BRR = LED1_MASK)
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 8
#define LED1_PORT_NUM PORT_C
/** @} */
/**
@ -58,5 +49,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -30,56 +30,29 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_E, 9)
#define LED1_PIN GPIO_PIN(PORT_E, 8)
#define LED2_PIN GPIO_PIN(PORT_E, 10)
#define LED3_PIN GPIO_PIN(PORT_E, 15)
#define LED4_PIN GPIO_PIN(PORT_E, 11)
#define LED5_PIN GPIO_PIN(PORT_E, 14)
#define LED6_PIN GPIO_PIN(PORT_E, 12)
#define LED7_PIN GPIO_PIN(PORT_E, 13)
#define LED0_PIN_NUM 9
#define LED0_PORT_NUM PORT_E
#define LED_PORT GPIOE
#define LED0_MASK (1 << 9)
#define LED1_MASK (1 << 8)
#define LED2_MASK (1 << 10)
#define LED3_MASK (1 << 15)
#define LED4_MASK (1 << 11)
#define LED5_MASK (1 << 14)
#define LED6_MASK (1 << 12)
#define LED7_MASK (1 << 13)
#define LED1_PIN_NUM 8
#define LED1_PORT_NUM PORT_E
#define LED0_ON (LED_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED2_PIN_NUM 10
#define LED2_PORT_NUM PORT_E
#define LED1_ON (LED_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
#define LED3_PIN_NUM 15
#define LED3_PORT_NUM PORT_E
#define LED2_ON (LED_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
#define LED4_PIN_NUM 11
#define LED4_PORT_NUM PORT_E
#define LED3_ON (LED_PORT->BSRR = LED3_MASK)
#define LED3_OFF (LED_PORT->BSRR = (LED3_MASK << 16))
#define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
#define LED5_PIN_NUM 14
#define LED5_PORT_NUM PORT_E
#define LED4_ON (LED_PORT->BSRR = LED4_MASK)
#define LED4_OFF (LED_PORT->BSRR = (LED4_MASK << 16))
#define LED4_TOGGLE (LED_PORT->ODR ^= LED4_MASK)
#define LED6_PIN_NUM 12
#define LED6_PORT_NUM PORT_E
#define LED5_ON (LED_PORT->BSRR = LED5_MASK)
#define LED5_OFF (LED_PORT->BSRR = (LED5_MASK << 16))
#define LED5_TOGGLE (LED_PORT->ODR ^= LED5_MASK)
#define LED6_ON (LED_PORT->BSRR = LED6_MASK)
#define LED6_OFF (LED_PORT->BSRR = (LED6_MASK << 16))
#define LED6_TOGGLE (LED_PORT->ODR ^= LED6_MASK)
#define LED7_ON (LED_PORT->BSRR = LED7_MASK)
#define LED7_OFF (LED_PORT->BSRR = (LED7_MASK << 16))
#define LED7_TOGGLE (LED_PORT->ODR ^= LED7_MASK)
#define LED7_PIN_NUM 13
#define LED7_PORT_NUM PORT_E
/** @} */
/**
@ -111,5 +84,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -30,19 +30,11 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_G, 13)
#define LED1_PIN GPIO_PIN(PORT_G, 14)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_G
#define LED0_MASK (1 << 13)
#define LED1_MASK (1 << 14)
#define LED0_ON (GPIOG->BSRR = LED0_MASK)
#define LED0_OFF (GPIOG->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOG->ODR ^= LED0_MASK)
#define LED1_ON (GPIOG->BSRR = LED1_MASK)
#define LED1_OFF (GPIOG->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOG->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 14
#define LED1_PORT_NUM PORT_G
/** @} */
/**
@ -67,5 +59,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -30,36 +30,21 @@ extern "C"
* @name Macros for controlling the on-board LEDs
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_G, 6)
#define LED1_PIN GPIO_PIN(PORT_D, 4)
#define LED2_PIN GPIO_PIN(PORT_D, 5)
#define LED3_PIN GPIO_PIN(PORT_K, 3)
#define LED0_PIN_NUM 6
#define LED0_PORT_NUM PORT_G
#define LED0_IS_INVERTED 1
#define LED0_PORT GPIOG
#define LED1_PORT GPIOD
#define LED2_PORT GPIOD
#define LED3_PORT GPIOK
#define LED1_PIN_NUM 4
#define LED1_PORT_NUM PORT_D
#define LED1_IS_INVERTED 1
#define LED0_MASK (1 << 6)
#define LED1_MASK (1 << 4)
#define LED2_MASK (1 << 5)
#define LED3_MASK (1 << 3)
#define LED2_PIN_NUM 5
#define LED2_PORT_NUM PORT_D
#define LED2_IS_INVERTED 1
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = LED0_MASK)
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED1_ON (LED1_PORT->BSRR = (LED1_MASK << 16))
#define LED1_OFF (LED1_PORT->BSRR = LED1_MASK)
#define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
#define LED2_ON (LED2_PORT->BSRR = (LED2_MASK << 16))
#define LED2_OFF (LED2_PORT->BSRR = LED2_MASK)
#define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK)
#define LED3_ON (LED3_PORT->BSRR = (LED3_MASK << 16))
#define LED3_OFF (LED3_PORT->BSRR = LED3_MASK)
#define LED3_TOGGLE (LED3_PORT->ODR ^= LED3_MASK)
#define LED3_PIN_NUM 3
#define LED3_PORT_NUM PORT_K
#define LED3_IS_INVERTED 1
/** @} */
/**
@ -74,5 +59,7 @@ extern "C"
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -34,42 +34,21 @@ extern "C" {
#define XTIMER_BACKOFF (10)
/** @} */
/**
* @name LED pin definitions
* @{
*/
/** @} */
/**
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_D, 13)
#define LED1_PIN GPIO_PIN(PORT_D, 12)
#define LED2_PIN GPIO_PIN(PORT_D, 14)
#define LED3_PIN GPIO_PIN(PORT_D, 15)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_D
#define LED_PORT GPIOD
#define LED0_MASK (1 << 13)
#define LED1_MASK (1 << 12)
#define LED2_MASK (1 << 14)
#define LED3_MASK (1 << 15)
#define LED1_PIN_NUM 12
#define LED1_PORT_NUM PORT_D
#define LED0_ON (LED_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
#define LED2_PIN_NUM 14
#define LED2_PORT_NUM PORT_D
#define LED1_ON (LED_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
#define LED2_ON (LED_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
#define LED3_ON (LED_PORT->BSRR = LED3_MASK)
#define LED3_OFF (LED_PORT->BSRR = (LED3_MASK << 16))
#define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
#define LED3_PIN_NUM 15
#define LED3_PORT_NUM PORT_D
/** @} */
/**
@ -84,5 +63,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -30,26 +30,14 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_A, 5)
#define LED0_PORT GPIOA
#define LED0_MASK (1 << 5)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 5
#define LED0_PORT_NUM PORT_A
#define LED1_PIN GPIO_PIN(PORT_A, 7)
#define LED1_PORT GPIOA
#define LED1_MASK (1 << 7)
#define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 7
#define LED1_PORT_NUM PORT_A
#define LED2_PIN GPIO_PIN(PORT_B, 1)
#define LED2_PORT GPIOB
#define LED2_MASK (1 << 1)
#define LED2_ON (LED2_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 1
#define LED2_PORT_NUM PORT_B
/** @} */
/**
@ -75,5 +63,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -31,35 +31,17 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_J, 13)
#define LED1_PIN GPIO_PIN(PORT_J, 5)
#define LED2_PIN GPIO_PIN(PORT_A, 12)
#define LED3_PIN GPIO_PIN(PORT_D, 4)
#define LED0_PIN_NUM 13
#define LED0_PORT_NUM PORT_J
#define LED0_PORT GPIOJ
#define LED1_PORT GPIOJ
#define LED2_PORT GPIOA
#define LED3_PORT GPIOD
#define LED0_MASK (1 << 13)
#define LED1_MASK (1 << 5)
#define LED2_MASK (1 << 12)
#define LED3_MASK (1 << 4)
#define LED1_PIN_NUM 5
#define LED1_PORT_NUM PORT_J
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED2_PIN_NUM 12
#define LED2_PORT_NUM PORT_A
#define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED1_PORT->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
#define LED2_ON (LED2_PORT->BSRR = LED2_MASK)
#define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK)
#define LED3_ON (LED3_PORT->BSRR = LED3_MASK)
#define LED3_OFF (LED3_PORT->BSRR = (LED3_MASK << 16))
#define LED3_TOGGLE (LED3_PORT->ODR ^= LED3_MASK)
#define LED3_PIN_NUM 4
#define LED3_PORT_NUM PORT_D
/** @} */
/**
@ -74,5 +56,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -28,19 +28,17 @@ extern "C" {
#endif
#define LED0_PIN GPIO_PIN(PORT_A, 12)
#define LED0_MODE GPIO_OUT
#define LED0_MASK (1 << 12)
#define LED0_ON (GPIOA->BSRR = LED0_MASK)
#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)
#define LED0_PIN_NUM 12
#define LED0_PORT_NUM PORT_A
#define BTN0_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_MODE GPIO_IN
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -36,21 +36,11 @@ extern "C" {
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 4)
#define LED0_PORT GPIOB
#define LED0_MASK (1 << 4)
#define LED0_PIN_NUM 4
#define LED0_PORT_NUM PORT_B
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BRR = LED0_MASK)
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
#define LED1_PIN GPIO_PIN(PORT_A, 5)
#define LED1_PORT GPIOA
#define LED1_MASK (1 << 5)
#define LED1_ON (LED1_PORT->BSRR = LED1_MASK)
#define LED1_OFF (LED1_PORT->BRR = LED1_MASK)
#define LED1_TOGGLE (LED1_PORT->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 5
#define LED1_PORT_NUM PORT_A
/** @} */
/**
@ -66,5 +56,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -33,19 +33,11 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_B, 2)
#define LED0_MASK (1 << 2)
#define LED0_PIN_NUM 2
#define LED0_PORT_NUM PORT_B
#define LED0_ON (GPIOB->BSRR = LED0_MASK)
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
#define LED1_PIN GPIO_PIN(PORT_E, 8)
#define LED1_MASK (1 << 8)
#define LED1_ON (GPIOE->BSRR = LED1_MASK)
#define LED1_OFF (GPIOE->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOE->ODR ^= LED1_MASK)
#define LED1_PIN_NUM 8
#define LED1_PORT_NUM PORT_E
/** @} */
/**
@ -72,5 +64,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -33,26 +33,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_E, 3)
#define LED0_MASK (1 << 3)
#define LED0_PIN_NUM 3
#define LED0_PORT_NUM PORT_E
#define LED0_ON (GPIOE->BSRR = LED0_MASK)
#define LED0_OFF (GPIOE->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOE->ODR ^= LED0_MASK)
#define LED1_PIN_NUM 4
#define LED1_PORT_NUM PORT_E
#define LED1_PIN GPIO_PIN(PORT_E, 4)
#define LED1_MASK (1 << 4)
#define LED1_ON (GPIOE->BSRR = LED1_MASK)
#define LED1_OFF (GPIOE->BSRR = (LED1_MASK << 16))
#define LED1_TOGGLE (GPIOE->ODR ^= LED1_MASK)
#define LED2_PIN GPIO_PIN(PORT_E, 1)
#define LED2_MASK (1 << 1)
#define LED2_ON (GPIOE->BSRR = LED2_MASK)
#define LED2_OFF (GPIOE->BSRR = (LED2_MASK << 16))
#define LED2_TOGGLE (GPIOE->ODR ^= LED2_MASK)
#define LED2_PIN_NUM 1
#define LED2_PORT_NUM PORT_E
/** @} */
/**
@ -99,5 +87,7 @@ extern "C" {
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

File diff suppressed because it is too large Load Diff