EE 3501 Summer 201 8 Test 2 Name: Consider the following type declaration for a
ID: 3348632 • Letter: E
Question
EE 3501 Summer 201 8 Test 2 Name: Consider the following type declaration for a GPIO register set. necessary to perform the following operations. Note that all other bits not specified MUST be left unchanged. 2. Write the C instructions typedef struct ( volatile uint32 t MODER volatile uint32 t OTYPER volatile uint32 t OSPEEDR: volatile uint32 t PUPDR: volatile uint 32 t IDR volatile uint32 t ODR; volatile uint32 t BSRR volatile uint32 t LCKR volatile uint32_ t AFR[2] volatile uint32_t BRR; volatile uint32_t ASCR; GPIO TypeDef: #define GP10A ((GPIO. TypeDef *) 0x48000000) #define GP10B ((GPIO. TypeDef *) 0x48000400) (a) Set only bit 3 and 6 of the output speed register for port B (b) Hold in a wait loop until input pin 2 of port A goes high (c) Store the lower 4 bits of port B input into integer variable x (d) Set bits 3 and 2 in port A mode register to "10" (binary)Explanation / Answer
A) set b.p(3)
set b.p(6)
B) while(A.p(6)=!1)
wait;
C)STORE B(0123) ,X;
D) SET A.P(3)=10;
SET A.p(6)=10;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.