You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
921 B
C

#include "TM4C123GH6PM.h"
#include "bsp.h"
#include <intrinsics.h>
int main() {
SYSCTL->RCGCGPIO |= (1U << 5); /* enable Run mode for GPIOF */
SYSCTL->GPIOHBCTL |= (1U << 5); /* enable AHB for GPIOF */
/* make sure the Run Mode and AHB-enable take effects
* before accessing the peripherals
*/
__ISB(); /* Instruction Synchronization Barrier */
__DSB(); /* Data Memory Barrier */
GPIOF_AHB->DIR |= (LED_RED | LED_BLUE | LED_GREEN);
GPIOF_AHB->DEN |= (LED_RED | LED_BLUE | LED_GREEN);
/* turn all LEDs off */
GPIOF_AHB->DATA_Bits[LED_RED | LED_BLUE | LED_GREEN] = 0U;
SysTick->LOAD = SYS_CLOCK_HZ/2U - 1U;
SysTick->VAL = 0U;
SysTick->CTRL = (1U << 2) | (1U << 1) | 1U;
SysTick_Handler();
__enable_interrupt();
while (1) {
GPIOF_AHB->DATA_Bits[LED_GREEN] = LED_GREEN;
GPIOF_AHB->DATA_Bits[LED_GREEN] = 0U;
}
//return 0;
}