Synopsis
Chapter 1 Concepts for Developing Portable Firmware .............3
Why Code Reuse Matters.................................................................................3
Portable Firmware ............................................................................................5
Modularity ......................................................................................................... 11
Module Coupling and Cohesion.................................................................. 12
Following A Standard .................................................................................... 14
Portability Issues in C - Data Types ......................................................... 15
Portability Issues in C - Structures and Unions................................... 17
Portability Issues in C - Bit Fields............................................................. 18
Portability Issues in C - Preprocessor Directives ............................... 19
Hardware Abstraction Layers (HAL) ....................................................... 21
Application Programming Interfaces (APIs) ........................................ 28
Project Organization...................................................................................... 28
Getting Started Writing Portable Firmware ......................................... 29
Going Further ................................................................................................... 32
Chapter 2 API and HAL Fundamentals.............................................37
The Wonderful World of HALs ................................................................... 37
APIs versus HALs............................................................................................. 38
The API and HAL Landscape ....................................................................... 40
The Good, Bad and Ugly................................................................................ 42
Potential Issues and the Boogeyman....................................................... 42
Characteristics Every HAL should Exhibit ............................................. 46
To Build or Not to Build................................................................................ 56
A First Look at a HAL...................................................................................... 58
The API Scope ................................................................................................... 59
API Characteristics to look for ................................................................... 60
Designing your own APIs ............................................................................. 65
A First Look at an API .................................................................................... 65
Going Further ................................................................................................... 67
Confidential - ©2016 Jacob Beningo, All Rights Reserved, DRAFT A08
Chapter 3 Device Driver Fundamentals in C..................................73
Understanding the Memory Map...............................................................73
Identifying Driver Interfaces.......................................................................77
Design by Contract..........................................................................................80
Assertion Fundamentals...............................................................................83
Device Driver Models .....................................................................................85
Polled versus Interrupt Driven Drivers
"synopsis" may belong to another edition of this title.