About
include "TM4C123GH6PM.h"
int main(void) { unsigned int value; SYSCTL->RCGCGPIO |= 0x30; GPIOF->DIR = 0x0E;GPIOE->DIR= 0xFF; GPIOE->DEN= 0xFF; GPIOF->DEN = 0x1E; GPIOF->PUR = 0x10;
while(1)
{
value = GPIOF->DATA;
if(!value)
{
GPIOE->DATA = 0xFF;
}
else
{
GPIOE->DATA = 0x00;
}
} }
void SystemInit(void) {
SCB->CPACR |= 0x00F00000;
}
}
void delayMs(int n)
{
int i, j;
for(i = 0 ; i < n; i++)
for(j = 0; j < 3180; j++)
{} / do nothing for 1 ms /
}