#include #include #include #include #include //#include RCGCGPIO = _PORTC|_PORTD|_PORTF; // allow time for clock to stabilize while((SYSCTL->PRGPIO & (_PORTC|_PORTD|_PORTF)) != (_PORTC|_PORTD|_PORTF)){}; // 2. Unlock GPIO GPIOF->LOCK = 0x4C4F434B; GPIOF->CR |= 0x01; // 3. Clear AMSEL to disable analog // 4. Config PCTL to select GPIO GPIOC->PCTL= 0x000000; // 5. Set DIR to 0 for input, 1 for output GPIOC -> DIR |= _PIN5; GPIOD -> DIR = 0x0; GPIOF -> DIR = _PIN0|_PIN1|_PIN3; // 6. Enable AFSEL bits to 1 GPIOC -> AFSEL |= _PIN5; // 7. Set PUE bits to 1 to enable internal pull-up GPIOD -> PDR= _PIN6; GPIOF -> PUR= _PIN0; // 8. Set DEN bits to 1 to enable data pins GPIOF->DEN= _PIN1 | _PIN4 | _PIN2; } //------------------------------------------------------------------------------