Designer Reference Manual
USB08 Evaluation Board
222
Universal USB Device Driver (USBIO)
MOTOROLA
Universal USB Device Driver (USBIO)
E.6.3 CUsbIoThread Class
The class
CUsbIoThread
provides basic functions needed to
implement a worker thread that performs input or output operations on a
pipe. It includes functions that are used to start and stop the worker
thread.
The
CUsbIoThread
class does not implement the thread’s main
routine. This has to be done in a derived class. Thus,
CUsbIoThread
is
an universal base class that simplifies the implementation of a worker
thread that performs I/O operations on a pipe.
NOTE:
The worker thread created by
CUsbIoThread
is a native system thread.
That means it cannot be used to class MFC (Microsoft Foundation
Classes) functions. It is necessary to use
PostMessage
,
SendMessage
or some other communication mechanism to switch over
to MFC-aware threads.
E.6.4 CUsbIoReaderClass
The class
CUsbIoReader
extends the
CUsbIoThread
class by a
specific worker thread routine that continuously sends Read requests to
the pipe. The thread’s main routine gets buffers from an internal buffer
pool and submits them to the pipe using the
Read
function of the
CUsbIoPipe
class. After all buffers are submitted the routine waits for
the first pending buffer to complete. If a buffer is completed by the
USBIO driver the virtual member function
ProcessData
is called with
this buffer. Within this function the data received from the pipe should be
processed. The
ProcessData
function has to be implemented by a
class that is derived from
CUsbIoReader
. After that, the buffer is put
back to the pool and the main loop is stated from the beginning.
E.6.5 CUsbIoWriter Class
The class
CUsbIoWriter
extends the
CUsbIoThread
class by a
specific worker thread routine that continuously sends Write requests to
the pipe. The thread’s main routine gets a buffer from an internal buffer
pool and calls the virtual member function
ProcessBuffer
to fill the
Содержание MC68HC908JB8
Страница 2: ...blank ...
Страница 6: ...Designer Reference Manual USB08 Evaluation Board 6 List of Sections MOTOROLA List of Sections ...
Страница 16: ...Designer Reference Manual USB08 Evaluation Board 16 List of Tables MOTOROLA List of Tables ...
Страница 42: ...Designer Reference Manual USB08 Evaluation Board 42 Hardware Description MOTOROLA Hardware Description ...
Страница 88: ...Designer Reference Manual USB08 Evaluation Board 88 USB08 Descriptors MOTOROLA USB08 Descriptors ...
Страница 243: ...blank ...