万本电子书0元读

万本电子书0元读

顶部广告

Raspberry Pi Computer Architecture Essentials电子书

售       价:¥

6人正在读 | 0人评论 9.8

作       者:Andrew K. Dennis

出  版  社:Packt Publishing

出版时间:2016-03-22

字       数:155.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Explore Raspberry Pi's architecture through innovative and fun projects About This Book Explore Raspberry Pi 2’s hardware through the Assembly, C/C++, and Python programming languages Experiment with connecting electronics up to your Raspberry Pi 2 and interacting with them through software Learn about the Raspberry Pi 2 architecture and Raspbian operating system through innovative projects Who This Book Is For Raspberry Pi Computer Architecture Essentials is for those who are new and those who are familiar with the Raspberry Pi. Each topic builds upon earlier ones to provide you with a guide to Raspberry Pi’s architecture. From the novice to the expert, there is something for everyone. A basic knowledge of programming and Linux would be helpful but is not required. What You Will Learn Set up your Raspberry Pi 2 and learn about its hardware Write basic programs in Assembly Language to learn about the ARM architecture Use C and C++ to interact with electronic components Find out about the Python language and how to use it to build web applications Interact with third-party microcontrollers Experiment with graphics and audio programming Expand Raspberry Pi 2’s storage mechanism by using external devices Discover Raspberry Pi 2’s GPIO pins and how to interact with them In Detail With the release of the Raspberry Pi 2, a new series of the popular compact computer is available for you to build cheap, exciting projects and learn about programming. In this book, we explore Raspberry Pi 2’s hardware through a number of projects in a variety of programming languages. We will start by exploring the various hardware components in detail, which will provide a base for the programming projects and guide you through setting up the tools for Assembler, C/C++, and Python. We will then learn how to write multi-threaded applications and Raspberry Pi 2’s multi-core processor. Moving on, you’ll get hands on by expanding the storage options of the Raspberry Pi beyond the SD card and interacting with the graphics hardware. Furthermore, you will be introduced to the basics of sound programming while expanding upon your knowledge of Python to build a web server. Finally, you will learn to interact with the third-party microcontrollers. From writing your first Assembly Language application to programming graphics, this title guides you through the essentials. Style and approach This book takes a step-by-step approach to exploring Raspberry Pi’s architecture through projects that build upon each other. Each project provides you with new information on how to interact with an aspect of the Raspberry Pi and Raspbian operating system, providing a well-rounded guide.
目录展开

Raspberry Pi Computer Architecture Essentials

Table of Contents

Raspberry Pi Computer Architecture Essentials

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Introduction to the Raspberry Pi's Architecture and Setup

History and background of the Raspberry Pi

Raspberry Pi hardware specifications

Dimensions

System on Chip

CPU

GPU

SDRAM

4 USB 2.0 ports and 1 SoC on-board USB

MicroSD card port

Ethernet port

Audio

GPIO pins

Video – analog TV out

Video – HDMI port

Basic hardware needed

The microSD card – the main storage and boot device of the Raspberry Pi 2

Preinstalled microSD card versus creating your own

The NOOBS operating system installation manager

Downloading the latest version of Raspbian

Setting up your microSD card and installing the Raspbian operating system

Raspbian installation wrap-up

Check SSH is running

RSA key generation for SSH

Linux and Mac RSA key generation

Windows RSA key generation

Assign a static IP to your Raspberry Pi 2

Installing Screen and Vim

Vim – an optional handy text editor

Running tests on the OS and configuration changes

Diagnostic tests

Over and underclocking the Raspberry Pi

Going further – testing the GPIO pins

Some handy Linux commands

Troubleshooting

Summary

2. Programming on Raspbian

Which programming languages?

Assembly language

Assembling and linking

The C and C++ languages

C – a brief introduction

A quick look at C++

Our first C program

Geany – a handy text editor and development environment

Creating a new C program

C libraries – a trove of reusable code

The C (and C++) compiler

Compiling and running our application

The Python language

A simple Python program

Running a Python program from a file

Summary

3. Low-Level Development with Assembly Language

Back to basics

Multiline comments

Directives

Single line comments

Registers

Branching

The assembler

The linker

Makefiles

Memory and addresses

The .data directive

The .balign directive

Words

Labels

The memory

The addresses

LDR and SUB

Running our program

Adding power to our program – control structures

If else statements

Iteration

Testing our control structures

Summary

4. Multithreaded Applications with C/C++

What are threads?

Thread types

User level threads

Kernel level threads

Hybrid threads

POSIX threads

Steps involved in implementing threads

Creation and termination

Synchronization

Scheduling

An example in C

Trying out our program

A C++ equivalent

The g++ command

Going further – mutexes and joins

Compile and test

Summary

5. Expanding on Storage Options

Booting up

Setting up the external HDD

Getting the disk name

Setting up the HDD

Modifying cmdline.txt

Network-attached storage (NAS)

Installing Samba

Testing the NAS

Mac

Linux

Windows

Summary

6. Low-Level Graphics Programming

VideoCore IV GPU

Sample programs

Accessing the frame buffer

Check the display settings

Testing our C code

Filling the screen with a color

A C program to turn the screen red

Compile and run the C program

Drawing a line

Plotting pixels and drawing lines

Compile and run

Next steps – polygons

Summary

7. Exploring the Raspberry Pi's GPIO Pins

Introduction to GPIO pins

Standard GPIO

I2C

Serial Rx and Tx

SPI

PWM and PPM

GPIO power voltages

Hardware choices

Prototyping shields and boards

Cooking Hacks Arduino bridge shield

Connecting directly to the GPIO pins

Switching an LED on and off

Setting up the hardware

C blinking LED program

Python blinking LED program

Reading data from the GPIO pins in Python

Summary

8. Exploring Sound with the Raspberry Pi 2

Introduction to the Raspberry Pi's sound

Configuring the audio output

Setting the audio output

Interacting with audio through GPIO

Installing the audio drivers

Hardware setup

Loading drivers

Getting some drum tracks

Python drum machine

Audio shields for the Raspberry Pi

C and ALSA

ALSA examples

Introducing Sonic Pi

Setup

Experimenting with Sonic Pi

Summary

9. Building a Web Server

Introduction to web servers

HTTP requests

HTML

Popular web servers available on the Raspberry Pi

Apache

NGINX

Building a Python web server

Python web server code

Adding an index page and a favicon

Adding database support

SQLite

SQL – a quick overview

Python program with SQLite support

Flask – displaying database data via Python

Next steps

Summary

10. Integrating with Third-Party Microcontrollers

Genuino/Arduino microcontroller

Setting up the Arduino software

Installing the IDE on your Raspberry Pi 2

A quick guide to the Arduino IDE

Integration with Arduino

Serial communication over USB

Communication between the Arduino and Raspberry Pi via GPIO

Communication over I2C

Communication over the Web

Summary

11. Final Project

Choose your storage mechanism

Building a Flask-based website

Adding a database

A basic website

Web forms

Add

Edit

Adding in an LED

Building the circuit – a recap

Integrating with our Python app

Extending the project further

Replace the LED with a screen

E-mail support

Playing a sound

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部