GNU Radio 3.4.2 C++ API
usb_requests.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2003 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 // Standard USB requests.
00024 // These are contained in end point 0 setup packets
00025 
00026 
00027 #ifndef _USB_REQUESTS_H_
00028 #define _USB_REQUESTS_H_
00029 
00030 // format of bmRequestType byte
00031 
00032 #define bmRT_DIR_MASK           (0x1 << 7)
00033 #define bmRT_DIR_IN             (1 << 7)
00034 #define bmRT_DIR_OUT            (0 << 7)
00035 
00036 #define bmRT_TYPE_MASK          (0x3 << 5)
00037 #define bmRT_TYPE_STD           (0 << 5)
00038 #define bmRT_TYPE_CLASS         (1 << 5)
00039 #define bmRT_TYPE_VENDOR        (2 << 5)
00040 #define bmRT_TYPE_RESERVED      (3 << 5)
00041 
00042 #define bmRT_RECIP_MASK         (0x1f << 0)
00043 #define bmRT_RECIP_DEVICE       (0 << 0)
00044 #define bmRT_RECIP_INTERFACE    (1 << 0)
00045 #define bmRT_RECIP_ENDPOINT     (2 << 0)
00046 #define bmRT_RECIP_OTHER        (3 << 0)
00047 
00048 
00049 // standard request codes (bRequest)
00050 
00051 #define RQ_GET_STATUS           0
00052 #define RQ_CLEAR_FEATURE        1
00053 #define RQ_RESERVED_2           2
00054 #define RQ_SET_FEATURE          3
00055 #define RQ_RESERVED_4           4
00056 #define RQ_SET_ADDRESS          5
00057 #define RQ_GET_DESCR            6
00058 #define RQ_SET_DESCR            7
00059 #define RQ_GET_CONFIG           8
00060 #define RQ_SET_CONFIG           9
00061 #define RQ_GET_INTERFACE       10
00062 #define RQ_SET_INTERFACE       11
00063 #define RQ_SYNCH_FRAME         12
00064 
00065 // standard descriptor types
00066 
00067 #define DT_DEVICE               1
00068 #define DT_CONFIG               2
00069 #define DT_STRING               3
00070 #define DT_INTERFACE            4
00071 #define DT_ENDPOINT             5
00072 #define DT_DEVQUAL              6
00073 #define DT_OTHER_SPEED          7
00074 #define DT_INTERFACE_POWER      8
00075 
00076 // standard feature selectors
00077 
00078 #define FS_ENDPOINT_HALT        0       // recip: endpoint
00079 #define FS_DEV_REMOTE_WAKEUP    1       // recip: device
00080 #define FS_TEST_MODE            2       // recip: device
00081 
00082 // Get Status device attributes
00083 
00084 #define bmGSDA_SELF_POWERED     0x01
00085 #define bmGSDA_REM_WAKEUP       0x02
00086 
00087 
00088 #endif /* _USB_REQUESTS_H_ */