Skip to content

Another Look at Embedded C++ with Kvasir

Photo of Richard Thomson
Hosted By
Richard T.
Another Look at Embedded C++ with Kvasir

Details

Last September, we talked about embedded C++ programming (https://www.meetup.com/Utah-Cpp-Programmers/events/233139022/) using the Nintendo GameBoy Advance SP as the target platform. We discussed how C++'s strong type system and zero overhead abstractions should allow us to model special function registers (SFRs) and produce code that is as good or better than hand-written C code with improved safety from fat finger mistakes. We took a brief stab at exploring some of these ideas through enums and hand-written classes modeling an SFR.

Last month, we took a tour through compile-time programming and briefly explored how the mechanisms of templates can serve as a compile-time code generator to create highly efficient code without plunging us deep into low-level details. This lets us write code at an expressive higher level abstraction without giving up any efficiency, or perhaps even gaining efficiency.

This month, we'll revisit embedded C++ programming with the Kvasir (http://kvasir.io/) library. Kvasir leverages features from C++11 and compile-time programming to provide a general purpose model of special function registers and a programming model for using SFRs in an efficient manner.

Topics to be discussed include:

• A review of memory-mapped I/O, SFRs and bit-banding

• Kvasir's model of an SFR as part of a hardware abstraction layer (HAL)

• Explore an example system-on-a-chip (SOC) model shipped with Kvasir

• Kvasir's facilities for handling race conditions and atomic operations

• Revisit the GBA HAL with Kvasir

Food will be provided, so please RSVP so we have a proper head count.

Photo of Utah C++ Programmers group
Utah C++ Programmers
See more events