From 3329c47d5d824f501dde7ee16cb9e7da4515ed1b Mon Sep 17 00:00:00 2001 From: Uttam Ambappa Bhavimani Date: Mon, 28 Oct 2024 22:50:00 +0530 Subject: [PATCH] Update main.c Initialize GPIO Port F --- main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.c b/main.c index f7c4a51..8a5bce8 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,19 @@ #include #include #include "tm4c123gh6pm.h" + +void GPIO_PORT_F_init(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 = 0x1F; // SET PORTF DIGITAL ENABLE + GPIO_PORTF_DIR_R = 0x0E; // SET PF0, PF4 as input and PF1, PF2 and PF3 as output + GPIO_PORTF_PUR_R = 0x11; // PORTF PF0 and PF4 IS PULLED UP + + NVIC_EN0_R |= 1 << 30; + GPIO_PORTF_IS_R = 0x00; // EDGE SENSITIVE + GPIO_PORTF_IBE_R = 0x00; // ONE EDGE + GPIO_PORTF_IEV_R = 0x00; // INTERRUPT EVENT FALLING + GPIO_PORTF_IM_R |= 0x11; // UNMASK INTERRUPT +} \ No newline at end of file