Skip to main content

Low-Level Hardware Drivers in C++

  • Chapter
  • First Online:
Real-Time C++
  • 3238 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, 2003) [4], SPI\(^{\mathrm{{{TM}}}}\), 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 section in this chapter presents a complete, non-trivial example of controlling a seven-segment display.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. ATMEL\(^{\textregistered }\): 8-bit ATMEL \(^{\textregistered }\) 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\(^{\textregistered }\), 2011)

    Google Scholar 

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

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

    Google Scholar 

  4. 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 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  8. Wikipedia, American wire gauge (2012), http://en.wikipedia.org/wiki/American_wire_gauge

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christopher Kormanyos .

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

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

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-47809-7

  • Online ISBN: 978-3-662-47810-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics