Ignore:
Timestamp:
Apr 30, 2016, 11:29:25 PM (8 years ago)
Author:
ertl-honda
Message:

1.7.10のファイルに更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/USB/USBCore.h

    r136 r224  
    1 // Copyright (c) 2010, Peter Barrett
    21/*
    3 ** Permission to use, copy, modify, and/or distribute this software for
    4 ** any purpose with or without fee is hereby granted, provided that the
    5 ** above copyright notice and this permission notice appear in all copies.
    6 **
    7 ** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
    8 ** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
    9 ** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
    10 ** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
    11 ** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    12 ** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    13 ** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    14 ** SOFTWARE.
     2  Copyright (c) 2014 Arduino LLC.  All right reserved.
     3
     4  This library is free software; you can redistribute it and/or
     5  modify it under the terms of the GNU Lesser General Public
     6  License as published by the Free Software Foundation; either
     7  version 2.1 of the License, or (at your option) any later version.
     8
     9  This library is distributed in the hope that it will be useful,
     10  but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     12  See the GNU Lesser General Public License for more details.
     13
     14  You should have received a copy of the GNU Lesser General Public
     15  License along with this library; if not, write to the Free Software
     16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1517*/
     18/*
     19**Modified 04/04/2016 by Arduino.org development team
     20*/
     21
    1622
    1723#ifndef __USBCORE_H__
     
    3036#define SET_INTERFACE                           11
    3137
     38// bEndpointAddress in Endpoint Descriptor
     39#define USB_ENDPOINT_DIRECTION_MASK            0x80
     40#define USB_ENDPOINT_OUT(addr)                 ((addr) | 0x00)
     41#define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
     42
     43#define USB_ENDPOINTS                          7
     44
     45#define USB_ENDPOINT_TYPE_MASK                 0x03
     46#define USB_ENDPOINT_TYPE_CONTROL              0x00
     47#define USB_ENDPOINT_TYPE_ISOCHRONOUS          0x01
     48#define USB_ENDPOINT_TYPE_BULK                 0x02
     49#define USB_ENDPOINT_TYPE_INTERRUPT            0x03
    3250
    3351// bmRequestType
     
    4765#define REQUEST_RECIPIENT                       0x1F
    4866
    49 #define REQUEST_DEVICETOHOST_CLASS_INTERFACE  (REQUEST_DEVICETOHOST + REQUEST_CLASS + REQUEST_INTERFACE)
    50 #define REQUEST_HOSTTODEVICE_CLASS_INTERFACE  (REQUEST_HOSTTODEVICE + REQUEST_CLASS + REQUEST_INTERFACE)
     67#define REQUEST_DEVICETOHOST_CLASS_INTERFACE    (REQUEST_DEVICETOHOST | REQUEST_CLASS | REQUEST_INTERFACE)
     68#define REQUEST_HOSTTODEVICE_CLASS_INTERFACE    (REQUEST_HOSTTODEVICE | REQUEST_CLASS | REQUEST_INTERFACE)
     69#define REQUEST_DEVICETOHOST_STANDARD_INTERFACE (REQUEST_DEVICETOHOST | REQUEST_STANDARD | REQUEST_INTERFACE)
    5170
    5271//      Class requests
     
    5574#define CDC_GET_LINE_CODING                     0x21
    5675#define CDC_SET_CONTROL_LINE_STATE      0x22
     76#define CDC_SEND_BREAK                          0x23
    5777
    5878#define MSC_RESET                                       0xFF
     
    108128#define MSC_SUBCLASS_SCSI                                               0x06
    109129#define MSC_PROTOCOL_BULK_ONLY                                  0x50
    110 
    111 #define HID_HID_DESCRIPTOR_TYPE                                 0x21
    112 #define HID_REPORT_DESCRIPTOR_TYPE                              0x22
    113 #define HID_PHYSICAL_DESCRIPTOR_TYPE                    0x23
    114 
    115 #define TX_RX_LED_PULSE_MS 100     //----- Tx & Rx led blinking during transmission (declaration)
    116130
    117131_Pragma("pack(1)")
     
    225239typedef struct
    226240{
    227 #if (defined CDC_ENABLED) && defined(HID_ENABLED)
    228241        //      IAD
    229242        IADDescriptor                           iad;    // Only needed on compound device
    230 #endif
    231243        //      Control
    232244        InterfaceDescriptor                     cif;
     
    249261        EndpointDescriptor                      out;
    250262} MSCDescriptor;
     263
    251264
    252265typedef struct
     
    273286
    274287#define D_DEVICE(_class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs) \
    275         { 18, 1, 0x110, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
     288        { 18, 1, 0x200, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
    276289/* Table 9-8. Standard Device Descriptor
    277290 * bLength, bDescriptorType, bcdUSB, bDeviceClass, bDeviceSubClass, bDeviceProtocol, bMaxPacketSize0,
     
    279292
    280293#define D_CONFIG(_totalLength,_interfaces) \
    281         { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_SELF_POWERED, USB_CONFIG_POWER_MA(500) }
     294        { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(500) }
    282295/* Table 9-10. Standard Configuration Descriptor
    283296 * bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration
    284297 * bmAttributes, bMaxPower */
    285  
     298
    286299#define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \
    287300        { 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }
     
    289302 * bLength, bDescriptorType, bInterfaceNumber, bAlternateSetting, bNumEndpoints, bInterfaceClass,
    290303 * bInterfaceSubClass, bInterfaceProtocol, iInterface */
    291  
     304
    292305#define D_ENDPOINT(_addr,_attr,_packetSize, _interval) \
    293306        { 7, 5, _addr,_attr,_packetSize, _interval }
     
    297310#define D_IAD(_firstInterface, _count, _class, _subClass, _protocol) \
    298311        { 8, 11, _firstInterface, _count, _class, _subClass, _protocol, 0 }
    299 /* iadclasscode_r10.pdf, Table 9–Z. Standard Interface Association Descriptor
     312/* iadclasscode_r10.pdf, Table 9\96Z. Standard Interface Association Descriptor
    300313 * bLength, bDescriptorType, bFirstInterface, bInterfaceCount, bFunctionClass, bFunctionSubClass, bFunctionProtocol, iFunction */
    301314#define D_HIDREPORT(_descriptorLength) \
     
    303316/* HID1_11.pdf  E.8 HID Descriptor (Mouse)
    304317 * bLength, bDescriptorType, bcdHID, bCountryCode, bNumDescriptors, bDescriptorType, wItemLength */
    305 
     318 
    306319// Functional Descriptor General Format
    307320#define D_CDCCS(_subtype,_d0,_d1)       { 5, 0x24, _subtype, _d0, _d1 }
Note: See TracChangeset for help on using the changeset viewer.