From 608539ba406a508050e12af6d97eaf3efe713f76 Mon Sep 17 00:00:00 2001 From: Aravind Date: Sat, 21 Sep 2024 19:49:14 +0530 Subject: [PATCH] Initial commit --- main.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..c0c6018 --- /dev/null +++ b/main.c @@ -0,0 +1,30 @@ +#include +#include +#include "tm4c123gh6pm.h" + +int main(void) +{ + SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */ + GPIO_PORTF_LOCK_R = 0x4C4F434B; /* unlock commit register */ + GPIO_PORTF_CR_R = 0x1F; /* make PORTF0 configurable */ + GPIO_PORTF_DEN_R = 0x1E; /* set PORTF pins 4 pin */ + GPIO_PORTF_DIR_R = 0x0E; /* set PORTF4 pin as input user switch pin */ + GPIO_PORTF_PUR_R = 0x10; /* PORTF4 is pulled up */ + + GPIO_PORTF_IS_R = (~(1<<4)); + GPIO_PORTF_IBE_R = (~(1<<4)); + GPIO_PORTF_IEV_R = (~(1<<4)); + GPIO_PORTF_IM_R = (1<<4); + + GPIO_PORTF_AHB_ICR_R = (1<<4); + + NVIC_EN0_R |= (1<<30); + + + + while(1) + { + + } + +}