02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5<br />

Driver <strong>Guide</strong>lines<br />

Maintenance and Readability<br />

Most code work is maintenance. Thus, any effort that makes maintenance simpler<br />

is valuable. Adherence to coding standards and quality documentation makes<br />

code easy to read, easy to understand, and easy to maintain. The concern should<br />

be on why things happen. Poor quality documentation is just as bad as insufficient<br />

documentation. All new documentation should be reviewed by at least one other<br />

person.<br />

5<br />

Ease of Configuration<br />

Drivers should not limit the end-user’s options or requirements. Do not impose<br />

limits on the number of devices to be supported or other features. You may not be<br />

able to support all features or modes for a device, but the design should not<br />

preclude their support at a later time.<br />

Performance Testing<br />

All drivers must be tested for performance. In addition to writing the driver, the<br />

engineer must also consider test routines. This involves inserting debug<br />

information as well as benchmark tests. If a standard benchmark test is not<br />

available, then the engineer must consider writing one. Performance testing<br />

should be considered for all types of device drivers, ethernet, SCSI, serial, timers,<br />

interrupt controllers, and the like.<br />

Code Size<br />

In the embedded RTOS market, code size is important. Code size should be<br />

minimized through good structured design. Reducing code size can hurt<br />

performance. The engineer must balance the design to provide performance<br />

without excessive code size.<br />

Reentrancy<br />

Drivers should be fully re-entrant in order to support any number of devices.<br />

Drivers that limit the number of supported devices are not desirable. Instead of<br />

fixed arrays of device information, the user should create a structure for each new<br />

device and pass it to the driver for initialization and control. Alternatively, the<br />

91

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

Saved successfully!

Ooh no, something went wrong!