#include "bump.h" #include "inc/msp432p401r.h" #define BUMP_PINS 0b11101101 void BumpInit(void) { // Port 4 pins 0, 2, 3, 5, 6, 7 // and enables internal resistors P4->SEL0 &= ~BUMP_PINS; P4->SEL1 &= ~BUMP_PINS; // 1) configure P4.0 P4.2 P4.3 P4.5 P4.6 P4.7 as gpio P4->DIR &= ~BUMP_PINS; // 2) configure as input P4->REN |= BUMP_PINS; // 3) enable pull resisors } uint8_t BumpRead(void) { // write this as part of Lab 2 return P4->IN & BUMP_PINS; }