Cusbiothread Class; Cusbioreaderclass; Cusbiowriter Class; E.6.3 Cusbiothread Class - Motorola USB08 Reference Manual

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Universal USB Device Driver (USBIO)

E.6.3 CUsbIoThread Class

NOTE:

E.6.4 CUsbIoReaderClass

E.6.5 CUsbIoWriter Class

Designer Reference Manual
222
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.
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.
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.
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
Universal USB Device Driver (USBIO)
USB08 Evaluation Board
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents