Introduction We will do three things in this seminar: 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. | Seminar 4 Adding Structure to Your Code Pins and used for RS-232 interface Switches sbit Sw_up P1A2 sbit SW down P1A3 Ị Up Ị I Down I Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - 77 Introduction We will do three things in this seminar 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. We will use all three of these techniques in the code examples presented in subsequent seminars. Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - 78 Object-Oriented Programming with C Language generation Example languages - Machine Code First-Generation Language 1GL Assembly Language. Second-Generation Languages 2GLs COBOL FORTRAN Third-Generation Languages 3GLs C Pascal Ada 83 Fourth-Generation Languages 4GLs C Java Ada 95 Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - .