using c ,, please comment every line Write a code to initialize PA4-0 as inputs
ID: 3585424 • Letter: U
Question
using c ,, please comment every line
Write a code to initialize PA4-0 as inputs and PA6 as output in function PortAlnit below. Use friendly code only. (half credit will be given to unfriendly code) #define GPIOPORTADATAR #define GPIOPORTADIRR #define GPIOPORTA. AFSELR #define GPIO-PORTA, DENR #define GPIOPORTA. AMSELR #define GPIOPORTAPCTLR #define SYSCTLRCGC2R "((volatile unsigned long )0x400043FC) ("((volatile unsigned long *)0x40004400)) ("((volatile unsigned long *)0x40004420)) (*(volatile unsigned long 0x4000451C) (((volatile unsigned long *)0x40004528)) (*((volatile unsigned long ")0x4000452C) ((volatile unsigned long )0x400FE108)) - - - - - - - - - - - void PortA Init(void)tExplanation / Answer
/* commens included in
#define GPIO_PORTA_DATA_R (*((volatile unsigned long *)0*400043FC))
#define GPIO_PORTA_DIR_R (*((volatile unsigned long *)0*40004400))
#define GPIO_PORTA_AFSEL_R (*((volatile unsigned long *)0*40004420))
#define GPIO_PORTA_DEN_R (*((volatile unsigned long *)0*4000451C))
#define GPIO_PORTA_AMSEL_R (*((volatile unsigned long *)0*40004528))
#define GPIO_PORTA_PCTL_R (*((volatile unsigned long *)0*4000452C))
#define SYSCTL_RCGC2_R (*((volatile unsigned long *)0*400FE108))
End of comment*/
void PortA_Init(void){
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.