▶Book Description
C++ is a great choice for embedded development, most notably, because it does not add any bloat, extends maintainability, and offers many advantages over different programming languages. Hands-On Embedded Programming with C++17 will show you how C++ can be used to build robust and concurrent systems that leverage the available hardware resources.
Starting with a primer on embedded programming and the latest features of C++17, the book takes you through various facets of good programming. You'll learn how to use the concurrency, memory management, and functional programming features of C++ to build embedded systems. You will understand how to integrate your systems with external peripherals and efficient ways of working with drivers. This book will also guide you in testing and optimizing code for better performance and implementing useful design patterns. As an additional benefit, you will see how to work with Qt, the popular GUI library used for building embedded systems.
By the end of the book, you will have gained the confidence to use C++ for embedded programming.
▶What You Will Learn
⦁ Choose the correct type of embedded platform to use for a project
⦁ Develop drivers for OS-based embedded systems
⦁ Use concurrency and memory management with various microcontroller units (MCUs)
⦁ Debug and test cross-platform code with Linux
⦁ Implement an infotainment system using a Linux-based single board computer
⦁ Extend an existing embedded system with a Qt-based GUI
⦁ Communicate with the FPGA side of a hybrid FPGA/SoC system
▶Key Features
⦁ Know how C++ works and compares to other languages used for embedded development
⦁ Create advanced GUIs for embedded devices to design an attractive and functional UI
⦁ Integrate proven strategies into your design for optimum hardware performance
▶Who This Book Is For
If you want to start developing effective embedded programs in C++, then this book is for you. Good knowledge of C++ language constructs is required to understand the topics covered in the book. No knowledge of embedded systems is assumed.
▶What this book covers
⦁ Chapter 1, What Are Embedded Systems? makes you familiar with what an embedded system entails. By looking at the various categories and examples of embedded systems in each category, a good overview of what is meant with the term embedded and the wide variety within that term should be formed. It explores the wide range of historic and currently available microcontrollers and system-on-chip solutions you can find in existing systems as well as new designs.
⦁ Chapter 2, C++ as an Embedded Language, explains why C++ is actually as nimble as C and similar languages. Not only is C++ generally at least as fast as C, there is no additional bloat, and it offers many advantages with code paradigms and maintainability.
⦁ Chapter 3, Developing for Embedded Linux and Similar Systems, explains how to develop for Linux-based embedded systems and kin on SBCs and manage the differences between Linux-based and PC-based development.
⦁ Chapter 4, Resource-Restricted Embedded Systems, deals with planning for and using limited resources efficiently. We will take a look at how to select the right MCU for a new project and add peripherals and deal with Ethernet and serial interface requirements in a project. We will also look at an example AVR project, how to develop for other MCU architectures, and whether to use an RTOS.
⦁ Chapter 5, Example – Soil Humidity Monitor with Wi-Fi, explains how to create a Wi-Fienabled soil humidity monitor with actuator options for a pump or similar. Using the builtin web server, you can use its browser-based UI for monitoring and control, or integrate it into a larger system using its REST API.
⦁ Chapter 6, Testing OS-Based Applications, looks at how to develop and test embedded OSbased applications. You will learn how to install and use a cross-compilation toolchain, do remote debugging using GDB, and write a build system.
⦁ Chapter 7, Testing Resource-Restricted Platforms, shows how to effective develop for MCUbased targets. You will also see how to implement an integration environment that allows us to debug MCU-based applications from the comfort of a desktop OS and the tools it provides.
⦁ Chapter 8, Example – Linux-Based Infotainment System, explains how you can fairly easily construct an SBC-based infotainment system, using voice-to-text to construct a voice-driven UI. We will also look at how we can extend it to add even more functionality.
⦁ Chapter 9, Example – Building Monitoring and Control, shows how a building-wide monitoring and management system is developed, what its components looks like, and what lessons are learned during its development.
⦁ Chapter 10, Developing Embedded Systems with Qt, looks at the myriad of ways in which the Qt framework can be used to develop for embedded systems. We will look at how it compares with other frameworks and how Qt is optimized for these embedded platforms, before working through an example of a QML-based GUI that can be added to the previously-created infotainment system.
⦁ Chapter 11, Developing for Hybrid SoC/FPGA Systems, teaches you how to communicate with the FPGA side of a hybrid FPGA/SoC system and helps you understand how a variety of algorithms are implemented in FPGA and used on the SoC side. You will also learn how to implement a basic oscilloscope on a hybrid FPGA/SoC system.
⦁ Appendix, Best Practices, runs through a number of common issues and pitfalls that are likely to occur while working on an embedded software design.