Commit de948189 authored by Sebastian Meiling's avatar Sebastian Meiling
Browse files

periph: generalized button macros

parent 30be4f76
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
/** @} */

/**
+5 −4
Original line number Diff line number Diff line
@@ -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
@@ -34,12 +35,12 @@ static const saul_gpio_params_t saul_gpio_params[] =
    {
        .name = "Button A",
        .pin  = BTN0_PIN,
        .mode = GPIO_IN
        .mode = BTN0_MODE
    },
    {
        .name = "Button B",
        .pin  = BTN1_PIN,
        .mode = GPIO_IN
        .mode = BTN1_MODE
    },
};

+5 −2
Original line number Diff line number Diff line
@@ -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
/** @} */

/**
+5 −1
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -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
    }
};

Loading