From 2b0892996e43affd44e9406548ad6f6db039bd5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se>
Date: Sat, 17 Nov 2018 21:15:03 +0100
Subject: [PATCH] frdm-k64f: Define BTNx macros for user pushbuttons

---
 boards/frdm-k64f/include/board.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/boards/frdm-k64f/include/board.h b/boards/frdm-k64f/include/board.h
index 4c92b56f28..647f51acde 100644
--- a/boards/frdm-k64f/include/board.h
+++ b/boards/frdm-k64f/include/board.h
@@ -53,6 +53,20 @@ extern "C"
 #define LED2_TOGGLE        (GPIOB->PTOR = LED2_MASK)
 /** @} */
 
+/**
+ * @name    Button pin definitions
+ * @{
+ */
+/* SW2, SW3 will short these pins to ground when pushed. PTA4 has an external
+ * pull-up resistor to VDD, but there is no external pull resistor on PTC6 */
+/* BTN0 is mapped to SW2 */
+#define BTN0_PIN            GPIO_PIN(PORT_C,  6)
+#define BTN0_MODE           GPIO_IN_PU
+/* BTN1 is mapped to SW3 */
+#define BTN1_PIN            GPIO_PIN(PORT_A,  4)
+#define BTN1_MODE           GPIO_IN_PU
+/** @} */
+
 /**
  * @name    FXOS8700CQ 3-axis accelerometer and magnetometer bus configuration
  * @{
-- 
GitLab