Skip to main content

Low-Level Hardware Drivers in C++

  • Chapter
  • First Online:
Real-Time C++
  • 4596 Accesses

Abstract

Microcontroller applications usually require low-level drivers for peripheral devices such as I/O ports, interrupts, timers, communication interfaces like UART, CAN (ISO, ISO 11898–1:2003: Road Vehicles – Controller Area Network (CAN) – Part 1: data link layer and physical signaling, International Organization for Standardization, Geneva, 2003), SPITM, etc. This chapter presents several efficient methods for programming peripheral hardware drivers in C++. Low-level drivers are inherently dependent on the microcontroller and its peripherals. Even though the low-level hardware drivers in this chapter are primarily designed for our target with the 8-bit microcontroller, an effort has been made to keep them as portable as possible. In this way, they can be adapted to other microcontrollers. The final two sections in this chapter present complete, non-trivial examples. The first (chapter09_07) controls a seven-segment display (Horowitz and Hill, The art of electronics, 2nd edn., Cambridge University Press, Cambridge, 1989). The second (chapter09_08) produces colorful light by animating an RGB LED.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. ATMEL®, 8-bit ATMEL ® Microcontroller with 4/8/16/32K Bytes In-System Programmable Flash (ATmega48A, ATmega48PA, ATmega88A, ATmega88PA, ATmega168A, ATmega168PA, ATmega328, ATmega328P), Rev. 8271D–AVR–05/11 (ATMEL®, 2011)

    Google Scholar 

  2. Free Software Foundation, The GNU Compiler Collection Version 4.6.2 (2012), http://gcc.gnu.org

  3. Free Software Foundation, The GNU Compiler Collection Version 7.2.0 (2017), http://gcc.gnu.org

  4. P. Horowitz, W. Hill, The Art of Electronics, 2nd edn. (Cambridge University Press, Cambridge, 1989)

    Google Scholar 

  5. ISO, ISO 11898–1:2003: Road Vehicles – Controller Area Network (CAN) – Part 1: Data Link Layer and Physical Signaling (International Organization for Standardization, Geneva, 2003)

    Google Scholar 

  6. ISO/IEC, ISO/IEC 9899:1999: Programming Languages – C (International Organization for Standardization, Geneva, 1999)

    Google Scholar 

  7. ISO/IEC, ISO/IEC 14882:2011: Information Technology – Programming Languages – C++ (International Organization for Standardization, Geneva, 2011)

    Google Scholar 

  8. ISO/IEC, ISO/IEC 14882:2014: Information Technology – Programming Languages – C++ (International Organization for Standardization, Geneva, 2014)

    Google Scholar 

  9. ISO/IEC, ISO/IEC 14882:2017: Information Technology – Programming Languages – C++ (International Organization for Standardization, Geneva, 2017)

    Google Scholar 

  10. W. van Hagen, The Definitive Guide to GCC (Apress, Berkeley, 2006)

    Google Scholar 

  11. Wikipedia, American Wire Gauge (2012), http://en.wikipedia.org/wiki/American_wire_gauge

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer-Verlag GmbH Germany, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Kormanyos, C. (2018). Low-Level Hardware Drivers in C++. In: Real-Time C++. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-56718-0_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-56718-0_9

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-56717-3

  • Online ISBN: 978-3-662-56718-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics