Muutke küpsiste eelistusi

E-raamat: Exploring the Raspberry Pi 2 with C++

  • Formaat: PDF+DRM
  • Ilmumisaeg: 26-Nov-2015
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484217399
  • Formaat - PDF+DRM
  • Hind: 49,39 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: PDF+DRM
  • Ilmumisaeg: 26-Nov-2015
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484217399

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

You have a Pi 2, but what exactly can you do with it? This book takes you on a tour of the Pi 2 hardware and all of the fantastic things that you can do to create innovative and useful projects with your Pi. Start with creating a workstation that does actual work, and move into installing a custom kernel, creating a clock, learning the ins and outs of the GPIO interface, and pick up some useful C++ skills along the way.

Warren Gay, author of Mastering the Raspberry Pi, takes you through a set of experiments to show just what the Pi 2 is capable of and how you can use it to make your own fantastic creations.

What You Will Learn:
  • How to create an experimenter's workstation for the Pi 2, complete with breadboard and even Arduino
  • All the details of GPIO, including a custom command for working with it
  • Useful projects like a general purpose clock and the PiSpy
  • Quick intro to C++ for the Pi
  • How to make a multi-core webserver

Who this book is for:
Intermediate electronics enthusiasts and Pi fans, makers, students, teachers, and everyone who wants to know how to make the Pi really work.

About the Author xvii
Acknowledgments xix
Chapter 1 Introduction
1(4)
Overview
1(1)
Software for This Book
2(1)
Software Installation
3(1)
Installation Notes
4(1)
Thank You
4(1)
Chapter 2 Workstation
5(14)
The Raspberry Pi 2 Arrives
5(1)
The Raspberry Pi 2 pcb
6(1)
Constructing the Workstation
7(4)
Breadboard Breakout
11(2)
RS-232 Connection
13(3)
Panel Meter
16(2)
Arduino/AVR
18(1)
Summary
18(1)
Chapter 3 The Matrix (CPU Utilization)
19(12)
The LED Matrix
19(1)
Level Converters
20(1)
Interfacing GPIO to MAX7219
21(1)
Absolute Maximum Ratings
22(1)
MAX7219 Commands
23(1)
Display Data Commands
24(1)
Decode Mode Command
24(1)
Intensity Command
25(1)
Scan-Limit Command
25(1)
Shutdown Command
25(1)
Test Mode Command
25(1)
No Operation Command
26(1)
Matrix Signals
26(1)
CPU Meter
27(1)
The mtop Command
28(1)
Bibliography
29(2)
Chapter 4 Installing a Kernel
31(16)
Overall Procedure
31(1)
Disk Space
32(1)
Downloading the Source
32(1)
Raspberry Tools
33(1)
Prepare Configuration
33(1)
Build Configuration
33(1)
Kernel Compile
34(2)
Modules Build
36(1)
Installing the Kernel
37(2)
Reboot
39(1)
Recovering from Boot Failure
39(1)
Installing the rpidma Kernel Module
40(2)
Autoloading rpidma
42(1)
Specific Kernel Releases
43(3)
Summary
46(1)
Bibliography
46(1)
Chapter 5 GPIO gp Command
47(14)
Unix Command Line Convention
47(2)
The gp Command
49(1)
Displaying GPIO Settings
50(1)
Configuring GPIO as Input
51(1)
Configuring GPIO as Output
51(1)
Configuring GPIO as Alternate Function
51(1)
Chart of Alternate Functions
52(1)
Configuring GPIO Pullup/Pulldown
52(1)
Setting GPIO Output
53(1)
Reading GPIO Input
53(1)
Returning GPIO Value to Shell
54
Reading
32(22)
GPIOs
54(1)
Read GPIO Alternate Function
54(1)
Blinking Output GPIO
55(1)
Monitoring GPIO Input
55(1)
Configuring GPIO Slew Rate
56(1)
Configuring GPIO Hysteresis
57(1)
Configuring GPIO Drive Level
58(1)
Summary
59(1)
Bibliography
59(2)
Chapter 6 General Purpose Clock
61(12)
The piclk Command
61(1)
Displaying Clock Settings
62(2)
Clock Source
64(1)
Clock DIVI
64(1)
MASH and DIVF
65(1)
Determining DIVI and DIVF
66(1)
Beat Frequency Oscillator
67(2)
Audio Coverage
69(1)
Maximum GPIO Output Frequency
70(1)
RF Generation
70(1)
Summary
71(1)
Bibliography
71(2)
Chapter 7 Pulse Width Modulation
73(10)
The pipwm Command
73(1)
Displaying PWM Settings
74(3)
PWM Modes
77(1)
M/S and PWM Data Mode
77(1)
M/P = M/S Mode (-Am)
78(2)
M/P = PWM Mode (-Ap)
80(2)
Data Modes
82(1)
Summary
82(1)
Bibliography
82(1)
Chapter 8 Physics of the GPIO Interface
83(12)
CMOS
83(1)
MOSFETs in Action
84(1)
CMOS Configuration
85(2)
CMOS Inputs
87(1)
Input Protection
87(1)
CMOS Outputs
88(2)
Logic Levels
90(2)
GPIO Drive
92(1)
CMOS Usage Rules
93(1)
Summary
94(1)
Bibliography
94(1)
Chapter 9 PiSpy
95(10)
Introduction to pispy
95(1)
Pispy Command Options
95(1)
Capture Length
96(1)
Capture Resolution
96(1)
Verbose Option
97(1)
Option -x
97(1)
Triggers
98(1)
GtkWave
98(1)
Invoking GTKWave
99(1)
Using GTKWave
100(1)
Testing PiSpy
101(1)
GTKWave Hints
101(1)
PiSpy in a Nutshell
102(1)
Summary
103(1)
Bibliography
103(2)
Chapter 10 Debouncing
105(8)
Introduction
105(2)
Momentary Debouncing
107(1)
Toggled Debouncing
107(2)
The MC14490
109(3)
Summary
112(1)
Chapter 11 C++ Quick Start
113(20)
C++Standards
113(1)
From C to C++
114(1)
Classes and Structs
115(1)
Standard Template Library
115(3)
Container Std::vector
118(1)
STL Iterators
119(1)
Container::operator[ ]
120(1)
Container::at()
120(1)
Ordered and Unordered Maps
120(2)
Initializer Lists
122(1)
Iterating Maps
122(1)
References
122(2)
Map vs. Set
124(1)
Container std::deque
125(1)
Safe Iterators
125(1)
Containers of Containers
126(2)
C++Strings
128(2)
String Streams
130(1)
Predefined Compiler Macros
131(1)
Summary
131(1)
Bibliography
131(2)
Chapter 12 Multicore Web Server
133(8)
Libevent
133(1)
Class WebMain
133(2)
WebMain::startO
135(1)
Worker Design
136(1)
Server Shutdown
137(1)
HTTP Processing
137(1)
Permissions
138(1)
How Many Threads?
139(1)
To Do
139(1)
Summary
139(2)
Appendix A Class GPIO 1
141(10)
Assertion Macro Note
141(1)
Include File
142(1)
Linking with the GPIO Library
142(1)
Class Definition (Part 1)
142(9)
GPIO-GPIO Constructor
143(2)
GPIO::get_error
145(1)
GPIO::configure
145(2)
GPIO::events_off
147(1)
GPIO::read
147(1)
GPIO::write
147(1)
GPIO::read_event
148(1)
GPIO::clear_event
148(1)
GPIO::read_events
149(1)
GPIO::alt_function
149(1)
GPIO::get_drive_strength
149(1)
GPIO::set_drive_strength
150(1)
Appendix B Class GPIO 2
151(12)
Class Definition (Part 2)
151(12)
GPIO::config_clock
152(2)
GPIO::start_clock
154(1)
GPIO::stop_clock
155(1)
GPIO::pwm_conf igure
155(2)
GPIO::pwm_ratio
157(1)
GPIO::pwm_enable
157(1)
GPIO::pwm_clear_status
158(1)
GPIO::pwm_write_fifo
159(1)
GPIO::pwm_fifo_full
159(1)
GPIO::pwm_fifo_empty
159(1)
GPIO::get_pwm_ratio
160(1)
GPIO::pwm_control
160(1)
GPIO::pwm_status
161(2)
Appendix C Class GPIO 3
163(4)
Class Definition (Part 3)
163(4)
GPIO::pwm
164(1)
GPIO::delay
164(1)
GPIO::peripheral_base
164(1)
GPIO::source_name
165(1)
GPIO::alt_name
165(1)
GPIO::gpio_alt_func
165(2)
Appendix D Class MAX7219
167(6)
Include File
167(1)
Linking
167(1)
Class Definition
168(4)
MAX7219::MAX7219
168(1)
MAX7219::enable
169(1)
MAX7219::config_intensity
169(1)
MAX7219::config_digits
170(1)
MAX7219::config_decode
170(1)
MAX7219::data
171(1)
MAX7219::test
171(1)
MAX7219::shutdown
171(1)
MAX7219::nop
172(1)
Initialization Procedure
172(1)
Appendix E Class Matrix
173(6)
Include File
173(1)
Linking
173(1)
Class Definition
174(5)
Matrix-Matrix
174(1)
Matrix::display
175(1)
Matrix::Pi
175(1)
Matrix::set_meter
176(1)
Matrix::set_def lection
177(2)
Appendix F Class MTop and Diskstat
179(6)
Include Files
179(1)
Linking
179(1)
MTop Class Definition
179(3)
MTop::MTop
180(1)
MTbp::sample
180(1)
MTop::total_cpu_pct
181(1)
MTop::memory_pct
181(1)
MTop::swap_pct
182(1)
MTop Sampling Loop Timing
182(1)
Diskstat Class Definition
183(2)
Diskstat::Diskstat
183(1)
Diskstat::pct_io
184(1)
Appendix G Other Iibrpi2 Classes
185(2)
DMA Allocation
185(1)
Warning
186(1)
Index 187
Warren Gay has been an electronics enthusiast since childhood and often dragged discarded TV sets home after school. In high school he learned to program the IBM-1130 and then pursued a career in software development at Ryerson Polytechnical, in Toronto. Since then he has worked professionally for over 30 years, mainly in C/C++, under Unix and Linux.



Meanwhile, the love of electronics has never faded since the early creation of his home-brewed Intel 8008 system in the 70's to the present day projects employing the Raspberry Pi. Warren also holds an advanced amateur radio license and was able to work the Mir space station (U2MIR) using packet radio in August 1991.



He's authored other books including Mastering Raspberry Pi for Apress, Sams Teach Yourself Linux in 24 Hours, Linux Socket Programming by Example, and Advanced Unix Programming.