int
(*init)(struct DevEntry *entry);
int
(*open)(const char *name, int mode);
int
(*close)(int fd);
int
(*write)(int fd, unsigned char *buf, int size);
int
(*read)(int fd, unsigned char *buf, int size);
long
(*seek)(long fd, long offset, int whence);
}
typedef struct DevEntry DevEntry;
typedef struct DevEntry *DevEntry_t;
The
DeviceID
Device IDs are used globally across an application. The data field is a
pointer for any private data the device may need; it is not used by the
run-time libraries. The function pointed to by the
the run-time library when the device is first registered. It returns a nega-
tive value for failure, positive value for success.
The functions pointed to by the
functions that provide the same functionality used in the default I/O
device.
is another function at the same level, for those devices which
Seek
support such functionality. If a device does not support an operation (such
as seeking, writing on read-only devices or reading write-only devices),
then a function pointer must still be provided; the function must arrange
to always return failure codes when the operation is attempted.
A new device can be registered with the following call:
int add_devtab_entry(DevEntry_t entry);
If the device is successfully registered, the
called, with
entry
DeviceID of the device registered.
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
field is a unique identifier for the device, known to the user.
open
as its parameter.
init
,
,
and
close
write
routine of the device is
init()
add_devtab_entry()
Compiler
field is invoked by
fields are the
read
returns the
1-167
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?