HALFRED
0.4.0
|
Documentation on internal parts of IODevice interface - mainly for port developers. More...
Documentation on internal parts of IODevice interface - mainly for port developers.
Internally, an IODevice is a pointer to a IODeviceDesc structure, that holds pointers to functions that implement the actual IODevice functionality. The port is responsible for providing a structure for each IODevice. This can be done by either defining the structures or by providing a "creator" and "destructor" functions that create and destroy such objects at runtime.
Data Structures | |
struct | IODeviceDesc |
Typedefs | |
typedef struct IODeviceDesc | IODeviceDesc |
typedef HALRESULT(* | IODeviceCtrlFunc )(IODevice) |
typedef HALRESULT(* | IODeviceIOCtlFunc )(IODevice, unsigned int, va_list) |
typedef size_t(* | IODeviceGetCountFunc )(IODevice) |
typedef size_t(* | IODeviceWriteFunc )(IODevice, const void *, size_t) |
typedef size_t(* | IODeviceReadFunc )(IODevice, void *, size_t) |
Functions | |
void | IODEV_SignalReadEvent (IODevice iodevice, int count) |
void | IODEV_SignalWriteEvent (IODevice iodevice, int count) |
typedef struct IODeviceDesc IODeviceDesc |
IODevice structure declaration.
IODevice IOCtl function type.
typedef size_t(* IODeviceGetCountFunc)(IODevice) |
IODevice "get count" function type.
typedef size_t(* IODeviceWriteFunc)(IODevice, const void *, size_t) |
IODevice write function type.
typedef size_t(* IODeviceReadFunc)(IODevice, void *, size_t) |
IODevice read function type.
void IODEV_SignalReadEvent | ( | IODevice | iodevice, |
int | count | ||
) |
Signals read event from port. This function is used by ports to notify IODevice interface that a certain amount of read events has happened. It checks if a read notifier was configured for the given IODevice, and if so it signals read events to it. This in turn may trigger application threads that wait for data to unblock.
This function should only be used by ports.
iodevice | IODevice |
count | number of read events to signal |
void IODEV_SignalWriteEvent | ( | IODevice | iodevice, |
int | count | ||
) |
Signals write event from port. This function is used by ports to notify IODevice interface that a certain amount of write events has happened. It checks if a write notifier was configured for the given IODevice, and if so it signals write events to it. This in turn may trigger application threads that wait for end of write to unblock.
This function should only be used by ports.
iodevice | IODevice |
count | number of write events to signal |