boards: unify user button defines

This commit is contained in:
Alexandre Abadie 2021-12-19 17:31:59 +01:00
parent ffecd0110a
commit 4877155e23
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
8 changed files with 28 additions and 16 deletions

View File

@ -84,9 +84,12 @@ extern "C" {
/** @} */ /** @} */
/** /**
* @brief User button * @name User button pin configuration
* @{
*/ */
#define BTN_B1_PIN GPIO_PIN(PORT_B, 2) #define BTN0_PIN GPIO_PIN(PORT_B, 2) /**< User button pin */
#define BTN0_MODE GPIO_IN_PU /**< User button pin mode */
/** @} */
/** /**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO * @brief Initialize board specific hardware, including clock, LEDs and std-IO

View File

@ -55,8 +55,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
}, },
{ {
.name = "Button(B1 User)", .name = "Button(B1 User)",
.pin = BTN_B1_PIN, .pin = BTN0_PIN,
.mode = GPIO_IN_PU .mode = BTN0_MODE
}, },
}; };

View File

@ -47,9 +47,12 @@ extern "C" {
/** @} */ /** @} */
/** /**
* @brief User button * @name User button pin configuration
* @{
*/ */
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13) #define BTN0_PIN GPIO_PIN(PORT_C, 13) /**< User button pin */
#define BTN0_MODE GPIO_IN_PU /**< User button pin mode */
/** @} */
/** /**
* @name HTS221 temperature/humidity sensor configuration * @name HTS221 temperature/humidity sensor configuration

View File

@ -47,8 +47,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
}, },
{ {
.name = "Button(B1 User)", .name = "Button(B1 User)",
.pin = BTN_B1_PIN, .pin = BTN0_PIN,
.mode = GPIO_IN_PU, .mode = BTN0_MODE,
.flags = SAUL_GPIO_INVERTED .flags = SAUL_GPIO_INVERTED
} }
}; };

View File

@ -42,9 +42,12 @@ extern "C" {
/** @} */ /** @} */
/** /**
* @brief User button * @name User button pin configuration
* @{
*/ */
#define BTN_B1_PIN GPIO_PIN(PORT_B, 3) #define BTN0_PIN GPIO_PIN(PORT_B, 3) /**< User button pin */
#define BTN0_MODE GPIO_IN_PU /**< User button pin mode */
/** @} */
/** /**
* @brief Initialize board specific hardware, including clock, LEDs and stdio * @brief Initialize board specific hardware, including clock, LEDs and stdio

View File

@ -40,8 +40,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
}, },
{ {
.name = "Button(B1 User)", .name = "Button(B1 User)",
.pin = BTN_B1_PIN, .pin = BTN0_PIN,
.mode = GPIO_IN_PU, .mode = BTN0_MODE,
.flags = SAUL_GPIO_INVERTED .flags = SAUL_GPIO_INVERTED
} }
}; };

View File

@ -56,9 +56,12 @@ extern "C" {
/** @} */ /** @} */
/** /**
* @brief User button * @name User button pin configuration
* @{
*/ */
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13) #define BTN0_PIN GPIO_PIN(PORT_C, 13) /**< User button pin */
#define BTN0_MODE GPIO_IN /**< User button pin mode */
/** @} */
/** /**
* @name si7034 temperature sensor configuration * @name si7034 temperature sensor configuration

View File

@ -51,8 +51,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
}, },
{ {
.name = "Button(B1 User)", .name = "Button(B1 User)",
.pin = BTN_B1_PIN, .pin = BTN0_PIN,
.mode = GPIO_IN, .mode = BTN0_MODE,
}, },
}; };