Barr Group FacebookBarr Group TwitterBarr Group LinkedInBarr Group Vimeo

Course Overview

Course Length: 
2 Days
CEUs: 
1.5
Format: 
Hands-on/Lecture

C++ offers the same low-level language facilities as C, including bitfields, bitwise operators, and casts. Therefore, you can use C++ to write device drivers that are every bit as efficient as they would be in C. However, such low-level code is often hard to write and maintain, and is rarely portable. Using higher level features of C++, you can implement low-level device drivers that are much easier to read and maintain. Moreover, if you exploit C++ really well, you can write drivers that are almost, if not just, as efficient as they would be in C.

This seminar illustrates techniques involving classes, nested constants and types, user-defined conversions, the const and volatile type qualifiers, and overloading. It also provides a look under the hood to see how compilers and linkers implement C++ language features, giving you the insight you need to avoid many performance pitfalls.

Syllabus

The following is a summary of the major course topics and are not the section-by-subsection lecture breakdown.

  • Introduction
    • What You Are Expected to Know
    • Standard Terminology
  • Tools of the Trade
    • Real Hardware
    • Alternative Tool Chains
  • Pragmatic Programming Concerns
    • Dreaded Code Bloat
    • The Embedded C++ (EC++) Dialect
    • Programming in EC++ plus Templates
    • Adapting to Different Compilers
    • Minimizing Library Usage
  • The Const and Volatile Qualifiers
    • Placing Const and Volatile in Declarations
    • Writing Const T vs. T Const
    • Understanding Const and Volatile as Promises
    • Qualification Conversions
    • Const and Volatile Member Functions
  • Programming a Segmented Display
    • Accessing Device Registers from C
    • Lighting a Segmented Display
    • Inadvertent Inefficiencies from Volatile Data
    • Using Enumerations
    • Overloading for a Better Interface
    • A Segmented Character Class Type
    • A Better Model of Device Registers
  • Programming Other Devices
    • Lighting Individual LEDs
    • Capturing Commonality in a Base Class
    • Pushing a Button
    • Filtered and Unfiltered Button Classes
    • Reading Slide Switches
    • Using a Timer to Keep Time
    • Read-only and Write-only Registers
    • Chatting with a Serial Port
  • Interrupt Handling
    • Direct and Indirect Interrupt Service Routines
    • C Linkage and Interfacing C++ with the Assembly Code
    • Installing Interrupt Service Routines
    • A Timer Interrupt Handler
    • Race Conditions and Mutual Exclusion
    • Atomic Access and Atomic Types
    • Interrupt-Driven Pushbuttons and Serial Ports
    • More Disciplined Approaches
    • A More General Interrupt Dispatcher Using Polymorphism

Audience

  • Embedded software developers seeking to enhance their C++ skills
  • Embedded software developers moving (or considering a move) from C to C++

Prerequisites

Attendees should arrive with a working familiarity of the C programming language and prior exposure to basic C++ terminology such as classes, member functions, and constructors/destructors.

Related Courses

Find out More

To find out more about our upcoming public trainings, go to our Training Calendar.

Contact Us to find out more about this course or to enquire about an on-site training at your company.

Recording Policy

All Barr Group Training Public and On-site courses may not be audiotaped, videotaped or photographed without consent from Barr Group's executive team.  Barr Group reserves the right to record portions or all of a training course for instructional purposes.  As a result, attendees present may also appear on the recording.