Write C code to set the mode of pin PB 7 to Ob10. Your code should not change the mode of the other pins of Port B.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write C code to set the mode of pin PB 7 to Ob10. Your code should not change the mode of the other pins of
Port B.
Menor y
Addr ess
#def i ne I O vol at ile |/ al I ows read and wr ite
32 bi ts
t ypedef st ruct {
IO ui nt 32_t MODER
I O ui nt 16_t OTYPER
ui nt 16_t rev0;
O ui nt 32_t OSPEEDR // Qut put speed regi st er
O ui nt 32_t PUPDR
O ui nt 16_t I DR
ui nt 16_t rev%;
IO ui nt 16_t DR
ui nt 16_t rev2;
O ui nt 16_t BSRRL;
O ui nt 16_t BSRRH
1O ui nt 32_t LCKR
IO ui nt 32_t AFR 2] ;
IO ui nt 32_t BRR
1 O ui nt 32_t ASCR
} PI O TypeDef
/| Mode regi st er
// Cut put t ype regi st er
/| Paddi ng t wo byt es
O×4800042C
ASOR
Ox48000428
BRR
// Pul I - up/ pul I - down regi st er
// I nput dat a regi st er
// Paddi ng t wo byt es
/| Qut put dat a regi st er
/| Paddi ng t wo byt es
// Bi t set /r eset regi st er (I ow)
// Bi t set /r eset regi st er ( hi gh)
// Conf i gur at i on I ock regi st er
// Alt er nat e funct i on regi st er s
// Bit reset regi st er
// Anal og sw t ch cont r ol regi st er
Ox48000424
AFRI 1]
Ox48000420
AFRI 0]
Ox4800041C
LOKR
Ox48000418 BSRRH BSRRL
Ox48000414
rev2
DR
Ox48000410 rev1
I DR
Ox4800040C
PUPDR
Ox48000408
OSPEEDR
Ox48000404
rev0
OTYPE
Ox48000400
MODER
#def i ne GPI OB ((GPI O_TypeDef *) Ox48000400))
Register 8
NO 5 +MN
MODER
MODER15[1:0]
MODER14[1:0]28
MODER13[1:0]
25
MODER12[1:0]
24
23
MODER11[1:0]22
21
MODER10[1:0]
61
18
MODER9[1:0]
MODER8[1:0]
MODER7[1:0]
14
13
MODER6[1:0]
11
MODER5[1:0]
6
MODER4[1:0]
MODER3[1:0]
MODER2[1:0]
MODER1[1:0]
MODERO[1:0]
Transcribed Image Text:Write C code to set the mode of pin PB 7 to Ob10. Your code should not change the mode of the other pins of Port B. Menor y Addr ess #def i ne I O vol at ile |/ al I ows read and wr ite 32 bi ts t ypedef st ruct { IO ui nt 32_t MODER I O ui nt 16_t OTYPER ui nt 16_t rev0; O ui nt 32_t OSPEEDR // Qut put speed regi st er O ui nt 32_t PUPDR O ui nt 16_t I DR ui nt 16_t rev%; IO ui nt 16_t DR ui nt 16_t rev2; O ui nt 16_t BSRRL; O ui nt 16_t BSRRH 1O ui nt 32_t LCKR IO ui nt 32_t AFR 2] ; IO ui nt 32_t BRR 1 O ui nt 32_t ASCR } PI O TypeDef /| Mode regi st er // Cut put t ype regi st er /| Paddi ng t wo byt es O×4800042C ASOR Ox48000428 BRR // Pul I - up/ pul I - down regi st er // I nput dat a regi st er // Paddi ng t wo byt es /| Qut put dat a regi st er /| Paddi ng t wo byt es // Bi t set /r eset regi st er (I ow) // Bi t set /r eset regi st er ( hi gh) // Conf i gur at i on I ock regi st er // Alt er nat e funct i on regi st er s // Bit reset regi st er // Anal og sw t ch cont r ol regi st er Ox48000424 AFRI 1] Ox48000420 AFRI 0] Ox4800041C LOKR Ox48000418 BSRRH BSRRL Ox48000414 rev2 DR Ox48000410 rev1 I DR Ox4800040C PUPDR Ox48000408 OSPEEDR Ox48000404 rev0 OTYPE Ox48000400 MODER #def i ne GPI OB ((GPI O_TypeDef *) Ox48000400)) Register 8 NO 5 +MN MODER MODER15[1:0] MODER14[1:0]28 MODER13[1:0] 25 MODER12[1:0] 24 23 MODER11[1:0]22 21 MODER10[1:0] 61 18 MODER9[1:0] MODER8[1:0] MODER7[1:0] 14 13 MODER6[1:0] 11 MODER5[1:0] 6 MODER4[1:0] MODER3[1:0] MODER2[1:0] MODER1[1:0] MODERO[1:0]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY