Comparing Driver Models
6-6
The following sub-sections describe how to create user-defined devices
when using various I/O driver objects and models. For details on API function
calls and configuration parameters see the TMS320 DSP/BIOS API
Reference Guide for your platform.
6.3.1 Creating a Device for Use with an IOM Mini-Driver
If you plan to use an IOM mini-driver with the GIO class driver, create a user-
defined device statically or with a DEV_createDevice call similar to that
shown below:
DEV_Attrs gioAttrs = {
NULL,
/* device id */
NULL, /* device parameters */
DEV_IOMTYPE, /* type of the device */
NULL /* device global data ptr */
};
status = DEV_createDevice("/codec", &DSK6X_EDMA_IOMFXNS,
(Fxn)DSK6X_IOM_init, &gioAttrs);
6.3.2 Creating a Device for Use with Streams and the DIO Adapter
If you plan to use an IOM mini-driver with SIO streams and the DIO adapter,
create a user-defined device statically or with a DEV_createDevice call
similar to that shown below:
DIO_Params dioCodecParams ={
"/codec", /* device name */
NULL /* chanParams */
};
DEV_Attrs dioCodecAttrs = {
NULL,
/* device id */
&dioCodecParams, /* device parameters */
DEV_SIOTYPE, /* type of the device */
NULL /* device global data ptr */
};
status = DEV_createDevice("/dio_codec", &DIO_tskDynamicFxns,
(Fxn)DIO_init, &dioCodecAttrs);
The driver function table passed to DEV_createDevice should be
DIO_tskDynamicFxns for use with tasks (TSKs) or DIO_cbDynamicFxns for
use with software interrupts (SWIs).