Warning, cross-references for /kernel/include/drivers/usb/uvc.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _UVC_H_
0019 #define _UVC_H_
0020
0021 #include <types.h>
0022
0023 #define USB_TYPE_IA_DESC 0x0B
0024
0025
0026 #define CC_VIDEO 0x0E
0027
0028 #define SC_UNDEFINED 0x00
0029 #define SC_VIDEOCONTROL 0x01
0030 #define SC_VIDEOSTREAMING 0x02
0031 #define SC_VIDEO_INTERFACE_COLLECTION 0x03
0032
0033 #define PC_PROTOCOL_UNDEFINED 0x00
0034
0035 #define CS_UNDEFINED 0x20
0036 #define CS_DEVICE 0x21
0037 #define CS_CONFIGURATION 0x22
0038 #define CS_STRING 0x23
0039 #define CS_INTERFACE 0x24
0040 #define CS_ENDPOINT 0x25
0041
0042 #define VC_DESCRIPTOR_UNDEFINED 0x00
0043 #define VC_HEADER 0x01
0044 #define VC_INPUT_TERMINAL 0x02
0045 #define VC_OUTPUT_TERMINAL 0x03
0046 #define VC_SELECTOR_UNIT 0x04
0047 #define VC_PROCESSING_UNIT 0x05
0048 #define VC_EXTENSION_UNIT 0x06
0049
0050 #define VS_UNDEFINED 0x00
0051 #define VS_INPUT_HEADER 0x01
0052 #define VS_OUTPUT_HEADER 0x02
0053 #define VS_STILL_IMAGE_FRAME 0x03
0054 #define VS_FORMAT_UNCOMPRESSED 0x04
0055 #define VS_FRAME_UNCOMPRESSED 0x05
0056 #define VS_FORMAT_MJPEG 0x06
0057 #define VS_FRAME_MJPEG 0x07
0058 #define VS_FORMAT_MPEG2TS 0x0A
0059 #define VS_FORMAT_DV 0x0C
0060 #define VS_COLOR_FORMAT 0x0D
0061 #define VS_FORMAT_FRAME_BASED 0x10
0062 #define VS_FRAME_FRAME_BASED 0x11
0063 #define VS_FORMAT_STREAM_BASED 0x12
0064
0065 #define EP_UNDEFINED 0x00
0066 #define EP_GENERAL 0x01
0067 #define EP_ENDPOINT 0x02
0068 #define EP_INTERRUPT 0x03
0069
0070
0071 #define RC_UNDEFINED 0x00
0072 #define SET_CUR 0x01
0073 #define GET_CUR 0x81
0074 #define GET_MIN 0x82
0075 #define GET_MAX 0x83
0076 #define GET_RES 0x84
0077 #define GET_LEN 0x85
0078 #define GET_INFO 0x86
0079 #define GET_DEF 0x87
0080
0081
0082 #define VC_CONTROL_UNDEFINED 0x00
0083 #define VC_VIDEO_POWER_MODE_CONTROL 0x01
0084 #define VC_REQUEST_ERROR_CODE_CONTROL 0x02
0085
0086
0087 #define TE_CONTROL_UNDEFINED 0x00
0088
0089
0090 #define SU_CONTROL_UNDEFINED 0x00
0091 #define SU_INPUT_SELECT_CONTROL 0x01
0092
0093
0094 #define CT_CONTROL_UNDEFINED 0x00
0095 #define CT_SCANNING_MODE_CONTROL 0x01
0096 #define CT_AE_MODE_CONTROL 0x02
0097 #define CT_AE_PRIORITY_CONTROL 0x03
0098 #define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
0099 #define CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
0100 #define CT_FOCUS_ABSOLUTE_CONTROL 0x06
0101 #define CT_FOCUS_RELATIVE_CONTROL 0x07
0102 #define CT_FOCUS_AUTO_CONTROL 0x08
0103 #define CT_IRIS_ABSOLUTE_CONTROL 0x09
0104 #define CT_IRIS_RELATIVE_CONTROL 0x0A
0105 #define CT_ZOOM_ABSOLUTE_CONTROL 0x0B
0106 #define CT_ZOOM_RELATIVE_CONTROL 0x0C
0107 #define CT_PANTILT_ABSOLUTE_CONTROL 0x0D
0108 #define CT_PANTILT_RELATIVE_CONTROL 0x0E
0109 #define CT_ROLL_ABSOLUTE_CONTROL 0x0F
0110 #define CT_ROLL_RELATIVE_CONTROL 0x10
0111 #define CT_PRIVACY_CONTROL 0x11
0112
0113
0114 #define PU_CONTROL_UNDEFINED 0x00
0115 #define PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
0116 #define PU_BRIGHTNESS_CONTROL 0x02
0117 #define PU_CONTRAST_CONTROL 0x03
0118 #define PU_GAIN_CONTROL 0x04
0119 #define PU_POWER_LINE_FREQUENCY_CONTROL 0x05
0120 #define PU_HUE_CONTROL 0x06
0121 #define PU_SATURATION_CONTROL 0x07
0122 #define PU_SHARPNESS_CONTROL 0x08
0123 #define PU_GAMMA_CONTROL 0x09
0124 #define PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0A
0125 #define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0B
0126 #define PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0C
0127 #define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0D
0128 #define PU_DIGITAL_MULTIPLIER_CONTROL 0x0E
0129 #define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0F
0130 #define PU_HUE_AUTO_CONTROL 0x10
0131 #define PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
0132 #define PU_ANALOG_LOCK_STATUS_CONTROL 0x12
0133
0134
0135 #define XU_CONTROL_UNDEFINED 0x00
0136
0137
0138 #define VS_CONTROL_UNDEFINED 0x00
0139 #define VS_PROBE_CONTROL 0x01
0140 #define VS_COMMIT_CONTROL 0x02
0141 #define VS_STILL_PROBE_CONTROL 0x03
0142 #define VS_STILL_COMMIT_CONTROL 0x04
0143 #define VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
0144 #define VS_STREAM_ERROR_CODE_CONTROL 0x06
0145 #define VS_GENERATE_KEY_FRAME_CONTROL 0x07
0146 #define VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
0147 #define VS_SYNCH_DELAY_CONTROL 0x09
0148
0149
0150
0151
0152
0153
0154
0155
0156 struct uvc_ia_desc
0157 {
0158 uint8_t bLength;
0159 uint8_t bDescriptorType;
0160 uint8_t bFirstInterface;
0161 uint8_t bInterfaceCount;
0162 uint8_t bFunctionClass;
0163 uint8_t bFunctionSubClass;
0164 uint8_t bFunctionProtocol;
0165 uint8_t iFunction;
0166 } __attribute__ ((packed));
0167
0168 typedef struct uvc_ia_desc UVC_IA_DESC;
0169
0170
0171
0172
0173
0174
0175
0176
0177 struct uvc_csvc_if_hdr_desc
0178 {
0179 uint8_t bLength;
0180 uint8_t bDescriptorType;
0181 uint8_t bDescriptorSubType;
0182 uint16_t bcdUVC;
0183 uint16_t wTotalLength;
0184 uint32_t dwClockFrequency;
0185 uint8_t bInCollection;
0186 uint8_t baInterface1;
0187 } __attribute__ ((packed));
0188
0189 typedef struct uvc_csvc_if_hdr_desc UVC_CSVC_IF_HDR_DESC;
0190
0191
0192
0193
0194
0195
0196
0197
0198 struct uvc_in_term_desc
0199 {
0200 uint8_t bLength;
0201 uint8_t bDescriptorType;
0202 uint8_t bDescriptorSubType;
0203 uint8_t bTerminalID;
0204 uint16_t wTerminalType;
0205 uint8_t bAssocTerminal;
0206 uint8_t iTerminal;
0207 } __attribute__ ((packed));
0208
0209 typedef struct uvc_in_term_desc UVC_IN_TERM_DESC;
0210
0211
0212
0213
0214
0215
0216
0217
0218 struct uvc_csvs_if_hdr_desc
0219 {
0220 uint8_t bLength;
0221 uint8_t bDescriptorType;
0222 uint8_t bDescriptorSubType;
0223 uint8_t bNumFormats;
0224 uint16_t wTotalLength;
0225 uint8_t bEndpointAddress;
0226 uint8_t bmInfo;
0227 uint8_t bTerminalLink;
0228 uint8_t bStillCaptureMethod;
0229 uint8_t bTriggerSupport;
0230 uint8_t bTriggerUsage;
0231 uint8_t bControlSize;
0232 } __attribute__ ((packed));
0233
0234 typedef struct uvc_csvs_if_hdr_desc UVC_CSVS_IF_HDR_DESC;
0235
0236
0237
0238
0239
0240
0241
0242
0243 struct uvc_out_term_desc
0244 {
0245 uint8_t bLength;
0246 uint8_t bDescriptorType;
0247 uint8_t bDescriptorSubType;
0248 uint8_t bTerminalID;
0249 uint16_t wTerminalType;
0250 uint8_t bAssocTerminal;
0251 uint8_t bSourceID;
0252 uint8_t iTerminal;
0253 } __attribute__ ((packed));
0254
0255 typedef struct uvc_out_term_desc UVC_OUT_TERM_DESC;
0256
0257
0258
0259
0260
0261
0262
0263
0264 struct uvc_vs_ctl_par_block
0265 {
0266 uint16_t bmHint;
0267 uint8_t bFormatIndex;
0268 uint8_t bFrameIndex;
0269 uint32_t dwFrameInterval;
0270 uint16_t wKeyFrameRate;
0271 uint16_t wPFrameRate;
0272 uint16_t wCompQuality;
0273 uint16_t wCompWindowSize;
0274 uint16_t wDelay;
0275 uint32_t dwMaxVideoFrameSize;
0276 uint32_t dwMaxPayloadTransferSize;
0277 uint32_t dwClockFrequency;
0278 uint8_t bmFramingInfo;
0279 uint8_t bPreferedVersion;
0280 uint8_t bMinVersion;
0281 uint8_t bMaxVersion;
0282 } __attribute__ ((packed));
0283
0284 typedef struct uvc_vs_ctl_par_block UVC_VS_CTL_PAR_BLOCK;
0285
0286
0287
0288
0289
0290
0291
0292
0293 struct uvc_mjpeg_format_desc
0294 {
0295 uint8_t bLength;
0296 uint8_t bDescriptorType;
0297 uint8_t bDescriptorSubType;
0298 uint8_t bFormatIndex;
0299 uint8_t bNumFrameDescriptors;
0300 uint8_t bmFlags;
0301 uint8_t bDefaultFrameIndex;
0302 uint8_t bAspectRatioX;
0303 uint8_t bAspectRatioY;
0304 uint8_t bmInterlaceFlags;
0305 uint8_t bCopyProtect;
0306 } __attribute__ ((packed));
0307
0308 typedef struct uvc_mjpeg_format_desc UVC_MJPEG_FORMAT_DESC;
0309
0310
0311
0312
0313
0314
0315
0316
0317 struct uvc_mjpeg_frame_desc
0318 {
0319 uint8_t bLength;
0320 uint8_t bDescriptorType;
0321 uint8_t bDescriptorSubType;
0322 uint8_t bFrameIndex;
0323 uint8_t bmCapabilities;
0324 uint16_t wWidth;
0325 uint16_t wHeight;
0326 uint32_t dwMinBitRate;
0327 uint32_t dwMaxBitRate;
0328 uint32_t dwMaxVideoFrameBufferSize;
0329 uint32_t dwDefaultFrameInterval;
0330 uint8_t bFrameIntervalType;
0331 } __attribute__ ((packed));
0332
0333 typedef struct uvc_mjpeg_frame_desc UVC_MJPEG_FRAME_DESC;
0334
0335 extern bool usb_uvc_driver_init (void);
0336
0337 #endif
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348