Initialized some more ports

This commit is contained in:
Rajput R Vikramsingh Vikramsingh 2024-09-17 12:17:24 +05:30
parent e199fec0c0
commit 83a8b28d36
2 changed files with 15 additions and 4 deletions

16
lab5.c
View File

@ -2,6 +2,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "tm4c123gh6pm.h" #include "tm4c123gh6pm.h"
void GPIOIntHandler(void);
int main(void) int main(void)
{ {
SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */ SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */
@ -10,8 +11,17 @@ int main(void)
GPIO_PORTF_DEN_R = 0x1F; /* set PORTF pins 5 pins*/ GPIO_PORTF_DEN_R = 0x1F; /* set PORTF pins 5 pins*/
GPIO_PORTF_DIR_R = 0x0E; /* set PORTF0 PORTF4 pin as input user switch pin */ GPIO_PORTF_DIR_R = 0x0E; /* set PORTF0 PORTF4 pin as input user switch pin */
GPIO_PORTF_PUR_R = 0x11; /* PORTF4 PORT0 is pulled up */ GPIO_PORTF_PUR_R = 0x11; /* PORTF4 PORT0 is pulled up */
GPIO_PORTF_IM_R = 0x11 /*Masking the ports*/ GPIO_PORTF_IM_R = 0x11; /*Masking the ports*/
GPIO_PORTF_IS_R = 0x00;
GPIO_PORTF_IEV_R = 0x00; /*detects the falling edge of the switch*/ GPIO_PORTF_IEV_R = 0x00; /*detects the falling edge of the switch*/
GPIO_PORTF_IBE_R = 0x00
} }
while(1)
{
}

View File

@ -33,6 +33,7 @@ void ResetISR(void);
static void NmiSR(void); static void NmiSR(void);
static void FaultISR(void); static void FaultISR(void);
static void IntDefaultHandler(void); static void IntDefaultHandler(void);
void GPIOIntHandler(void);
//***************************************************************************** //*****************************************************************************
// //
@ -113,7 +114,7 @@ void (* const g_pfnVectors[])(void) =
IntDefaultHandler, // Analog Comparator 2 IntDefaultHandler, // Analog Comparator 2
IntDefaultHandler, // System Control (PLL, OSC, BO) IntDefaultHandler, // System Control (PLL, OSC, BO)
IntDefaultHandler, // FLASH Control IntDefaultHandler, // FLASH Control
IntDefaultHandler, // GPIO Port F GPIOIntHandler, // GPIO Port F
IntDefaultHandler, // GPIO Port G IntDefaultHandler, // GPIO Port G
IntDefaultHandler, // GPIO Port H IntDefaultHandler, // GPIO Port H
IntDefaultHandler, // UART2 Rx and Tx IntDefaultHandler, // UART2 Rx and Tx