Merge pull request #10424 from gebart/frdm-k22f/btn-macros

frdm-k22f: Define BTNx macros for user pushbuttons
This commit is contained in:
Kevin "Bear Puncher" Weiss 2018-11-23 13:49:57 +01:00 committed by GitHub
commit c699eef9cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,20 @@ extern "C"
#define LED2_TOGGLE (GPIOD->PTOR = LED2_MASK) #define LED2_TOGGLE (GPIOD->PTOR = LED2_MASK)
/** @} */ /** @} */
/**
* @name Button pin definitions
* @{
*/
/* SW2, SW3 will short these pins to ground when pushed. Both pins have external
* pull-up resistors to VDD */
/* BTN0 is mapped to SW2 */
#define BTN0_PIN GPIO_PIN(PORT_C, 1)
#define BTN0_MODE GPIO_IN
/* BTN1 is mapped to SW3 */
#define BTN1_PIN GPIO_PIN(PORT_B, 17)
#define BTN1_MODE GPIO_IN
/** @} */
/** /**
* @name FXOS8700CQ 3-axis accelerometer and magnetometer bus configuration * @name FXOS8700CQ 3-axis accelerometer and magnetometer bus configuration
* @{ * @{