You are previewing Raspberry Pi Hardware Reference.
O'Reilly logo
Raspberry Pi Hardware Reference

Book Description

The Raspberry Pi is deceptively simple. Plug it in, boot it up, and use it as a personal computer, or attach a million gizmos and modules and invent something new and amazing. Either way, what it can actually do is not simple, and you should know exactly what the Raspberry Pi hardware is all about. Raspberry Pi Hardware Reference, from Mastering the Raspberry Pi, is the hardware guide you need on your desk or workbench.

Every detail is covered: from power to memory, from the CPU to working with USB. You'll find all the details about working with both wired and wireless Ethernet, SD cards, and the UART interface. The GPIO chapter is invaluable, covering power budgeting, access, and even small but important details like the correct usage of sudo when working with GPIO pins. You'll also find details about the 1-Wire driver, the I2C bus, and the SPI bus. If you need to know anything about your Raspberry Pi's hardware, you will find it here, in Raspberry Pi Hardware Reference.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. About the Technical Reviewer
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: The Raspberry Pi
    1. Models
    2. Hardware in Common
    3. Which Model?
  12. Chapter 2: Power
    1. Calculating Power
    2. Current Requirement
    3. Peripheral Power
    4. Model B Input Power
    5. Model A Input Power
    6. 3.3 Volt Power
    7. Powered USB Hubs
    8. Power Adapters
      1. An Unsuitable Supply
      2. E-book Adapters
      3. Best Power Source
      4. Voltage Test
    9. Battery Power
      1. Requirements
      2. Headroom
      3. LM7805 Regulation
      4. DC-DC Buck Converter
    10. Signs of Insufficient Power
    11. No Power
  13. Chapter 3: Header Strips, LEDs, and Reset
    1. Status LEDs
      1. OK or ACT LED
      2. PWR LED
      3. FDX LED
      4. LNK LED
      5. 10M or 10/100 LED
    2. Header P1
      1. Safe Mode
      2. Logic Levels
      3. GPIO Configuration at Reset
      4. 1-Wire Driver
    3. Header P5
    4. Reset
  14. Chapter 4: SDRAM
    1. /proc/meminfo
      1. MemTotal
      2. MemFree
      3. Buffers
      4. Cached
      5. SwapCached
      6. Active
      7. Inactive
      8. Active(anon)
      9. Inactive(anon)
      10. Active(file)
      11. Inactive(file)
      12. Unevictable
      13. Mlocked
      14. SwapTotal
      15. SwapFree
      16. Dirty
      17. Writeback
      18. AnonPages
      19. Mapped
      20. Shmem
      21. Slab
      22. SReclaimable
      23. SUnreclaim
      24. KernelStack
      25. PageTables
      26. NFS_Unstable
      27. Bounce
      28. WritebackTmp
      29. CommitLimit
      30. Committed_AS
      31. VmallocTotal
      32. VmallocUsed
      33. VmallocChunk
    2. Physical Memory
    3. Memory Mapping
      1. Address
      2. Length
      3. Protection
      4. Flags
      5. File Descriptor
      6. Offset
      7. Return Value
      8. Volatile
    4. Virtual Memory
    5. Final Thoughts on SDRAM
  15. Chapter 5: CPU
    1. Identification
    2. Overclocking
    3. Execution
    4. Threads
      1. pthread Headers
      2. pthread Error Handling
      3. pthread_create(3)
      4. pthread_attr_t
      5. pthread_join(3)
      6. pthread_detach(3)
      7. pthread_self(3)
      8. pthread_kill(3)
    5. Mutexes
      1. pthread_mutex_create(3)
      2. pthread_mutex_destroy(3)
      3. pthread_mutex_lock(3)
      4. pthread_mutex_unlock(3)
    6. Condition Variables
      1. pthread_cond_init(3)
      2. pthread_cond_destroy(3)
      3. pthread_cond_wait(3)
      4. pthread_cond_signal(3)
      5. pthread_cond_broadcast(3)
  16. Chapter 6: USB
    1. Power
    2. Powered Hubs
    3. USB API Support
      1. libusb
      2. Include Files
  17. Chapter 7: Ethernet
    1. Wired Ethernet
      1. /etc/network/interfaces
      2. Changing to Static IP
      3. Test Static IP Address
      4. USB Adapters
      5. /etc/hosts File
    2. Wireless Ethernet
      1. Configuration
  18. Chapter 8: SD Card Storage
    1. SD Card Media
    2. SD Card Interface
    3. SD Card Basics
    4. Raspbian Block Size
      1. Disk Cache
    5. Capacities and Performance
    6. Transfer Modes
      1. SPI Bus Mode
      2. 1-bit SD Mode
      3. 4-bit SD Mode
    7. Wear Leveling
  19. Chapter 9: UART
    1. RS-232 Converter
      1. DTE or DCE
    2. RS-232
      1. Start Bit
      2. Data Bits
      3. Parity Bit
      4. Stop Bit(s)
      5. Baud Rate
      6. Break
      7. Flow Control
    3. Raspberry Pi UARTs
    4. ARM PL011 UART
      1. RTS/CTS Access
      2. PL011 UART Features
    5. Exclusive Serial Line Use
      1. Procedure
      2. Verification
    6. Serial API
      1. Header Files
      2. open(2)
      3. struct termios
      4. tcgetattr(3)
      5. tcsetattr(3)
      6. tcsendbreak(3)
      7. tcdrain(3)
      8. tcflush(3)
      9. tcflow(3)
      10. cfmakeraw(3)
      11. cfgetispeed(3)
      12. cfgetospeed(3)
      13. cfsetispeed(3)
      14. cfsetospeed(3)
      15. cfsetspeed(3)
      16. read(2)
      17. write(2)
      18. readv(2) and writev(2)
      19. Error EINTR
  20. Chapter 10: GPIO
    1. Pins and Designations
    2. Configuration After Reset
    3. Pull-up Resistors
      1. Configuring Pull-up Resistors
      2. Testing Pull-up State
    4. Logic Levels
    5. Drive Strength
      1. Input Pins
      2. Output Pins
      3. Driving Bi-color LEDs
      4. Testing Drive Strength
    6. GPIO Current Budget
    7. Configuration
      1. Alternate Function Select
      2. Output Pins
      3. Input Pins
      4. Alternate Function
    8. Sysfs GPIO Access
      1. export
      2. unexport
      3. gpioX
      4. Chip Level
    9. GPIO Tester
    10. GPIO Input Test
    11. Floating Potentials
    12. Reading Events
      1. Test Run
    13. Direct Register Access
      1. gpio_init()
      2. gpio_config()
      3. gpio_write()
      4. gpio_read()
      5. gpio_io.c
    14. GPIO Transistor Driver
      1. Driver Design
      2. Substitution
      3. Inductive Loads
      4. Driver Summary
    15. Utility gpio
      1. Displaying GPIO Settings
      2. Reading GPIO
      3. Writing GPIO
      4. Modify Drive Levels
  21. Chapter 11: 1-Wire Driver
    1. 1-Wire Line and Power
    2. Line Driving
    3. Master and Slave
    4. Protocol
      1. Reset
      2. Data I/O
    5. Slave Support
    6. Reading Temperature
      1. Bus Master
      2. Slave Devices
      3. Reading the Temperature
    7. 1-Wire GPIO Pin
  22. Chapter 12: I2C Bus
    1. I2C Overview
    2. SDA and SCL
    3. Multimaster and Arbitration
    4. Bus Signaling
    5. Data Bits
    6. Message Formats
    7. Which I2C Bus?
    8. I2C Bus Speed
    9. Tools
    10. I2C API
      1. Kernel Module Support
      2. Header Files
      3. open(2)
      4. ioctl(2,I2C_FUNC)
      5. ioctl(2,I2C_RDWR)
  23. Chapter 13: SPI Bus
    1. SPI Basics
    2. SPI Mode
    3. Signaling
    4. Slave Selection
    5. Driver Support
    6. SPI API
      1. Open Device
      2. SPI Mode Macros
      3. Bits per Word
      4. Clock Rate
      5. Data I/O
      6. Close
      7. Write
      8. Read
    7. SPI Testing
  24. Appendix A: Glossary
  25. Appendix B: Power Standards
  26. Appendix C: Electronics Reference
    1. Ohm’s Law
    2. Power
    3. Units
  27. Index