Real-Time C++: Efficient Object-Oriented and Template by Christopher Kormanyos

By Christopher Kormanyos

The C++ language has strong object-oriented and template gains which could enhance software program layout and portability whereas at the same time decreasing code complexity and the chance of blunders. additionally, C++ compiles hugely effective local code. This targeted and potent blend makes C++ well-suited for programming microcontroller structures that require compact dimension, excessive functionality and safety-critical reliability.

With this e-book, Chris Kormanyos can provide a hugely functional advisor to programming real-time embedded microcontroller structures in C++. it really is divided into 3 elements plus a number of appendices. half I presents a origin for real-time C++ via masking language applied sciences, together with object-oriented equipment, template programming and optimization. subsequent, half II provides certain descriptions of a number of C++ parts which are well-known in microcontroller programming. It information a few of C++’s strongest language components, comparable to category kinds, templates and the STL, to strengthen elements for microcontroller sign up entry, low-level drivers, customized reminiscence administration, embedded bins, multitasking, and so on. ultimately, half III describes mathematical tools and favourite utilities that may be hired to resolve ordinary difficulties in real-time C++. The appendices contain a short C++ language educational, info at the real-time C++ improvement atmosphere and directions for construction GNU GCC cross-compilers and a microcontroller circuit.

The most up-to-date specification of C++11 in ISO/IEC 14882:2011 is used in the course of the textual content. To facilitate portability, no libraries except these laid out in the language general itself are used. potency is often in concentration and various examples are sponsored up with real-time functionality measurements and measurement analyses that quantify the real expenses of the code right down to the final byte and microsecond.

The target market of this e-book mostly comprises scholars and execs attracted to real-time C++. Readers could be acquainted with C or one other programming language and should gain such a lot in the event that they have had a few prior adventure with microcontroller electronics and the functionality and dimension matters usual in embedded platforms programming.

Show description

Read or Download Real-Time C++: Efficient Object-Oriented and Template Microcontroller Programming PDF

Best design & architecture books

Operational Amplifiers: Theory and Design

Operational Amplifiers – concept and layout, moment variation offers a scientific circuit layout of operational amplifiers. Containing cutting-edge fabric in addition to the necessities, the publication is written to entice either the circuit clothier and the process dressmaker. it truly is proven that the topology of all operational amplifiers will be divided into 9 major total configurations.

Computer and Information Security Handbook

The second edition of this accomplished guide of laptop and knowledge security provides the main entire view of laptop defense and privateness to be had. It deals in-depth assurance of protection idea, know-how, and perform as they relate to proven applied sciences in addition to contemporary advances.

Languages, Design Methods, and Tools for Electronic System Design: Selected Contributions from FDL 2015

This booklet brings jointly a variety of the simplest papers from the eighteenth version of the discussion board on specification and layout Languages convention (FDL), which came about on September 14-16, 2015, in Barcelona, Spain. FDL is a well-established foreign discussion board dedicated to dissemination of study effects, sensible studies and new principles within the software of specification, layout and verification languages to the layout, modeling and verification of built-in circuits, complicated hardware/software embedded platforms, and mixed-technology structures.

Extra resources for Real-Time C++: Efficient Object-Oriented and Template Microcontroller Programming

Example text

End(), static_cast(0U)); // Do something with the counters. // ... 13 The STL’s library has some particularly useful algorithms for microcontroller programming including, among others, std::accumulate() and std::inner_product() which can be used for things like checksums, vectormatrix mathematics, etc. The functions in can reduce code complexity and bring the heart of the algorithm at hand into clear focus. See Sect. 8 for further information on .

Namespace for the microcontroller abstraction layer. namespace mcal { // The mcal initialization. void init(); // The general purpose timer stuff in the mcal. namespace gpt { void init(); std::uint32_t get_time_elapsed(); } // The ADC stuff in the mcal. namespace adc { void init(); std::uint16_t read_value(const unsigned); } } // Initialize the mcal. // Note the clean organization with namespaces. , an anonymous namespace) can be used for filelevel localization. 5 Basic Classes It is not difficult to start working with class types in C++.

In C++, std::array can be used as a drop-in replacement for C-style arrays. Since std::array is a sequential STL container, it offers the benefits of iterators, container size, compatibility with STL algorithms, etc. The std::array container has the added benefit of size known at compiletime. The compiler can, therefore, allocate storage for an std::array where it needs to—on the stack, in static memory, on-the-fly for an std::array declared as a constexpr, etc. Using std::array eliminates concerns about potential memory fragmentation from dynamic memory allocation and allocators (Sect.

Download PDF sample

Rated 4.93 of 5 – based on 6 votes