Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

125 pts Answer the following questions about GPIO registers, configuration and usage. a What is the memory address (in hex) for the GPIO Direction register

image text in transcribed

image text in transcribed

125 pts Answer the following questions about GPIO registers, configuration and usage. a What is the memory address (in hex) for the GPIO Direction register for GPIO Port A? Ox b. What is the memory address (in hex) for the GPIO Digital Enable register for GPIO Port B? c. What is the package pin number (1-64) for GPIO Port C data bit 3, i.e., pin PC3 d. Complete the C code fragment to read the value of PC3 into variable my input. Use an appropriate register name to read from assuming definitions given as in the system hedder III (similar to the definitions shown in the excerpt at the beginning of the exam packet). Assume that the port has already been initialized properly. unsigned char my_input; // Read the value of PC3 my_input = e. Write an initialization function to configure GPIO Port D to use pins 0 and 1 as digital inputs and pins 6 and 7 as digital outputs. All other pins should be unchanged. Use appropriate register names, as would be given in the system header file. void init portD(void) { f. Suppose you see sample C code like below (e.g., in the textbook). Write equivalent code that you would use in the CPRE 288 lab when programming the GPIO port. GPIOA->DEN = 0x03; 125 pts Answer the following questions about GPIO registers, configuration and usage. a What is the memory address (in hex) for the GPIO Direction register for GPIO Port A? Ox b. What is the memory address (in hex) for the GPIO Digital Enable register for GPIO Port B? c. What is the package pin number (1-64) for GPIO Port C data bit 3, i.e., pin PC3 d. Complete the C code fragment to read the value of PC3 into variable my input. Use an appropriate register name to read from assuming definitions given as in the system hedder III (similar to the definitions shown in the excerpt at the beginning of the exam packet). Assume that the port has already been initialized properly. unsigned char my_input; // Read the value of PC3 my_input = e. Write an initialization function to configure GPIO Port D to use pins 0 and 1 as digital inputs and pins 6 and 7 as digital outputs. All other pins should be unchanged. Use appropriate register names, as would be given in the system header file. void init portD(void) { f. Suppose you see sample C code like below (e.g., in the textbook). Write equivalent code that you would use in the CPRE 288 lab when programming the GPIO port. GPIOA->DEN = 0x03

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions