EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #265 background imageLoading...
Page #265 background image
Opening Devices
Streaming I/O and Device Drivers 7-35
The device parameter points to an object of type DEV_Obj whose fields have
been initialized by SIO_create. name is the string remaining after the device
name has been matched by SIO_create using DEV_match.
Recall that SIO_create takes the parameters and is called as shown in
Example 7-26.
Example 7-26. The Parameters of SIO_create
The name parameter passed to SIO_create is typically a string indicating the
device and an additional suffix, indicating some particular mode of operation
of the device. An analog-to-digital converter might have the base name /adc,
while the sampling frequency might be indicated by a tag such as 16 for 16
kHz. The complete name passed to SIO_create would be /adc16.
SIO_create identifies the device by using DEV_match to match the string
/adc against the list of configured devices. The string remainder 16 would be
passed to Dxx_open to set the ADC to the correct sampling frequency.
Dxx_open usually allocates a device-specific object that is used to maintain
the device state, as well as necessary semaphores. For a terminating device,
this object typically has two SEM_Handle semaphore handles. One is used
for synchronizing I/O operations (for example, SIO_get, SIO_put,
SIO_reclaim). The other handle is used with SIO_select to determine if a
device is ready. A device object would typically be defined as shown in
Example 7-27.
Example 7-27. The Dxx_Obj Structure
Example 7-28 provides a template for Dxx_open, showing the function’s
typical features for a terminating device.
stream = SIO_create(name, mode, bufsize, attrs);
typedef struct Dxx_Obj {
SEM_Handle sync; /* synchronize I/O */
SEM_Handle ready; /* used with SIO_select() */
`other device-specific fields`
} Dxx_obj, *Dxx_Handle;

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals