Doxygen Documentation |
||||||
Package: |
CBIO |
|||||
Version: |
dev |
Marked: |
(not marked) |
|||
Constituent: |
cbio_unit_test |
Tag: |
rad750 |
Typedefs | |
typedef int | CBIO_WriteCallback (const char *data, int bytes, void *userData) |
Functions | |
STATUS | CBIO_CreateDev (char *, CBIO_WriteCallback *, void *) |
Create CBIO device and attach user callback. | |
STATUS | CBIO_DeleteDev (char *) |
Delete CBIO device and clean up allocation. | |
STATUS | CBIO_Drv () |
Initialize CBIO vxWorks device driver. | |
STATUS | CBIO_DrvRemove () |
Remove CBIO driver from device table. |
The calling application need to take the following steps to use the CBIO:
1) Install driver with CBIO_Drv(). This should be done at boot time or application init.
2) Create one or more CBIO devices with CBIO_CreateDev(). By convention, the devices should be named /cbio/0, /cbio/1, etc. When these devices are created, the application supplies a callback function and user data. The callbacks functions are calld when data is written to a CBIO device type. The callback function takes 3 arguments, the data written to the CBIO device, the number of bytes and a userData pointer. This userData pointer is set in the call to CBIO_CreateDev() and is unique to each open CBIO device.
3) Open a CBIO driver with open() to obtain a file descriptor.
4) Use the file descriptor directly or attach to other vxWorks system resources with logFdAdd(), ioTaskStdSet(), etc.
for cleanup:
5) Use close() to close file descriptor.
6) Use CBIO_DeleteDev() to delete the device
7) CBIO_DrvRemove() will remove the driver from the kernel.
The application can create a CBIO device and use vxWorks functions such as logFdAdd(), ioTaskStdSet() or ioGlobalStdSet() to provide a point to capture messages printed to the "screen" or unsolicited output from the vxWorks kernel.
This driver is only intended for vxWorks systems. No ports will be supported for other operating systems.
|
The definition of a CBIO write callback function. These callbacks are used when data is written to a CBIO device type. The function takes 3 arguments, the data written to the CBIO device, the number of bytes and a userData pointer. This userData pointer is set in the call to CBIO_CreateDev and is unique to each open CBIO device.
int CBIO_WriteCallback(const char *data, int bytes, void *userData);
|
|
Create CBIO device and attach user callback.
|
|
Delete CBIO device and clean up allocation.
|
|
Initialize CBIO vxWorks device driver.
|
|
Remove CBIO driver from device table.
|