Defines | Functions

# usb-other.c File Reference

`#include "usb-private.h"`
`#include "dmxinputinit.h"`
`#include "usb-other.h"`

## Defines
#define | GETPRIV
#define | LOG0(f) dmxLog(dmxDebug,f)
#define | LOG1(f, a) dmxLog(dmxDebug,f,a)
#define | LOG2(f, a, b) dmxLog(dmxDebug,f,a,b)
#define | LOG3(f, a, b, c) dmxLog(dmxDebug,f,a,b,c)
#define | FATAL0(f) dmxLog(dmxFatal,f)
#define | FATAL1(f, a) dmxLog(dmxFatal,f,a)
#define | FATAL2(f, a, b) dmxLog(dmxFatal,f,a,b)
#define | MOTIONPROC dmxMotionProcPtr
#define | ENQUEUEPROC dmxEnqueueProcPtr
#define | CHECKPROC dmxCheckSpecialProcPtr
#define | BLOCK DMXBlockType
#define | test_bit(bit) (priv->mask[(bit)/8] & (1 << ((bit)%8)))
## Functions
void | othUSBRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
void | othUSBInit (DevicePtr pDev)
int | othUSBOn (DevicePtr pDev)
void | othUSBGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)

## Detailed Description

This code implements a low-level device driver for a non-keyboard, non-mouse USB device (e.g., a joystick or gamepad).

## Define Documentation

#define BLOCK DMXBlockType

#define CHECKPROC dmxCheckSpecialProcPtr

#define ENQUEUEPROC dmxEnqueueProcPtr

#define FATAL0 | ( |  | f | ) | dmxLog(dmxFatal,f)

#define FATAL1 | ( |  | f,
|  |  | a |
| ) |  |  | dmxLog(dmxFatal,f,a)

#define FATAL2 | ( |  | f,
|  |  | a,
|  |  | b |
| ) |  |  | dmxLog(dmxFatal,f,a,b)

#define GETPRIV

Value:

    myPrivate *priv                            \
                          = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private

#define LOG0 | ( |  | f | ) | dmxLog(dmxDebug,f)

#define LOG1 | ( |  | f,
|  |  | a |
| ) |  |  | dmxLog(dmxDebug,f,a)

#define LOG2 | ( |  | f,
|  |  | a,
|  |  | b |
| ) |  |  | dmxLog(dmxDebug,f,a,b)

#define LOG3 | ( |  | f,
|  |  | a,
|  |  | b,
|  |  | c |
| ) |  |  | dmxLog(dmxDebug,f,a,b,c)

#define MOTIONPROC dmxMotionProcPtr

#define test_bit | ( |  | bit | ) | (priv->mask[(bit)/8] & (1 << ((bit)%8)))

## Function Documentation

void othUSBGetInfo | ( | DevicePtr | pDev,
|  | DMXLocalInitInfoPtr | info |
| ) |  |  |

Fill the info structure with information needed to initialize pDev.

References _DMXLocalInitInfo::belFeedbackClass, DMX_MAX_AXES, dmxLog(), dmxWarning, _DMXLocalInitInfo::keyClass, _DMXLocalInitInfo::keySyms, _DMXLocalInitInfo::ledFeedbackClass, _DMXLocalInitInfo::maxres, _DMXLocalInitInfo::maxval, _DMXLocalInitInfo::minres, _DMXLocalInitInfo::minval, _DMXLocalInitInfo::numAbsAxes, _DMXLocalInitInfo::numRelAxes, _DMXLocalInitInfo::res, test_bit, and _DMXLocalInitInfo::valuatorClass.

void othUSBInit | ( | DevicePtr | pDev | ) |

Initialize pDev using usbInit.

References usbInit(), and usbOther.

Referenced by othUSBOn().

int othUSBOn | ( | DevicePtr | pDev | ) |

Turn pDev on (i.e., take input from pDev).

References othUSBInit().

void othUSBRead | ( | DevicePtr | pDev,
|  | MOTIONPROC | motion,
|  | ENQUEUEPROC | enqueue,
|  | CHECKPROC | checkspecial,
|  | BLOCK | block |
| ) |  |  |

Read the USB device using usbRead.

References usbRead().