Skip to content
Snippets Groups Projects
Unverified Commit d15f2873 authored by Alexandre Abadie's avatar Alexandre Abadie Committed by GitHub
Browse files

Merge pull request #10414 from gebart/frdm-kw41z/btn-macros

frdm-kw41z: Define BTNx macros for user pushbuttons
parents 58500f92 9e9a01bc
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,20 @@ extern "C" ...@@ -53,6 +53,20 @@ extern "C"
#define LED3_TOGGLE (GPIOA->PTOR = LED3_MASK) #define LED3_TOGGLE (GPIOA->PTOR = LED3_MASK)
/** @} */ /** @} */
/**
* @name Button pin definitions
* @{
*/
/* SW3, SW4 will short these pins to ground when pushed but there are no
* external pull resistors, use internal pull-ups on the pins */
/* BTN0 is mapped to SW3 */
#define BTN0_PIN GPIO_PIN(PORT_C, 4)
#define BTN0_MODE GPIO_IN_PU
/* BTN1 is mapped to SW4 */
#define BTN1_PIN GPIO_PIN(PORT_C, 5)
#define BTN1_MODE GPIO_IN_PU
/** @} */
/** /**
* @name xtimer configuration * @name xtimer configuration
* @{ * @{
......
...@@ -62,13 +62,15 @@ static const saul_gpio_params_t saul_gpio_params[] = ...@@ -62,13 +62,15 @@ static const saul_gpio_params_t saul_gpio_params[] =
}, },
{ {
.name = "SW3", .name = "SW3",
.pin = GPIO_PIN(PORT_C, 4), .pin = BTN0_PIN,
.mode = GPIO_IN_PU .mode = BTN0_MODE,
.flags = (SAUL_GPIO_INVERTED),
}, },
{ {
.name = "SW4", .name = "SW4",
.pin = GPIO_PIN(PORT_C, 5), .pin = BTN1_PIN,
.mode = GPIO_IN_PU .mode = BTN1_MODE,
.flags = (SAUL_GPIO_INVERTED),
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment