Adding Structure to Your Code


We will do three things

1. We will describe how to use an object-oriented style of
programming with C programs, allowing the creation of


libraries of code that can be easily adapted for use in different
embedded projects;

2. We will describe how to create and use a ‘Project Header’
file. This file encapsulates key aspects of the hardware
environment, such as the type of processor to be used, the
oscillator frequency and the number of oscillator cycles
required to execute each instruction. This helps to document
the system, and makes it easier to port the code to a different
processor.

3. We will describe how to create and use a ‘Port Header’ file.
This brings together all details of the port access from the
whole system. Like the Project Header, this helps during
porting and also serves as a means of documenting important
system features.