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.
Preview
Unable to display preview. Download preview PDF.
References
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)
Free Software Foundation, The GNU Compiler Collection Version 4.6.2 (2012), http://gcc.gnu.org
P. Horowitz, W. Hill, The Art of Electronics, 2nd edn. (Cambridge University Press, Cambridge, 1989)
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)
ISO/IEC, ISO/IEC 9899:1999: Programming Languages—C (International Organization for Standardization, Geneva, 1999)
ISO/IEC, ISO/IEC 14882:2011: Information Technology—Programming Languages—C++ (International Organization for Standardization, Geneva, 2011)
W. van Hagen, The Definitive Guide to GCC (Apress, Berkeley, 2006)
Wikipedia, American wire gauge (2012), http://en.wikipedia.org/wiki/American_wire_gauge
Author information
Authors and Affiliations
Corresponding author
Rights 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)