Browse Source

periph: generalized button macros

master
smlng 6 years ago
parent
commit
de948189c3
  1. 3
      boards/calliope-mini/include/board.h
  2. 9
      boards/calliope-mini/include/gpio_params.h
  3. 7
      boards/cc2650stk/include/board.h
  4. 6
      boards/maple-mini/include/board.h
  5. 5
      boards/maple-mini/include/gpio_params.h
  6. 3
      boards/microbit/include/board.h
  7. 9
      boards/microbit/include/gpio_params.h
  8. 14
      boards/nrf52840dk/include/board.h
  9. 18
      boards/nrf52840dk/include/gpio_params.h
  10. 14
      boards/nrf52dk/include/board.h
  11. 18
      boards/nrf52dk/include/gpio_params.h
  12. 6
      boards/nucleo-common/include/board_common.h
  13. 5
      boards/nucleo-common/include/gpio_params.h
  14. 6
      boards/nucleo144-common/include/board_common.h
  15. 5
      boards/nucleo144-common/include/gpio_params.h
  16. 6
      boards/opencm904/include/board.h
  17. 13
      boards/pba-d-01-kw2x/include/board.h
  18. 8
      boards/pba-d-01-kw2x/include/gpio_params.h
  19. 4
      boards/remote-pa/include/board.h
  20. 6
      boards/remote-pa/include/gpio_params.h
  21. 4
      boards/remote-reva/include/board.h
  22. 6
      boards/remote-reva/include/gpio_params.h
  23. 4
      boards/remote-revb/include/board.h
  24. 6
      boards/remote-revb/include/gpio_params.h
  25. 4
      boards/samd21-xpro/board.c
  26. 7
      boards/samd21-xpro/include/board.h
  27. 5
      boards/samd21-xpro/include/gpio_params.h
  28. 10
      boards/saml21-xpro/include/board.h
  29. 7
      boards/samr21-xpro/include/board.h
  30. 5
      boards/samr21-xpro/include/gpio_params.h
  31. 6
      boards/stm32f0discovery/include/board.h
  32. 5
      boards/stm32f0discovery/include/gpio_params.h
  33. 7
      boards/stm32f3discovery/include/board.h
  34. 5
      boards/stm32f3discovery/include/gpio_params.h
  35. 7
      boards/stm32f4discovery/include/board.h
  36. 5
      boards/stm32f4discovery/include/gpio_params.h
  37. 7
      boards/stm32f7discovery/include/board.h
  38. 5
      boards/stm32f7discovery/include/gpio_params.h
  39. 9
      boards/z1/include/board.h

3
boards/calliope-mini/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific configuration for the Calliope mini
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -61,7 +62,9 @@ extern "C" {
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 17)
#define BTN0_MODE GPIO_IN
#define BTN1_PIN GPIO_PIN(0, 26)
#define BTN1_MODE GPIO_IN
/** @} */
/**

9
boards/calliope-mini/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -33,13 +34,13 @@ static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "Button A",
.pin = BTN0_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
{
.name = "Button B",
.pin = BTN1_PIN,
.mode = GPIO_IN
.pin = BTN1_PIN,
.mode = BTN1_MODE
},
};

7
boards/cc2650stk/include/board.h

@ -16,6 +16,7 @@
* @brief Board configuration for the CC2650STK
*
* @author Leon M. George <leon@georgemail.eu>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -38,8 +39,10 @@ extern "C" {
* @name On-board button configuration
* @{
*/
#define BUTTON1_DIO GPIO_PIN(0, 4)
#define BUTTON2_DIO GPIO_PIN(0, 0)
#define BTN0_PIN GPIO_PIN(0, 4)
#define BTN0_MODE GPIO_IN
#define BTN1_PIN GPIO_PIN(0, 0)
#define BTN1_MODE GPIO_IN
/** @} */
/**

6
boards/maple-mini/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the maple-mini board
*
* @author Frits Kuipers <frits.kuipers@gmail.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -49,8 +50,11 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_B, 8)
#define BTN0_PIN GPIO_PIN(PORT_B, 8)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Use the USART1 for STDIO on this board

5
boards/maple-mini/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Frits Kuipers <frits.kuipers@gmail.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -38,8 +39,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "BUTTON",
.pin = BTN_B1_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
}
};

3
boards/microbit/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific configuration for the BBC micro:bit
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -61,7 +62,9 @@ extern "C" {
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 17)
#define BTN0_MODE GPIO_IN
#define BTN1_PIN GPIO_PIN(0, 26)
#define BTN1_MODE GPIO_IN
/** @} */
/**

9
boards/microbit/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -33,13 +34,13 @@ static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "Button A",
.pin = BTN0_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
{
.name = "Button B",
.pin = BTN1_PIN,
.mode = GPIO_IN
.pin = BTN1_PIN,
.mode = BTN1_MODE
},
};

14
boards/nrf52840dk/include/board.h

@ -15,7 +15,7 @@
* @brief Board specific configuration for the nRF52840 DK
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -63,10 +63,14 @@ extern "C" {
* @name Button pin configuration
* @{
*/
#define BUTTON1_PIN (GPIO_PIN(0, 11))
#define BUTTON2_PIN (GPIO_PIN(0, 12))
#define BUTTON3_PIN (GPIO_PIN(0, 24))
#define BUTTON4_PIN (GPIO_PIN(0, 25))
#define BTN0_PIN GPIO_PIN(0, 11)
#define BTN0_MODE GPIO_IN_PU
#define BTN1_PIN GPIO_PIN(0, 12)
#define BTN1_MODE GPIO_IN_PU
#define BTN2_PIN GPIO_PIN(0, 24)
#define BTN2_MODE GPIO_IN_PU
#define BTN3_PIN GPIO_PIN(0, 25)
#define BTN3_MODE GPIO_IN_PU
/** @} */
/**

18
boards/nrf52840dk/include/gpio_params.h

@ -14,7 +14,7 @@
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -54,23 +54,23 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button 1",
.pin = BUTTON1_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
{
.name = "Button 2",
.pin = BUTTON2_PIN,
.mode = GPIO_IN_PU
.pin = BTN1_PIN,
.mode = BTN1_MODE
},
{
.name = "Button 3",
.pin = BUTTON3_PIN,
.mode = GPIO_IN_PU
.pin = BTN2_PIN,
.mode = BTN2_MODE
},
{
.name = "Button 4",
.pin = BUTTON4_PIN,
.mode = GPIO_IN_PU
.pin = BTN3_PIN,
.mode = BTN3_MODE
}
};

14
boards/nrf52dk/include/board.h

@ -15,7 +15,7 @@
* @brief Board specific configuaration for the nRF52 DK
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -62,10 +62,14 @@ extern "C" {
* @name Button pin configuration
* @{
*/
#define BUTTON1_PIN (GPIO_PIN(0, 13))
#define BUTTON2_PIN (GPIO_PIN(0, 14))
#define BUTTON3_PIN (GPIO_PIN(0, 15))
#define BUTTON4_PIN (GPIO_PIN(0, 16))
#define BTN0_PIN GPIO_PIN(0, 13)
#define BTN0_MODE GPIO_IN_PU
#define BTN1_PIN GPIO_PIN(0, 14)
#define BTN1_MODE GPIO_IN_PU
#define BTN2_PIN GPIO_PIN(0, 15)
#define BTN2_MODE GPIO_IN_PU
#define BTN3_PIN GPIO_PIN(0, 16)
#define BTN3_MODE GPIO_IN_PU
/** @} */
/**

18
boards/nrf52dk/include/gpio_params.h

@ -14,7 +14,7 @@
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -54,23 +54,23 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button 1",
.pin = BUTTON1_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
{
.name = "Button 2",
.pin = BUTTON2_PIN,
.mode = GPIO_IN_PU
.pin = BTN1_PIN,
.mode = BTN1_MODE
},
{
.name = "Button 3",
.pin = BUTTON3_PIN,
.mode = GPIO_IN_PU
.pin = BTN2_PIN,
.mode = BTN2_MODE
},
{
.name = "Button 4",
.pin = BUTTON4_PIN,
.mode = GPIO_IN_PU
.pin = BTN3_PIN,
.mode = BTN3_MODE
}
};

6
boards/nucleo-common/include/board_common.h

@ -16,6 +16,7 @@
* @brief Common pin definitions and board configuration options
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_COMMON_H
@ -48,8 +49,11 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
#define BTN0_PIN GPIO_PIN(PORT_C, 13)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/nucleo-common/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -40,8 +41,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
#endif
{
.name = "Button(B1 User)",
.pin = BTN_B1_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

6
boards/nucleo144-common/include/board_common.h

@ -18,6 +18,7 @@
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Vincent Dupont <vincent@otakeys.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_COMMON_H
@ -56,8 +57,11 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
#define BTN0_PIN GPIO_PIN(PORT_C, 13)
#define BTN0_MODE GPIO_IN_PD
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/nucleo144-common/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -48,8 +49,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "B1(User button)",
.pin = BTN_B1_PIN,
.mode = GPIO_IN_PD
.pin = BTN0_PIN,
.mode = BTN0_MODE
}
};

6
boards/opencm904/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the OpenCM9.04 board
*
* @author Loïc Dauphin <loic.dauphin@inria.fr>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -49,8 +50,11 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_C, 15)
#define BTN0_PIN GPIO_PIN(PORT_C, 15)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Pin used to switch RX and TX mode for the Dynamixel TTL bus

13
boards/pba-d-01-kw2x/include/board.h

@ -17,6 +17,7 @@
* @brief Board specific definitions for the phyWAVE evaluation board
*
* @author Johann Fischer <j.fischer@phytec.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -59,18 +60,18 @@ extern "C"
* @name Macro for button S1/S2.
* @{
*/
#define BUTTON_PORT PORTD
#define BUTTON_PIN 1
#define BUTTON_GPIO GPIO_PIN(PORT_D, BUTTON_PIN)
#define BTN0_PORT PORTD
#define BTN0_PIN GPIO_PIN(PORT_D, 1)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**
* @name Macro for capacitive sensor button.
* @{
*/
#define CS_BUTTON_PORT PORTC
#define CS_BUTTON_PIN 6
#define CS_BUTTON_GPIO GPIO_PIN(PORT_C, CS_BUTTON_PIN)
#define BTN1_PORT PORTC
#define BTN1_PIN GPIO_PIN(PORT_C, 6)
#define BTN1_MODE GPIO_IN
/** @} */
/**

8
boards/pba-d-01-kw2x/include/gpio_params.h

@ -48,13 +48,13 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(SW0)",
.pin = BUTTON_GPIO,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
{
.name = "Button(CS0)",
.pin = CS_BUTTON_GPIO,
.mode = GPIO_IN
.pin = BTN1_PIN,
.mode = BTN1_MODE
},
};

4
boards/remote-pa/include/board.h

@ -17,7 +17,8 @@
* @brief Board specific definitions for the Re-Mote board prototype A
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* Antonio Lignan <alinan@zolertia.com>
* @author Antonio Lignan <alinan@zolertia.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -60,6 +61,7 @@
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 3)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**

6
boards/remote-pa/include/gpio_params.h

@ -13,7 +13,7 @@
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author smlng <s@mlng.net>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -48,8 +48,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(User)",
.pin = BTN0_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

4
boards/remote-reva/include/board.h

@ -17,7 +17,8 @@
* @brief Board specific definitions for the RE-Mote board Revision A
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* Antonio Lignan <alinan@zolertia.com>
* @author Antonio Lignan <alinan@zolertia.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -60,6 +61,7 @@
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 3)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**

6
boards/remote-reva/include/gpio_params.h

@ -13,7 +13,7 @@
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author smlng <s@mlng.net>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -48,8 +48,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(User)",
.pin = BTN0_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

4
boards/remote-revb/include/board.h

@ -17,7 +17,8 @@
* @brief Board specific definitions for the RE-Mote board Revision B
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* Antonio Lignan <alinan@zolertia.com>
* @author Antonio Lignan <alinan@zolertia.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -60,6 +61,7 @@
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 3)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**

6
boards/remote-revb/include/gpio_params.h

@ -13,7 +13,7 @@
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author smlng <s@mlng.net>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -48,8 +48,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(User)",
.pin = BTN0_PIN,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

4
boards/samd21-xpro/board.c

@ -17,7 +17,7 @@
*
* @author Travis Griggs <travisgriggs@gmail.com>
* @author Dan Evans <photonthunder@gmail.com>
*
* @author Sebastian Meiling <s@mlng.net>
* @}
*/
@ -30,7 +30,7 @@ void board_init(void)
gpio_init(LED0_PIN, GPIO_OUT);
/* initialize the on-board button */
gpio_init(BUTTON_GPIO, GPIO_IN_PU);
gpio_init(BTN0_PIN, BTN0_MODE);
/* initialize the CPU */
cpu_init();

7
boards/samd21-xpro/include/board.h

@ -19,6 +19,7 @@
*
* @author Travis Griggs <travisgriggs@gmail.com>
* @author Dan Evans <photonthunder@gmail.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -58,9 +59,9 @@ extern "C" {
* @name SW0 (Button) pin definitions
* @{
*/
#define BUTTON_PORT PORT->Group[PA]
#define BUTTON_PIN (15)
#define BUTTON_GPIO GPIO_PIN(PA, BUTTON_PIN)
#define BTN0_PORT PORT->Group[PA]
#define BTN0_PIN GPIO_PIN(PA, 15)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**

5
boards/samd21-xpro/include/gpio_params.h

@ -16,6 +16,7 @@
*
* @author Travis Griggs <travisgriggs@gmail.com>
* @author Dan Evans <photonthunder@gmail.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -40,8 +41,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(SW0)",
.pin = BUTTON_GPIO,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

10
boards/saml21-xpro/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the Atmel SAM L21 Xplained Pro board.
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -42,9 +43,14 @@ extern "C" {
/** @} */
/**
* @brief User button pin
* @name SW0 (Button) pin definitions
* @{
*/
#define SW0_PIN GPIO_PIN(PA, 2)
#define BTN0_PORT PORT->Group[PA]
#define BTN0_PIN GPIO_PIN(PA, 2)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

7
boards/samr21-xpro/include/board.h

@ -17,6 +17,7 @@
* board
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -68,9 +69,9 @@ extern "C" {
* @name SW0 (Button) pin definitions
* @{
*/
#define BUTTON_PORT PORT->Group[0]
#define BUTTON_PIN (28)
#define BUTTON_GPIO GPIO_PIN(0, BUTTON_PIN)
#define BTN0_PORT PORT->Group[0]
#define BTN0_PIN GPIO_PIN(0, 28)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**

5
boards/samr21-xpro/include/gpio_params.h

@ -16,6 +16,7 @@
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -40,8 +41,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "Button(SW0)",
.pin = BUTTON_GPIO,
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

6
boards/stm32f0discovery/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the STM32F0Discovery evaluation board.
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -49,8 +50,11 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/stm32f0discovery/include/gpio_params.h

@ -16,6 +16,7 @@
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -45,8 +46,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "BTN USER",
.pin = BTN_B1_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

7
boards/stm32f3discovery/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the STM32F3Discovery evaluation board
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -85,8 +86,12 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/stm32f3discovery/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -73,8 +74,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "BTN USER",
.pin = BTN_B1_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

7
boards/stm32f4discovery/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the STM32F4Discovery evaluation board
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -78,8 +79,12 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/stm32f4discovery/include/gpio_params.h

@ -16,6 +16,7 @@
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -55,8 +56,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "BTN USER",
.pin = BTN_B1_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

7
boards/stm32f7discovery/include/board.h

@ -16,6 +16,7 @@
* @brief Board specific definitions for the stm32f769 Discovery board
*
* @author Vincent Dupont <vincent@otakeys.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
@ -65,8 +66,12 @@ extern "C" {
/**
* @brief User button
* @{
*/
#define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_PIN GPIO_PIN(PORT_A, 0)
#define BTN0_MODE GPIO_IN
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO

5
boards/stm32f7discovery/include/gpio_params.h

@ -14,6 +14,7 @@
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Vincent Dupont <vincent@otakeys.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef GPIO_PARAMS_H
@ -53,8 +54,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "BTN USER",
.pin = BTN_B1_PIN,
.mode = GPIO_IN
.pin = BTN0_PIN,
.mode = BTN0_MODE
},
};

9
boards/z1/include/board.h

@ -98,11 +98,12 @@ extern "C" {
* @name User button configuration
* @{
*/
#define USER_BTN_PxIN P2IN
#define USER_BTN_MASK 0x20
#define BTN0_PIN P2IN
#define BTN0_MASK (0x20)
#define BTN0_MODE GPIO_IN
#define USER_BTN_PRESSED ((USER_BTN_PxIN & USER_BTN_MASK) == 0)
#define USER_BTN_RELEASED ((USER_BTN_PxIN & USER_BTN_MASK) != 0)
#define BTN0_PRESSED ((BTN0_PIN & BTN0_MASK) == 0)
#define BTN0_RELEASED ((BTN0_PIN & BTN0_MASK) != 0)
/** @} */
/**

Loading…
Cancel
Save