/* Returns the direction of the data transfer following the given request.  */
unsigned char USBGenericRequest_GetDirection(const USBGenericRequest *request)
/* Returns the direction of the data transfer following the given request.  */
unsigned char USBGenericRequest_GetDirection(const USBGenericRequest *request)
{
    if ((request->bmRequestType & 0x80) != 0) {
        return USBGenericRequest_IN;
    }
    else {
        return USBGenericRequest_OUT;
    }
}