Hi Team,
Our customer would like to know how to set up GPIO pin PJ0 of TM4C1294NCPD as an input with a pull-down resistor. Below is his source code.
void SW_Init(void){ 
 SYSCTL->RCGCGPIO |= 0x00000100; // activate clock for Port J 
 while((SYSCTL->PRGPIO&0x00000100) == 0){;} // allow time for clock to stabilize
GPIOJ_AHB->DIR &= ~0x01; // make PJ0 in //& PJ1 in 
 GPIOJ_AHB->AFSEL &= ~0x01; // disable alt funct on PJ0 & PJ1
 GPIOJ_AHB->PUR |= 0x00; // disable pull-up on PJ0
 GPIOJ_AHB->PDR |= 0x01; // enable pull-down on PJ0 
 GPIOJ_AHB->DEN |= 0x01; // enable digital I/O on PJ0 //& PJ1
 GPIOJ_AHB->AMSEL &= ~0x01; // disable analog functionality on PJ0 //& PJ1
 GPIOJ_AHB->PCTL = (GPIOJ_AHB->PCTL & 0xFFFFFFF0)+0x00000000;
 
 GPIOJ_AHB->IM &=~0x01; // Clear GPIOM before programming GPIOS,GPIOBE,GPIOEV
 GPIOJ_AHB->ICR|= 0x01; // Clear Interrupt Flag
 GPIOJ_AHB->IS &=~0x01; // PJ0 is edge-sensitive //& PJ1 are
 GPIOJ_AHB->IBE &=~0x01; // PJ0 & PJ1 Interrupt is triggered by single edge
// GPIOJ_AHB->IEV &=~0x01; // PJ0 Interrupt is triggered by falling edge
 GPIOJ_AHB->IEV |= 0x01; // PJ0 Interrupt is triggered by rising edge
 GPIOJ_AHB->IM |= 0x01; // Enable PJ0 //& PJ1
 NVIC_EN1_R |=0x00080000; // Enable Interrupt number 51 which is bit 19 in EN1 
 NVIC_PRI12_R = (NVIC_PRI12_R&0x00FFFFFF)|0x80000000; //Set the priority value to 4 in INTD of PRI12 Register. (page 159/160) 
}
Thank you for your support.
Regards,
Danilo