E.6.6 cusbiobufclass, E.6.7 cusbiobufpool class, E.7 usbio demo application – Motorola USB08 User Manual

Page 223: E.6.6, Cusbiobufclass, E.6.7, Cusbiobufpool class, Usbio demo application

Advertising
background image

Universal USB Device Driver (USBIO)

USBIO Demo Application

USB08 Evaluation Board

Designer Reference Manual

MOTOROLA

Universal USB Device Driver (USBIO)

223

buffer with data. After that, the buffer is sent to the pipe using the

Write

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 buffer is put back to the pool and the
main loop is started from the beginning.

E.6.6 CUsbIoBufClass

The helper class

CUsbIoBuf

is used as a descriptor for buffers that are

processed by the class

CUsbIoPipe

and derived classes. One instance

of the

CUsbIoBuf

class has to be created for each buffer. The

CUsbIoBuf

object stores context and status information that is needed

to process the buffer asynchronously.

The

CUsbIoBuf

class contains a link element (Next pointer). This may

be used to build a chain of linked buffer objects to hold them in a list. This
way, the management of buffers can be simplified.

E.6.7 CUsbIoBufPool Class

The class

CUsbIoBufPool

is used to manage a pool of free buffers. It

provides functions used to allocate an initial number of buffers, to get a
buffer from the pool, and to put a buffer back to the pool.

E.7 USBIO Demo Application

The USBIO Demo Application demonstrates the usage of the USBIO
driver interface. It is based on the USBIO Class Library which covers the
native API calls. The Application is designed to handle one USB driver
that can contain multiple pipes. It is possible to run multiple instances of
the application, each connected to another USB device.

The USBIO Demo Application is a dialog based MFC (Microsoft
Foundation Classes) application. The main dialog contains a button that
allows to open an output window. All output data and all error messages
are directed to this window. The button “Clear Output Window” discards
the actual contents of the window.

Advertising