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.
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...
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]](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7164a352-55e3-4a1b-91d1-6ba0bdf316d6%2Fa11d080a-8c73-4f0c-9f66-abef8aedfb5b%2Fkeca243_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY