Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usb_webusb.h Source File

usb_webusb.h

Go to the documentation of this file.
00001 /**
00002  * @file    usb_webusb.h
00003  * @brief   WebUSB driver header
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #ifndef __USB_WEBUSB_H__
00023 #define __USB_WEBUSB_H__
00024 
00025 /* WebUSB Descriptor Types */
00026 #define WEBUSB_DESCRIPTOR_SET_HEADER_TYPE       0x00
00027 #define WEBUSB_CONFIGURATION_SUBSET_HEADER_TYPE 0x01
00028 #define WEBUSB_FUNCTION_SUBSET_HEADER_TYPE      0x02
00029 #define WEBUSB_URL_TYPE                         0x03
00030 
00031 /* WebUSB Platform Capability Descriptor */
00032 typedef __packed struct _WEBUSB_PLATFORM_CAPABILITY_DESCRIPTOR {
00033     U8  bLength;
00034     U8  bDescriptorType;
00035     U8  bDevCapabilityType;
00036     U8  bReserved;
00037     U8  platformCapabilityUUID[16];
00038     U16 bcdVersion;
00039     U8  bVendorCode;
00040     U8  iLandingPage;
00041 } WEBUSB_PLATFORM_CAPABILITY_DESCRIPTOR;
00042 
00043 typedef __packed struct _WEBUSB_URL_DESCRIPTOR {
00044     U8  bLength;
00045     U8  bDescriptorType;
00046     U8  bScheme;
00047     char URL[];
00048 } WEBUSB_URL_DESCRIPTOR;
00049 
00050 /* WebUSB Request Codes */
00051 #define WEBUSB_REQUEST_GET_URL                  0x02
00052 
00053 /* bScheme in URL descriptor */
00054 #define WEBUSB_URL_SCHEME_HTTP                  0x00
00055 #define WEBUSB_URL_SCHEME_HTTPS                 0x01
00056 
00057 /* WebUSB Descriptor sizes */
00058 #define WEBUSB_DESCRIPTOR_SET_HEADER_SIZE       5
00059 #define WEBUSB_CONFIGURATION_SUBSET_HEADER_SIZE 4
00060 #define WEBUSB_FUNCTION_SUBSET_HEADER_SIZE      3
00061 
00062 #endif  /* __USB_WEBUSB_H__ */