Skip to content

Commit

Permalink
frdm-kw41z: Define BTNx macros for user pushbuttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Nov 16, 2018
1 parent 836fe3d commit 38f8cc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions boards/frdm-kw41z/include/board.h
Expand Up @@ -53,6 +53,20 @@ extern "C"
#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
* @{
Expand Down
8 changes: 4 additions & 4 deletions boards/frdm-kw41z/include/gpio_params.h
Expand Up @@ -62,13 +62,13 @@ static const saul_gpio_params_t saul_gpio_params[] =
},
{
.name = "SW3",
.pin = GPIO_PIN(PORT_C, 4),
.mode = GPIO_IN_PU
.pin = BTN0_PIN,
.mode = BTN0_MODE,
},
{
.name = "SW4",
.pin = GPIO_PIN(PORT_C, 5),
.mode = GPIO_IN_PU
.pin = BTN1_PIN,
.mode = BTN1_MODE,
},
};

Expand Down

0 comments on commit 38f8cc2

Please sign in to comment.