02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

5.5 Step by Step<br />

The general order shall be to design from the top down, but to implement and test<br />

from the bottom-up.<br />

Top-Down Design<br />

Top-down design means planning and documenting before starting any actual<br />

coding.<br />

■<br />

Template File<br />

Start from a template file or an existing driver. A template file is preferred.<br />

Starting from an existing file usually brings in all the problems of the other<br />

driver code. Wind River provides template files for all classes of drivers.<br />

■<br />

Module Description<br />

Find the chip manual and copy the introductory description of the chip into<br />

the module description body. Then, add paragraphs detailing how this driver<br />

is to work, which parts of the chip will be controlled, and the operating modes<br />

that will be supported.<br />

■<br />

Device Structures<br />

Start by defining a basic per-device data structure and a per-driver data<br />

structure. These structures define the state of the driver and each device. As<br />

structures, the debugger can display the complete state of either with a single<br />

print command.<br />

■<br />

Macro Definitions<br />

Document any macros that can be used to customize the driver for different<br />

applications, such as chip access macros, memory access macros, and the like.<br />

Tell the user what the macros do and how they are defined for the default<br />

situation.<br />

■<br />

Subroutine Declarations<br />

Declare all the subroutines you think the customer and <strong>BSP</strong> writer need to use<br />

this driver. Try to follow the device design with the software design as much<br />

as possible.<br />

■<br />

Block Out Functions<br />

Create the banners and declarations for all the routines you plan to write.<br />

Leave the bodies empty until you are really ready to write code. Write the<br />

subroutine description in the comment block. The comments in the comment<br />

100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!