Device Driver Template
7-28
7.9 Device Driver Template
Since device drivers interact directly with hardware, the low-level details of
device drivers can vary considerably. However, all device drivers must
present the same interface to SIO. In the following sections, an example
driver template called Dxx is presented. The template contains (mainly) C
code for higher-level operations and pseudocode for lower-level operations.
Any device driver should adhere to the standard behavior indicated for the
Dxx functions.
You should study the Dxx driver template along with one or more actual
drivers. You can also refer to the Dxx functions in the
TMS320 DSP/BIOS API
Reference Guide
for your platform where xx denotes any two-letter
combination. For details about configuring device drivers, including both
custom drivers and the drivers provided with DSP/BIOS, you need to
reference the specific device driver.
7.9.1
Typical File Organization
Device drivers are usually split into multiple files. For example:
❏
dxx.h—Dxx header file
❏
dxx.c—Dxx functions
❏
dxx_asm.s##—(optional) assembly language functions
Most of the device driver code can be written in C. The following description
of Dxx does not use assembly language. However, interrupt service routines
are usually written in assembly language for efficiency, and some hardware
control functions also need to be written in assembly language.
We recommend that you become familiar at this point with the layout of one
of the software device drivers, such as DGN. In particular, you should note
the following points:
❏
The header file, dxx.h, typically contains the required statements shown
in Example 7-17 in addition to any device-specific definitions:
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...