├── tools_linux_64 ├── avrdude │ ├── lib │ │ ├── libusb.so │ │ ├── libusb-0.1.so.4 │ │ ├── libusb-1.0.so │ │ ├── libusb-1.0.so.0 │ │ ├── libusb.a │ │ ├── libusb-1.0.a │ │ ├── libusb-0.1.so.4.4.4 │ │ ├── libusb-1.0.so.0.1.0 │ │ ├── pkgconfig │ │ │ ├── libusb.pc │ │ │ └── libusb-1.0.pc │ │ ├── libusb-1.0.la │ │ └── libusb.la │ ├── bin │ │ ├── avrdude_bin │ │ ├── avrdude │ │ └── libusb-config │ └── include │ │ ├── usb.h │ │ └── libusb-1.0 │ │ └── libusb.h └── bossac │ └── bin │ └── bossac ├── tools_darwin ├── bossac │ └── bin │ │ └── bossac └── avrdude │ ├── lib │ ├── libusb.a │ ├── libavr-sim.a │ ├── libiberty.a │ ├── libusb-1.0.a │ ├── libusb.dylib │ ├── libusb-1.0.dylib │ ├── libusb-0.1.4.dylib │ ├── libusb-1.0.0.dylib │ ├── pkgconfig │ │ ├── libusb.pc │ │ └── libusb-1.0.pc │ ├── libusb-1.0.la │ └── libusb.la │ └── bin │ ├── avrdude_bin │ ├── avrdude │ └── libusb-config ├── tools_linux_32 ├── bossac │ └── bin │ │ └── bossac └── avrdude │ └── bin │ └── avrdude ├── tools_linux_arm ├── bossac │ └── bin │ │ └── bossac └── avrdude │ ├── bin │ ├── avrdude_bin │ └── avrdude │ └── lib │ ├── libelf.so.1 │ ├── libftdi1.so.2 │ ├── libncurses.so.5 │ ├── libusb-0.1.so.4 │ └── libusb-1.0.so.0 ├── tools_windows ├── bossac │ └── bin │ │ └── bossac.exe └── avrdude │ └── bin │ ├── avrdude.exe │ └── libusb0.dll ├── hardware ├── sam │ ├── boards.txt │ └── platform.txt └── avr │ ├── platform.txt │ └── boards.txt └── LICENSE /tools_linux_64/avrdude/lib/libusb.so: -------------------------------------------------------------------------------- 1 | libusb-0.1.so.4.4.4 -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-0.1.so.4: -------------------------------------------------------------------------------- 1 | libusb-0.1.so.4.4.4 -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-1.0.so: -------------------------------------------------------------------------------- 1 | libusb-1.0.so.0.1.0 -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-1.0.so.0: -------------------------------------------------------------------------------- 1 | libusb-1.0.so.0.1.0 -------------------------------------------------------------------------------- /tools_darwin/bossac/bin/bossac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/bossac/bin/bossac -------------------------------------------------------------------------------- /tools_linux_32/bossac/bin/bossac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_32/bossac/bin/bossac -------------------------------------------------------------------------------- /tools_linux_64/bossac/bin/bossac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/bossac/bin/bossac -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb.a -------------------------------------------------------------------------------- /tools_linux_32/avrdude/bin/avrdude: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_32/avrdude/bin/avrdude -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/avrdude/lib/libusb.a -------------------------------------------------------------------------------- /tools_linux_arm/bossac/bin/bossac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/bossac/bin/bossac -------------------------------------------------------------------------------- /tools_windows/bossac/bin/bossac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_windows/bossac/bin/bossac.exe -------------------------------------------------------------------------------- /tools_darwin/avrdude/bin/avrdude_bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/bin/avrdude_bin -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libavr-sim.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libavr-sim.a -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libiberty.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libiberty.a -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb-1.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb-1.0.a -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb.dylib -------------------------------------------------------------------------------- /tools_windows/avrdude/bin/avrdude.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_windows/avrdude/bin/avrdude.exe -------------------------------------------------------------------------------- /tools_windows/avrdude/bin/libusb0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_windows/avrdude/bin/libusb0.dll -------------------------------------------------------------------------------- /tools_linux_64/avrdude/bin/avrdude_bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/avrdude/bin/avrdude_bin -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-1.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/avrdude/lib/libusb-1.0.a -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/bin/avrdude_bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/bin/avrdude_bin -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/lib/libelf.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/lib/libelf.so.1 -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb-1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb-1.0.dylib -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/lib/libftdi1.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/lib/libftdi1.so.2 -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb-0.1.4.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb-0.1.4.dylib -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_darwin/avrdude/lib/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/lib/libncurses.so.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/lib/libncurses.so.5 -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/lib/libusb-0.1.so.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/lib/libusb-0.1.so.4 -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/lib/libusb-1.0.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_arm/avrdude/lib/libusb-1.0.so.0 -------------------------------------------------------------------------------- /tools_darwin/avrdude/bin/avrdude: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DYLD_LIBRARY_PATH="`dirname "$0"`/../lib/" 4 | exec -a "$0" "`dirname "$0"`/avrdude_bin" "$@" 5 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/bin/avrdude: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LD_LIBRARY_PATH="`dirname "$0"`/../lib/" 4 | exec -a "$0" "`dirname "$0"`/avrdude_bin" "$@" 5 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-0.1.so.4.4.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/avrdude/lib/libusb-0.1.so.4.4.4 -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-1.0.so.0.1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/arduino-flash-tools/HEAD/tools_linux_64/avrdude/lib/libusb-1.0.so.0.1.0 -------------------------------------------------------------------------------- /tools_linux_arm/avrdude/bin/avrdude: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LD_LIBRARY_PATH="`dirname "$0"`/../lib/" 4 | exec -a "$0" "`dirname "$0"`/avrdude_bin" "$@" 5 | -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/pkgconfig/libusb.pc: -------------------------------------------------------------------------------- 1 | prefix=/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | emulated=1 7 | emulated_by=libusb-1.0 8 | 9 | Name: libusb 10 | Description: USB access library (libusb-1.0 compat wrapper) 11 | Version: 0.1.12 12 | Requires.private: libusb-1.0 13 | Libs: -L${libdir} -lusb 14 | Cflags: -I${includedir} 15 | 16 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/pkgconfig/libusb.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | emulated=1 7 | emulated_by=libusb-1.0 8 | 9 | Name: libusb 10 | Description: USB access library (libusb-1.0 compat wrapper) 11 | Version: 0.1.12 12 | Requires.private: libusb-1.0 13 | Libs: -L${libdir} -lusb 14 | Cflags: -I${includedir} 15 | 16 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/pkgconfig/libusb-1.0.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: libusb-1.0 7 | Description: C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace 8 | Version: 1.0.18 9 | Libs: -L${libdir} -lusb-1.0 10 | Libs.private: -lrt -pthread 11 | Cflags: -I${includedir}/libusb-1.0 12 | -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/pkgconfig/libusb-1.0.pc: -------------------------------------------------------------------------------- 1 | prefix=/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: libusb-1.0 7 | Description: C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace 8 | Version: 1.0.18 9 | Libs: -L${libdir} -lusb-1.0 10 | Libs.private: -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation 11 | Cflags: -I${includedir}/libusb-1.0 12 | -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb-1.0.la: -------------------------------------------------------------------------------- 1 | # libusb-1.0.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libusb-1.0.0.dylib' 9 | 10 | # Names of this library. 11 | library_names='libusb-1.0.0.dylib libusb-1.0.dylib' 12 | 13 | # The name of the static archive. 14 | old_library='libusb-1.0.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' ' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -lobjc' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libusb-1.0. 26 | current=1 27 | age=1 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir/lib' 42 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb-1.0.la: -------------------------------------------------------------------------------- 1 | # libusb-1.0.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libusb-1.0.so.0' 9 | 10 | # Names of this library. 11 | library_names='libusb-1.0.so.0.1.0 libusb-1.0.so.0 libusb-1.0.so' 12 | 13 | # The name of the static archive. 14 | old_library='libusb-1.0.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' -pthread' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -lrt' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libusb-1.0. 26 | current=1 27 | age=1 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir/lib' 42 | -------------------------------------------------------------------------------- /tools_darwin/avrdude/lib/libusb.la: -------------------------------------------------------------------------------- 1 | # libusb.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libusb-0.1.4.dylib' 9 | 10 | # Names of this library. 11 | library_names='libusb-0.1.4.dylib libusb.dylib' 12 | 13 | # The name of the static archive. 14 | old_library='libusb.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' ' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -L/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir/lib /Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir/lib/libusb-1.0.la -lobjc' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libusb. 26 | current=8 27 | age=4 28 | revision=4 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir/lib' 42 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/lib/libusb.la: -------------------------------------------------------------------------------- 1 | # libusb.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libusb-0.1.so.4' 9 | 10 | # Names of this library. 11 | library_names='libusb-0.1.so.4.4.4 libusb-0.1.so.4 libusb.so' 12 | 13 | # The name of the static archive. 14 | old_library='libusb.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' -pthread' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -L/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir/lib /home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir/lib/libusb-1.0.la -lrt' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libusb. 26 | current=8 27 | age=4 28 | revision=4 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir/lib' 42 | -------------------------------------------------------------------------------- /tools_darwin/avrdude/bin/libusb-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=/Users/jenkins/jenkins/workspace/toolchain-avr-3.4.5-new-mac32/objdir 4 | exec_prefix=${prefix} 5 | includedir=${prefix}/include 6 | libdir=${exec_prefix}/lib 7 | exec_prefix_set=no 8 | 9 | usage() 10 | { 11 | cat <&2 25 | fi 26 | 27 | while test $# -gt 0; do 28 | case "$1" in 29 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 30 | *) optarg= ;; 31 | esac 32 | 33 | case $1 in 34 | --prefix=*) 35 | prefix=$optarg 36 | if test $exec_prefix_set = no ; then 37 | exec_prefix=$optarg 38 | fi 39 | ;; 40 | --prefix) 41 | echo_prefix=yes 42 | ;; 43 | --exec-prefix=*) 44 | exec_prefix=$optarg 45 | exec_prefix_set=yes 46 | ;; 47 | --exec-prefix) 48 | echo_exec_prefix=yes 49 | ;; 50 | --version) 51 | echo 0.1.12 52 | exit 0 53 | ;; 54 | --cflags) 55 | if test "$includedir" != /usr/include ; then 56 | includes="-I$includedir" 57 | fi 58 | echo_cflags=yes 59 | ;; 60 | --libs) 61 | echo_libs=yes 62 | ;; 63 | *) 64 | usage 1 1>&2 65 | ;; 66 | esac 67 | shift 68 | done 69 | 70 | if test "$echo_prefix" = "yes"; then 71 | echo $prefix 72 | fi 73 | if test "$echo_exec_prefix" = "yes"; then 74 | echo $exec_prefix 75 | fi 76 | if test "$echo_cflags" = "yes"; then 77 | echo $includes 78 | fi 79 | if test "$echo_libs" = "yes"; then 80 | echo -L$libdir -lusb 81 | fi 82 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/bin/libusb-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=/home/jenkins/jenkins/jobs/toolchain-avr-3.4.5-new-linux64/workspace/objdir 4 | exec_prefix=${prefix} 5 | includedir=${prefix}/include 6 | libdir=${exec_prefix}/lib 7 | exec_prefix_set=no 8 | 9 | usage() 10 | { 11 | cat <&2 25 | fi 26 | 27 | while test $# -gt 0; do 28 | case "$1" in 29 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 30 | *) optarg= ;; 31 | esac 32 | 33 | case $1 in 34 | --prefix=*) 35 | prefix=$optarg 36 | if test $exec_prefix_set = no ; then 37 | exec_prefix=$optarg 38 | fi 39 | ;; 40 | --prefix) 41 | echo_prefix=yes 42 | ;; 43 | --exec-prefix=*) 44 | exec_prefix=$optarg 45 | exec_prefix_set=yes 46 | ;; 47 | --exec-prefix) 48 | echo_exec_prefix=yes 49 | ;; 50 | --version) 51 | echo 0.1.12 52 | exit 0 53 | ;; 54 | --cflags) 55 | if test "$includedir" != /usr/include ; then 56 | includes="-I$includedir" 57 | fi 58 | echo_cflags=yes 59 | ;; 60 | --libs) 61 | echo_libs=yes 62 | ;; 63 | *) 64 | usage 1 1>&2 65 | ;; 66 | esac 67 | shift 68 | done 69 | 70 | if test "$echo_prefix" = "yes"; then 71 | echo $prefix 72 | fi 73 | if test "$echo_exec_prefix" = "yes"; then 74 | echo $exec_prefix 75 | fi 76 | if test "$echo_cflags" = "yes"; then 77 | echo $includes 78 | fi 79 | if test "$echo_libs" = "yes"; then 80 | echo -L$libdir -lusb 81 | fi 82 | -------------------------------------------------------------------------------- /hardware/sam/boards.txt: -------------------------------------------------------------------------------- 1 | 2 | arduino_due_x_dbg.name=Arduino Due (Programming Port) 3 | arduino_due_x_dbg.vid.0=0x2341 4 | arduino_due_x_dbg.pid.0=0x003d 5 | arduino_due_x_dbg.vid.1=0x2A03 6 | arduino_due_x_dbg.pid.1=0x003d 7 | arduino_due_x_dbg.vid.0x2A03.warning=Uncertified 8 | arduino_due_x_dbg.upload.tool=bossac 9 | arduino_due_x_dbg.upload.protocol=sam-ba 10 | arduino_due_x_dbg.upload.maximum_size=524288 11 | arduino_due_x_dbg.upload.use_1200bps_touch=true 12 | arduino_due_x_dbg.upload.wait_for_upload_port=false 13 | arduino_due_x_dbg.upload.native_usb=false 14 | arduino_due_x_dbg.build.mcu=cortex-m3 15 | arduino_due_x_dbg.build.f_cpu=84000000L 16 | arduino_due_x_dbg.build.usb_product="Arduino Due" 17 | arduino_due_x_dbg.build.board=SAM_DUE 18 | arduino_due_x_dbg.build.core=arduino 19 | arduino_due_x_dbg.build.extra_flags=-D__SAM3X8E__ -mthumb {build.usb_flags} 20 | arduino_due_x_dbg.build.ldscript=linker_scripts/gcc/flash.ld 21 | arduino_due_x_dbg.build.variant=arduino_due_x 22 | arduino_due_x_dbg.build.variant_system_lib=libsam_sam3x8e_gcc_rel.a 23 | arduino_due_x_dbg.build.vid=0x2341 24 | arduino_due_x_dbg.build.pid=0x003e 25 | 26 | arduino_due_x.name=Arduino Due (Native USB Port) 27 | arduino_due_x.vid.0=0x2341 28 | arduino_due_x.pid.0=0x003e 29 | arduino_due_x.vid.1=0x2A03 30 | arduino_due_x.pid.1=0x003e 31 | arduino_due_x.vid.0x2A03.warning=Uncertified 32 | arduino_due_x.upload.tool=bossac 33 | arduino_due_x.upload.protocol=sam-ba 34 | arduino_due_x.upload.maximum_size=524288 35 | arduino_due_x.upload.use_1200bps_touch=true 36 | arduino_due_x.upload.wait_for_upload_port=true 37 | arduino_due_x.upload.native_usb=true 38 | arduino_due_x.build.mcu=cortex-m3 39 | arduino_due_x.build.f_cpu=84000000L 40 | arduino_due_x.build.usb_product="Arduino Due" 41 | arduino_due_x.build.board=SAM_DUE 42 | arduino_due_x.build.core=arduino 43 | arduino_due_x.build.extra_flags=-D__SAM3X8E__ -mthumb {build.usb_flags} 44 | arduino_due_x.build.ldscript=linker_scripts/gcc/flash.ld 45 | arduino_due_x.build.variant=arduino_due_x 46 | arduino_due_x.build.variant_system_lib=libsam_sam3x8e_gcc_rel.a 47 | arduino_due_x.build.vid=0x2341 48 | arduino_due_x.build.pid=0x003e 49 | 50 | -------------------------------------------------------------------------------- /hardware/sam/platform.txt: -------------------------------------------------------------------------------- 1 | 2 | # Arduino SAM Core and platform. 3 | # 4 | # For more info: 5 | # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification 6 | 7 | name=Arduino ARM (32-bits) Boards 8 | version=1.6.3 9 | 10 | # SAM3 compile variables 11 | # ---------------------- 12 | 13 | compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ 14 | compiler.c.cmd=arm-none-eabi-gcc 15 | compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD 16 | compiler.c.elf.cmd=arm-none-eabi-gcc 17 | compiler.c.elf.flags=-Os -Wl,--gc-sections 18 | compiler.S.flags=-c -g -x assembler-with-cpp 19 | compiler.cpp.cmd=arm-none-eabi-g++ 20 | compiler.cpp.flags=-c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD 21 | compiler.ar.cmd=arm-none-eabi-ar 22 | compiler.ar.flags=rcs 23 | compiler.objcopy.cmd=arm-none-eabi-objcopy 24 | compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 25 | compiler.elf2hex.flags=-O binary 26 | compiler.elf2hex.cmd=arm-none-eabi-objcopy 27 | compiler.ldflags= 28 | compiler.size.cmd=arm-none-eabi-size 29 | compiler.define=-DARDUINO= 30 | 31 | # this can be overriden in boards.txt 32 | build.extra_flags= 33 | 34 | # These can be overridden in platform.local.txt 35 | compiler.c.extra_flags= 36 | compiler.c.elf.extra_flags= 37 | compiler.cpp.extra_flags= 38 | compiler.ar.extra_flags= 39 | compiler.elf2hex.extra_flags= 40 | 41 | 42 | compiler.libsam.c.flags="-I{build.system.path}/libsam" "-I{build.system.path}/CMSIS/CMSIS/Include/" "-I{build.system.path}/CMSIS/Device/ATMEL/" 43 | 44 | # USB Flags 45 | # --------- 46 | build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' 47 | 48 | # Default usb manufacturer will be replaced at compile time using 49 | # numeric vendor ID if available or by board's specific value. 50 | build.usb_manufacturer="Unknown" 51 | 52 | 53 | # SAM3 compile patterns 54 | # --------------------- 55 | 56 | ## Compile c files 57 | recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.libsam.c.flags} {includes} "{source_file}" -o "{object_file}" 58 | 59 | ## Compile c++ files 60 | recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.libsam.c.flags} {includes} "{source_file}" -o "{object_file}" 61 | 62 | ## Create archives 63 | recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" 64 | 65 | ## Combine gc-sections, archives, and objects 66 | recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc 67 | 68 | ## Create output (.bin file) 69 | recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin" 70 | 71 | ## Compute size 72 | recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" 73 | recipe.size.regex=\.text\s+([0-9]+).* 74 | 75 | 76 | # SAM3 Uploader tools 77 | # ------------------- 78 | 79 | tools.bossac.path={runtime.tools.bossac.path} 80 | tools.bossac.cmd=bossac 81 | tools.bossac.cmd.windows=bossac.exe 82 | 83 | tools.bossac.upload.params.verbose=-i -d 84 | tools.bossac.upload.params.quiet= 85 | tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -e -w -v -b "{build.path}/{build.project_name}.bin" -R 86 | 87 | -------------------------------------------------------------------------------- /hardware/avr/platform.txt: -------------------------------------------------------------------------------- 1 | 2 | # Arduino AVR Core and platform. 3 | # ------------------------------ 4 | # 5 | # For more info: 6 | # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification 7 | 8 | name=Arduino AVR Boards 9 | version=1.6.3 10 | 11 | # AVR compile variables 12 | # --------------------- 13 | 14 | compiler.warning_flags.none=-w 15 | compiler.warning_flags.normal= 16 | compiler.warning_flags.all=-Wall 17 | compiler.warning_flags.extra=-Wall -Wextra 18 | 19 | # Default "compiler.path" is correct, change only if you want to overidde the initial value 20 | compiler.path={runtime.tools.avr-gcc.path}/bin/ 21 | compiler.c.cmd=avr-gcc 22 | compiler.c.flags=-c -g -Os {compiler.warning_flags} -ffunction-sections -fdata-sections -MMD 23 | # -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396 24 | # This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain 25 | compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections 26 | compiler.c.elf.cmd=avr-gcc 27 | compiler.S.flags=-c -g -x assembler-with-cpp 28 | compiler.cpp.cmd=avr-g++ 29 | compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD 30 | compiler.ar.cmd=avr-ar 31 | compiler.ar.flags=rcs 32 | compiler.objcopy.cmd=avr-objcopy 33 | compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 34 | compiler.elf2hex.flags=-O ihex -R .eeprom 35 | compiler.elf2hex.cmd=avr-objcopy 36 | compiler.ldflags= 37 | compiler.size.cmd=avr-size 38 | 39 | # This can be overriden in boards.txt 40 | build.extra_flags= 41 | 42 | # These can be overridden in platform.local.txt 43 | compiler.c.extra_flags= 44 | compiler.c.elf.extra_flags= 45 | compiler.S.extra_flags= 46 | compiler.cpp.extra_flags= 47 | compiler.ar.extra_flags= 48 | compiler.objcopy.eep.extra_flags= 49 | compiler.elf2hex.extra_flags= 50 | 51 | # AVR compile patterns 52 | # -------------------- 53 | 54 | ## Compile c files 55 | recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 56 | 57 | ## Compile c++ files 58 | recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 59 | 60 | ## Compile S files 61 | recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 62 | 63 | ## Create archives 64 | recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" 65 | 66 | ## Combine gc-sections, archives, and objects 67 | recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm 68 | 69 | ## Create output files (.eep and .hex) 70 | recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" 71 | recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" 72 | 73 | ## Compute size 74 | recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" 75 | recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* 76 | recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* 77 | recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* 78 | 79 | 80 | # AVR Uploader/Programmers tools 81 | # ------------------------------ 82 | 83 | tools.avrdude.path={runtime.tools.avrdude.path} 84 | tools.avrdude.cmd.path={path}/bin/avrdude 85 | tools.avrdude.config.path={path}/etc/avrdude.conf 86 | 87 | tools.avrdude.upload.params.verbose=-v 88 | tools.avrdude.upload.params.quiet=-q -q 89 | tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" 90 | 91 | tools.avrdude.program.params.verbose=-v 92 | tools.avrdude.program.params.quiet=-q -q 93 | tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" 94 | 95 | tools.avrdude.erase.params.verbose=-v 96 | tools.avrdude.erase.params.quiet=-q -q 97 | tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m 98 | 99 | tools.avrdude.bootloader.params.verbose=-v 100 | tools.avrdude.bootloader.params.quiet=-q -q 101 | tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m 102 | 103 | 104 | # USB Default Flags 105 | # Default blank usb manufacturer will be filled it at compile time 106 | # - from numeric vendor ID, set to Unknown otherwise 107 | build.usb_manufacturer="Unknown" 108 | build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' 109 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/include/usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Prototypes, structure definitions and macros. 3 | * 4 | * Copyright (c) 2000-2003 Johannes Erdfelt 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * This file (and only this file) may alternatively be licensed under the 21 | * BSD license. See the LICENSE file shipped with the libusb-compat-0.1 source 22 | * distribution for details. 23 | */ 24 | 25 | #ifndef __USB_H__ 26 | #define __USB_H__ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | /* 35 | * USB spec information 36 | * 37 | * This is all stuff grabbed from various USB specs and is pretty much 38 | * not subject to change 39 | */ 40 | 41 | /* 42 | * Device and/or Interface Class codes 43 | */ 44 | #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ 45 | #define USB_CLASS_AUDIO 1 46 | #define USB_CLASS_COMM 2 47 | #define USB_CLASS_HID 3 48 | #define USB_CLASS_PRINTER 7 49 | #define USB_CLASS_PTP 6 50 | #define USB_CLASS_MASS_STORAGE 8 51 | #define USB_CLASS_HUB 9 52 | #define USB_CLASS_DATA 10 53 | #define USB_CLASS_VENDOR_SPEC 0xff 54 | 55 | /* 56 | * Descriptor types 57 | */ 58 | #define USB_DT_DEVICE 0x01 59 | #define USB_DT_CONFIG 0x02 60 | #define USB_DT_STRING 0x03 61 | #define USB_DT_INTERFACE 0x04 62 | #define USB_DT_ENDPOINT 0x05 63 | 64 | #define USB_DT_HID 0x21 65 | #define USB_DT_REPORT 0x22 66 | #define USB_DT_PHYSICAL 0x23 67 | #define USB_DT_HUB 0x29 68 | 69 | /* 70 | * Descriptor sizes per descriptor type 71 | */ 72 | #define USB_DT_DEVICE_SIZE 18 73 | #define USB_DT_CONFIG_SIZE 9 74 | #define USB_DT_INTERFACE_SIZE 9 75 | #define USB_DT_ENDPOINT_SIZE 7 76 | #define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ 77 | #define USB_DT_HUB_NONVAR_SIZE 7 78 | 79 | /* All standard descriptors have these 2 fields in common */ 80 | struct usb_descriptor_header { 81 | u_int8_t bLength; 82 | u_int8_t bDescriptorType; 83 | }; 84 | 85 | /* String descriptor */ 86 | struct usb_string_descriptor { 87 | u_int8_t bLength; 88 | u_int8_t bDescriptorType; 89 | u_int16_t wData[1]; 90 | }; 91 | 92 | /* HID descriptor */ 93 | struct usb_hid_descriptor { 94 | u_int8_t bLength; 95 | u_int8_t bDescriptorType; 96 | u_int16_t bcdHID; 97 | u_int8_t bCountryCode; 98 | u_int8_t bNumDescriptors; 99 | /* u_int8_t bReportDescriptorType; */ 100 | /* u_int16_t wDescriptorLength; */ 101 | /* ... */ 102 | }; 103 | 104 | /* Endpoint descriptor */ 105 | #define USB_MAXENDPOINTS 32 106 | struct usb_endpoint_descriptor { 107 | u_int8_t bLength; 108 | u_int8_t bDescriptorType; 109 | u_int8_t bEndpointAddress; 110 | u_int8_t bmAttributes; 111 | u_int16_t wMaxPacketSize; 112 | u_int8_t bInterval; 113 | u_int8_t bRefresh; 114 | u_int8_t bSynchAddress; 115 | 116 | unsigned char *extra; /* Extra descriptors */ 117 | int extralen; 118 | }; 119 | 120 | #define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ 121 | #define USB_ENDPOINT_DIR_MASK 0x80 122 | 123 | #define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ 124 | #define USB_ENDPOINT_TYPE_CONTROL 0 125 | #define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 126 | #define USB_ENDPOINT_TYPE_BULK 2 127 | #define USB_ENDPOINT_TYPE_INTERRUPT 3 128 | 129 | /* Interface descriptor */ 130 | #define USB_MAXINTERFACES 32 131 | struct usb_interface_descriptor { 132 | u_int8_t bLength; 133 | u_int8_t bDescriptorType; 134 | u_int8_t bInterfaceNumber; 135 | u_int8_t bAlternateSetting; 136 | u_int8_t bNumEndpoints; 137 | u_int8_t bInterfaceClass; 138 | u_int8_t bInterfaceSubClass; 139 | u_int8_t bInterfaceProtocol; 140 | u_int8_t iInterface; 141 | 142 | struct usb_endpoint_descriptor *endpoint; 143 | 144 | unsigned char *extra; /* Extra descriptors */ 145 | int extralen; 146 | }; 147 | 148 | #define USB_MAXALTSETTING 128 /* Hard limit */ 149 | struct usb_interface { 150 | struct usb_interface_descriptor *altsetting; 151 | 152 | int num_altsetting; 153 | }; 154 | 155 | /* Configuration descriptor information.. */ 156 | #define USB_MAXCONFIG 8 157 | struct usb_config_descriptor { 158 | u_int8_t bLength; 159 | u_int8_t bDescriptorType; 160 | u_int16_t wTotalLength; 161 | u_int8_t bNumInterfaces; 162 | u_int8_t bConfigurationValue; 163 | u_int8_t iConfiguration; 164 | u_int8_t bmAttributes; 165 | u_int8_t MaxPower; 166 | 167 | struct usb_interface *interface; 168 | 169 | unsigned char *extra; /* Extra descriptors */ 170 | int extralen; 171 | }; 172 | 173 | /* Device descriptor */ 174 | struct usb_device_descriptor { 175 | u_int8_t bLength; 176 | u_int8_t bDescriptorType; 177 | u_int16_t bcdUSB; 178 | u_int8_t bDeviceClass; 179 | u_int8_t bDeviceSubClass; 180 | u_int8_t bDeviceProtocol; 181 | u_int8_t bMaxPacketSize0; 182 | u_int16_t idVendor; 183 | u_int16_t idProduct; 184 | u_int16_t bcdDevice; 185 | u_int8_t iManufacturer; 186 | u_int8_t iProduct; 187 | u_int8_t iSerialNumber; 188 | u_int8_t bNumConfigurations; 189 | }; 190 | 191 | struct usb_ctrl_setup { 192 | u_int8_t bRequestType; 193 | u_int8_t bRequest; 194 | u_int16_t wValue; 195 | u_int16_t wIndex; 196 | u_int16_t wLength; 197 | }; 198 | 199 | /* 200 | * Standard requests 201 | */ 202 | #define USB_REQ_GET_STATUS 0x00 203 | #define USB_REQ_CLEAR_FEATURE 0x01 204 | /* 0x02 is reserved */ 205 | #define USB_REQ_SET_FEATURE 0x03 206 | /* 0x04 is reserved */ 207 | #define USB_REQ_SET_ADDRESS 0x05 208 | #define USB_REQ_GET_DESCRIPTOR 0x06 209 | #define USB_REQ_SET_DESCRIPTOR 0x07 210 | #define USB_REQ_GET_CONFIGURATION 0x08 211 | #define USB_REQ_SET_CONFIGURATION 0x09 212 | #define USB_REQ_GET_INTERFACE 0x0A 213 | #define USB_REQ_SET_INTERFACE 0x0B 214 | #define USB_REQ_SYNCH_FRAME 0x0C 215 | 216 | #define USB_TYPE_STANDARD (0x00 << 5) 217 | #define USB_TYPE_CLASS (0x01 << 5) 218 | #define USB_TYPE_VENDOR (0x02 << 5) 219 | #define USB_TYPE_RESERVED (0x03 << 5) 220 | 221 | #define USB_RECIP_DEVICE 0x00 222 | #define USB_RECIP_INTERFACE 0x01 223 | #define USB_RECIP_ENDPOINT 0x02 224 | #define USB_RECIP_OTHER 0x03 225 | 226 | /* 227 | * Various libusb API related stuff 228 | */ 229 | 230 | #define USB_ENDPOINT_IN 0x80 231 | #define USB_ENDPOINT_OUT 0x00 232 | 233 | /* Error codes */ 234 | #define USB_ERROR_BEGIN 500000 235 | 236 | /* Data types */ 237 | struct usb_device; 238 | struct usb_bus; 239 | 240 | /* 241 | * To maintain compatibility with applications already built with libusb, 242 | * we must only add entries to the end of this structure. NEVER delete or 243 | * move members and only change types if you really know what you're doing. 244 | */ 245 | struct usb_device { 246 | struct usb_device *next, *prev; 247 | 248 | char filename[PATH_MAX + 1]; 249 | 250 | struct usb_bus *bus; 251 | 252 | struct usb_device_descriptor descriptor; 253 | struct usb_config_descriptor *config; 254 | 255 | void *dev; /* Darwin support */ 256 | 257 | u_int8_t devnum; 258 | 259 | unsigned char num_children; 260 | struct usb_device **children; 261 | }; 262 | 263 | struct usb_bus { 264 | struct usb_bus *next, *prev; 265 | 266 | char dirname[PATH_MAX + 1]; 267 | 268 | struct usb_device *devices; 269 | u_int32_t location; 270 | 271 | struct usb_device *root_dev; 272 | }; 273 | 274 | struct usb_dev_handle; 275 | typedef struct usb_dev_handle usb_dev_handle; 276 | 277 | /* Variables */ 278 | extern struct usb_bus *usb_busses; 279 | 280 | #ifdef __cplusplus 281 | extern "C" { 282 | #endif 283 | 284 | /* Function prototypes */ 285 | 286 | /* usb.c */ 287 | usb_dev_handle *usb_open(struct usb_device *dev); 288 | int usb_close(usb_dev_handle *dev); 289 | int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, 290 | size_t buflen); 291 | int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, 292 | size_t buflen); 293 | 294 | /* descriptors.c */ 295 | int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, 296 | unsigned char type, unsigned char index, void *buf, int size); 297 | int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, 298 | unsigned char index, void *buf, int size); 299 | 300 | /* .c */ 301 | int usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, 302 | int timeout); 303 | int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, 304 | int timeout); 305 | int usb_interrupt_write(usb_dev_handle *dev, int ep, const char *bytes, 306 | int size, int timeout); 307 | int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, 308 | int timeout); 309 | int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, 310 | int value, int index, char *bytes, int size, int timeout); 311 | int usb_set_configuration(usb_dev_handle *dev, int configuration); 312 | int usb_claim_interface(usb_dev_handle *dev, int interface); 313 | int usb_release_interface(usb_dev_handle *dev, int interface); 314 | int usb_set_altinterface(usb_dev_handle *dev, int alternate); 315 | int usb_resetep(usb_dev_handle *dev, unsigned int ep); 316 | int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); 317 | int usb_reset(usb_dev_handle *dev); 318 | 319 | #define LIBUSB_HAS_GET_DRIVER_NP 1 320 | int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, 321 | unsigned int namelen); 322 | #define LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP 1 323 | int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); 324 | 325 | char *usb_strerror(void); 326 | 327 | void usb_init(void); 328 | void usb_set_debug(int level); 329 | int usb_find_busses(void); 330 | int usb_find_devices(void); 331 | struct usb_device *usb_device(usb_dev_handle *dev); 332 | struct usb_bus *usb_get_busses(void); 333 | 334 | #ifdef __cplusplus 335 | } 336 | #endif 337 | 338 | #endif /* __USB_H__ */ 339 | 340 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /hardware/avr/boards.txt: -------------------------------------------------------------------------------- 1 | # See: http://code.google.com/p/arduino/wiki/Platforms 2 | 3 | menu.cpu=Processor 4 | 5 | ############################################################## 6 | 7 | yun.name=Arduino Yún 8 | yun.upload.via_ssh=true 9 | 10 | yun.vid.0=0x2341 11 | yun.pid.0=0x0041 12 | yun.vid.1=0x2341 13 | yun.pid.1=0x8041 14 | yun.vid.2=0x2A03 15 | yun.pid.2=0x0041 16 | yun.vid.3=0x2A03 17 | yun.pid.3=0x8041 18 | 19 | yun.vid.0x2A03.warning=Uncertified 20 | 21 | yun.upload.tool=avrdude 22 | yun.upload.protocol=avr109 23 | yun.upload.maximum_size=28672 24 | yun.upload.maximum_data_size=2560 25 | yun.upload.speed=57600 26 | yun.upload.disable_flushing=true 27 | yun.upload.use_1200bps_touch=true 28 | yun.upload.wait_for_upload_port=true 29 | 30 | yun.bootloader.tool=avrdude 31 | yun.bootloader.low_fuses=0xff 32 | yun.bootloader.high_fuses=0xd8 33 | yun.bootloader.extended_fuses=0xfb 34 | yun.bootloader.file=caterina/Caterina-Yun.hex 35 | yun.bootloader.unlock_bits=0x3F 36 | yun.bootloader.lock_bits=0x2F 37 | 38 | yun.build.mcu=atmega32u4 39 | yun.build.f_cpu=16000000L 40 | yun.build.vid=0x2341 41 | yun.build.pid=0x8041 42 | yun.build.usb_product="Arduino Yun" 43 | yun.build.board=AVR_YUN 44 | yun.build.core=arduino 45 | yun.build.variant=yun 46 | yun.build.extra_flags={build.usb_flags} 47 | 48 | ############################################################## 49 | 50 | uno.name=Arduino Uno 51 | 52 | uno.vid.0=0x2341 53 | uno.pid.0=0x0043 54 | uno.vid.1=0x2341 55 | uno.pid.1=0x0001 56 | uno.vid.2=0x2A03 57 | uno.pid.2=0x0043 58 | 59 | uno.vid.0x2A03.warning=Uncertified 60 | 61 | uno.upload.tool=avrdude 62 | uno.upload.protocol=arduino 63 | uno.upload.maximum_size=32256 64 | uno.upload.maximum_data_size=2048 65 | uno.upload.speed=115200 66 | 67 | uno.bootloader.tool=avrdude 68 | uno.bootloader.low_fuses=0xFF 69 | uno.bootloader.high_fuses=0xDE 70 | uno.bootloader.extended_fuses=0x05 71 | uno.bootloader.unlock_bits=0x3F 72 | uno.bootloader.lock_bits=0x0F 73 | uno.bootloader.file=optiboot/optiboot_atmega328.hex 74 | 75 | uno.build.mcu=atmega328p 76 | uno.build.f_cpu=16000000L 77 | uno.build.board=AVR_UNO 78 | uno.build.core=arduino 79 | uno.build.variant=standard 80 | 81 | ############################################################## 82 | 83 | diecimila.name=Arduino Duemilanove or Diecimila 84 | 85 | diecimila.upload.tool=avrdude 86 | diecimila.upload.protocol=arduino 87 | 88 | diecimila.bootloader.tool=avrdude 89 | diecimila.bootloader.low_fuses=0xFF 90 | diecimila.bootloader.unlock_bits=0x3F 91 | diecimila.bootloader.lock_bits=0x0F 92 | 93 | diecimila.build.f_cpu=16000000L 94 | diecimila.build.board=AVR_DUEMILANOVE 95 | diecimila.build.core=arduino 96 | diecimila.build.variant=standard 97 | 98 | ## Arduino Duemilanove or Diecimila w/ ATmega328 99 | ## --------------------------------------------- 100 | diecimila.menu.cpu.atmega328=ATmega328 101 | 102 | diecimila.menu.cpu.atmega328.upload.maximum_size=30720 103 | diecimila.menu.cpu.atmega328.upload.maximum_data_size=2048 104 | diecimila.menu.cpu.atmega328.upload.speed=57600 105 | 106 | diecimila.menu.cpu.atmega328.bootloader.high_fuses=0xDA 107 | diecimila.menu.cpu.atmega328.bootloader.extended_fuses=0x05 108 | diecimila.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex 109 | 110 | diecimila.menu.cpu.atmega328.build.mcu=atmega328p 111 | 112 | ## Arduino Duemilanove or Diecimila w/ ATmega168 113 | ## --------------------------------------------- 114 | diecimila.menu.cpu.atmega168=ATmega168 115 | 116 | diecimila.menu.cpu.atmega168.upload.maximum_size=14336 117 | diecimila.menu.cpu.atmega168.upload.maximum_data_size=1024 118 | diecimila.menu.cpu.atmega168.upload.speed=19200 119 | 120 | diecimila.menu.cpu.atmega168.bootloader.high_fuses=0xdd 121 | diecimila.menu.cpu.atmega168.bootloader.extended_fuses=0x00 122 | diecimila.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex 123 | 124 | diecimila.menu.cpu.atmega168.build.mcu=atmega168 125 | 126 | ############################################################## 127 | 128 | nano.name=Arduino Nano 129 | 130 | nano.upload.tool=avrdude 131 | nano.upload.protocol=arduino 132 | 133 | nano.bootloader.tool=avrdude 134 | nano.bootloader.unlock_bits=0x3F 135 | nano.bootloader.lock_bits=0x0F 136 | 137 | nano.build.f_cpu=16000000L 138 | nano.build.board=AVR_NANO 139 | nano.build.core=arduino 140 | nano.build.variant=eightanaloginputs 141 | 142 | ## Arduino Nano w/ ATmega328 143 | ## ------------------------- 144 | nano.menu.cpu.atmega328=ATmega328 145 | 146 | nano.menu.cpu.atmega328.upload.maximum_size=30720 147 | nano.menu.cpu.atmega328.upload.maximum_data_size=2048 148 | nano.menu.cpu.atmega328.upload.speed=57600 149 | 150 | nano.menu.cpu.atmega328.bootloader.low_fuses=0xFF 151 | nano.menu.cpu.atmega328.bootloader.high_fuses=0xDA 152 | nano.menu.cpu.atmega328.bootloader.extended_fuses=0x05 153 | nano.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex 154 | 155 | nano.menu.cpu.atmega328.build.mcu=atmega328p 156 | 157 | ## Arduino Nano w/ ATmega168 158 | ## ------------------------- 159 | nano.menu.cpu.atmega168=ATmega168 160 | 161 | nano.menu.cpu.atmega168.upload.maximum_size=14336 162 | nano.menu.cpu.atmega168.upload.maximum_data_size=1024 163 | nano.menu.cpu.atmega168.upload.speed=19200 164 | 165 | nano.menu.cpu.atmega168.bootloader.low_fuses=0xff 166 | nano.menu.cpu.atmega168.bootloader.high_fuses=0xdd 167 | nano.menu.cpu.atmega168.bootloader.extended_fuses=0x00 168 | nano.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex 169 | 170 | nano.menu.cpu.atmega168.build.mcu=atmega168 171 | 172 | ############################################################## 173 | 174 | mega.name=Arduino Mega or Mega 2560 175 | 176 | mega.vid.0=0x2341 177 | mega.pid.0=0x0010 178 | mega.vid.1=0x2341 179 | mega.pid.1=0x0042 180 | mega.vid.2=0x2A03 181 | mega.pid.2=0x0010 182 | mega.vid.3=0x2A03 183 | mega.pid.3=0x0042 184 | 185 | mega.vid.0x2A03.warning=Uncertified 186 | 187 | mega.upload.tool=avrdude 188 | mega.upload.maximum_data_size=8192 189 | 190 | mega.bootloader.tool=avrdude 191 | mega.bootloader.low_fuses=0xFF 192 | mega.bootloader.unlock_bits=0x3F 193 | mega.bootloader.lock_bits=0x0F 194 | 195 | mega.build.f_cpu=16000000L 196 | mega.build.core=arduino 197 | mega.build.variant=mega 198 | # default board may be overridden by the cpu menu 199 | mega.build.board=AVR_MEGA2560 200 | 201 | ## Arduino Mega w/ ATmega2560 202 | ## ------------------------- 203 | mega.menu.cpu.atmega2560=ATmega2560 (Mega 2560) 204 | 205 | mega.menu.cpu.atmega2560.upload.protocol=wiring 206 | mega.menu.cpu.atmega2560.upload.maximum_size=253952 207 | mega.menu.cpu.atmega2560.upload.speed=115200 208 | 209 | mega.menu.cpu.atmega2560.bootloader.high_fuses=0xD8 210 | mega.menu.cpu.atmega2560.bootloader.extended_fuses=0xFD 211 | mega.menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 212 | 213 | mega.menu.cpu.atmega2560.build.mcu=atmega2560 214 | mega.menu.cpu.atmega2560.build.board=AVR_MEGA2560 215 | 216 | ## Arduino Mega w/ ATmega1280 217 | ## ------------------------- 218 | mega.menu.cpu.atmega1280=ATmega1280 219 | 220 | mega.menu.cpu.atmega1280.upload.protocol=arduino 221 | mega.menu.cpu.atmega1280.upload.maximum_size=126976 222 | mega.menu.cpu.atmega1280.upload.speed=57600 223 | 224 | mega.menu.cpu.atmega1280.bootloader.high_fuses=0xDA 225 | mega.menu.cpu.atmega1280.bootloader.extended_fuses=0xF5 226 | mega.menu.cpu.atmega1280.bootloader.file=atmega/ATmegaBOOT_168_atmega1280.hex 227 | 228 | mega.menu.cpu.atmega1280.build.mcu=atmega1280 229 | mega.menu.cpu.atmega1280.build.board=AVR_MEGA 230 | 231 | ############################################################## 232 | 233 | megaADK.name=Arduino Mega ADK 234 | 235 | megaADK.vid.0=0x2341 236 | megaADK.pid.0=0x003f 237 | megaADK.vid.1=0x2341 238 | megaADK.pid.1=0x0044 239 | megaADK.vid.2=0x2A03 240 | megaADK.pid.2=0x003f 241 | megaADK.vid.3=0x2A03 242 | megaADK.pid.3=0x0044 243 | 244 | megaADK.vid.0x2A03.warning=Uncertified 245 | 246 | megaADK.upload.tool=avrdude 247 | megaADK.upload.protocol=wiring 248 | megaADK.upload.maximum_size=253952 249 | megaADK.upload.maximum_data_size=8192 250 | megaADK.upload.speed=115200 251 | 252 | megaADK.bootloader.tool=avrdude 253 | megaADK.bootloader.low_fuses=0xFF 254 | megaADK.bootloader.high_fuses=0xD8 255 | megaADK.bootloader.extended_fuses=0xFD 256 | megaADK.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 257 | megaADK.bootloader.unlock_bits=0x3F 258 | megaADK.bootloader.lock_bits=0x0F 259 | 260 | megaADK.build.mcu=atmega2560 261 | megaADK.build.f_cpu=16000000L 262 | megaADK.build.board=AVR_ADK 263 | megaADK.build.core=arduino 264 | megaADK.build.variant=mega 265 | 266 | ############################################################## 267 | 268 | leonardo.name=Arduino Leonardo 269 | leonardo.vid.0=0x2341 270 | leonardo.pid.0=0x0036 271 | leonardo.vid.1=0x2341 272 | leonardo.pid.1=0x8036 273 | leonardo.vid.2=0x2A03 274 | leonardo.pid.2=0x0036 275 | leonardo.vid.3=0x2A03 276 | leonardo.pid.3=0x8036 277 | 278 | leonardo.vid.0x2A03.warning=Uncertified 279 | 280 | leonardo.upload.tool=avrdude 281 | leonardo.upload.protocol=avr109 282 | leonardo.upload.maximum_size=28672 283 | leonardo.upload.maximum_data_size=2560 284 | leonardo.upload.speed=57600 285 | leonardo.upload.disable_flushing=true 286 | leonardo.upload.use_1200bps_touch=true 287 | leonardo.upload.wait_for_upload_port=true 288 | 289 | leonardo.bootloader.tool=avrdude 290 | leonardo.bootloader.low_fuses=0xff 291 | leonardo.bootloader.high_fuses=0xd8 292 | leonardo.bootloader.extended_fuses=0xcb 293 | leonardo.bootloader.file=caterina/Caterina-Leonardo.hex 294 | leonardo.bootloader.unlock_bits=0x3F 295 | leonardo.bootloader.lock_bits=0x2F 296 | 297 | leonardo.build.mcu=atmega32u4 298 | leonardo.build.f_cpu=16000000L 299 | leonardo.build.vid=0x2341 300 | leonardo.build.pid=0x8036 301 | leonardo.build.usb_product="Arduino Leonardo" 302 | leonardo.build.board=AVR_LEONARDO 303 | leonardo.build.core=arduino 304 | leonardo.build.variant=leonardo 305 | leonardo.build.extra_flags={build.usb_flags} 306 | 307 | ############################################################## 308 | 309 | micro.name=Arduino Micro 310 | micro.vid.0=0x2341 311 | micro.pid.0=0x0037 312 | micro.vid.1=0x2341 313 | micro.pid.1=0x8037 314 | micro.vid.2=0x2A03 315 | micro.pid.2=0x0037 316 | micro.vid.3=0x2A03 317 | micro.pid.3=0x8037 318 | 319 | micro.vid.0x2A03.warning=Uncertified 320 | 321 | micro.upload.tool=avrdude 322 | micro.upload.protocol=avr109 323 | micro.upload.maximum_size=28672 324 | micro.upload.maximum_data_size=2560 325 | micro.upload.speed=57600 326 | micro.upload.disable_flushing=true 327 | micro.upload.use_1200bps_touch=true 328 | micro.upload.wait_for_upload_port=true 329 | 330 | micro.bootloader.tool=avrdude 331 | micro.bootloader.low_fuses=0xff 332 | micro.bootloader.high_fuses=0xd8 333 | micro.bootloader.extended_fuses=0xcb 334 | micro.bootloader.file=caterina/Caterina-Micro.hex 335 | micro.bootloader.unlock_bits=0x3F 336 | micro.bootloader.lock_bits=0x2F 337 | 338 | micro.build.mcu=atmega32u4 339 | micro.build.f_cpu=16000000L 340 | micro.build.vid=0x2341 341 | micro.build.pid=0x8037 342 | micro.build.usb_product="Arduino Micro" 343 | micro.build.board=AVR_MICRO 344 | micro.build.core=arduino 345 | micro.build.variant=micro 346 | micro.build.extra_flags={build.usb_flags} 347 | 348 | ############################################################## 349 | 350 | esplora.name=Arduino Esplora 351 | esplora.vid.0=0x2341 352 | esplora.pid.0=0x003C 353 | esplora.vid.1=0x2341 354 | esplora.pid.1=0x803C 355 | esplora.vid.2=0x2A03 356 | esplora.pid.2=0x003C 357 | esplora.vid.3=0x2A03 358 | esplora.pid.3=0x803C 359 | 360 | esplora.vid.0x2A03.warning=Uncertified 361 | 362 | esplora.upload.tool=avrdude 363 | esplora.upload.protocol=avr109 364 | esplora.upload.maximum_size=28672 365 | esplora.upload.maximum_data_size=2560 366 | esplora.upload.speed=57600 367 | esplora.upload.disable_flushing=true 368 | esplora.upload.use_1200bps_touch=true 369 | esplora.upload.wait_for_upload_port=true 370 | 371 | esplora.bootloader.tool=avrdude 372 | esplora.bootloader.low_fuses=0xff 373 | esplora.bootloader.high_fuses=0xd8 374 | esplora.bootloader.extended_fuses=0xcb 375 | esplora.bootloader.file=caterina/Caterina-Esplora.hex 376 | esplora.bootloader.unlock_bits=0x3F 377 | esplora.bootloader.lock_bits=0x2F 378 | 379 | esplora.build.mcu=atmega32u4 380 | esplora.build.f_cpu=16000000L 381 | esplora.build.vid=0x2341 382 | esplora.build.pid=0x803c 383 | esplora.build.usb_product="Arduino Esplora" 384 | esplora.build.board=AVR_ESPLORA 385 | esplora.build.core=arduino 386 | esplora.build.variant=leonardo 387 | esplora.build.extra_flags={build.usb_flags} 388 | 389 | ############################################################## 390 | 391 | mini.name=Arduino Mini 392 | 393 | mini.upload.tool=avrdude 394 | mini.upload.protocol=arduino 395 | 396 | mini.bootloader.tool=avrdude 397 | mini.bootloader.low_fuses=0xff 398 | mini.bootloader.unlock_bits=0x3F 399 | mini.bootloader.lock_bits=0x0F 400 | 401 | mini.build.f_cpu=16000000L 402 | mini.build.board=AVR_MINI 403 | mini.build.core=arduino 404 | mini.build.variant=eightanaloginputs 405 | 406 | ## Arduino Mini w/ ATmega328 407 | ## ------------------------- 408 | mini.menu.cpu.atmega328=ATmega328 409 | 410 | mini.menu.cpu.atmega328.upload.maximum_size=28672 411 | mini.menu.cpu.atmega328.upload.maximum_data_size=2048 412 | mini.menu.cpu.atmega328.upload.speed=115200 413 | 414 | mini.menu.cpu.atmega328.bootloader.high_fuses=0xd8 415 | mini.menu.cpu.atmega328.bootloader.extended_fuses=0x05 416 | mini.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328-Mini.hex 417 | 418 | mini.menu.cpu.atmega328.build.mcu=atmega328p 419 | 420 | ## Arduino Mini w/ ATmega168 421 | ## ------------------------- 422 | mini.menu.cpu.atmega168=ATmega168 423 | 424 | mini.menu.cpu.atmega168.upload.maximum_size=14336 425 | mini.menu.cpu.atmega168.upload.maximum_data_size=1024 426 | mini.menu.cpu.atmega168.upload.speed=19200 427 | 428 | mini.menu.cpu.atmega168.bootloader.high_fuses=0xdd 429 | mini.menu.cpu.atmega168.bootloader.extended_fuses=0x00 430 | mini.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_ng.hex 431 | 432 | mini.menu.cpu.atmega168.build.mcu=atmega168 433 | 434 | ############################################################## 435 | 436 | ethernet.name=Arduino Ethernet 437 | 438 | ethernet.upload.tool=avrdude 439 | ethernet.upload.protocol=arduino 440 | ethernet.upload.maximum_size=32256 441 | ethernet.upload.maximum_data_size=2048 442 | ethernet.upload.speed=115200 443 | 444 | ethernet.bootloader.tool=avrdude 445 | ethernet.bootloader.low_fuses=0xff 446 | ethernet.bootloader.high_fuses=0xde 447 | ethernet.bootloader.extended_fuses=0x05 448 | ethernet.bootloader.file=optiboot/optiboot_atmega328.hex 449 | ethernet.bootloader.unlock_bits=0x3F 450 | ethernet.bootloader.lock_bits=0x0F 451 | 452 | ethernet.build.variant=ethernet 453 | ethernet.build.mcu=atmega328p 454 | ethernet.build.f_cpu=16000000L 455 | ethernet.build.board=AVR_ETHERNET 456 | ethernet.build.core=arduino 457 | 458 | ############################################################## 459 | 460 | fio.name=Arduino Fio 461 | 462 | fio.upload.tool=avrdude 463 | fio.upload.protocol=arduino 464 | fio.upload.maximum_size=30720 465 | fio.upload.maximum_data_size=2048 466 | fio.upload.speed=57600 467 | 468 | fio.bootloader.tool=avrdude 469 | fio.bootloader.low_fuses=0xFF 470 | fio.bootloader.high_fuses=0xDA 471 | fio.bootloader.extended_fuses=0x05 472 | fio.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex 473 | fio.bootloader.unlock_bits=0x3F 474 | fio.bootloader.lock_bits=0x0F 475 | 476 | fio.build.mcu=atmega328p 477 | fio.build.f_cpu=8000000L 478 | fio.build.board=AVR_FIO 479 | fio.build.core=arduino 480 | fio.build.variant=eightanaloginputs 481 | 482 | ############################################################## 483 | 484 | bt.name=Arduino BT 485 | 486 | bt.upload.tool=avrdude 487 | bt.upload.protocol=arduino 488 | bt.upload.speed=19200 489 | bt.upload.disable_flushing=true 490 | 491 | bt.bootloader.tool=avrdude 492 | bt.bootloader.low_fuses=0xff 493 | bt.bootloader.unlock_bits=0x3F 494 | bt.bootloader.lock_bits=0x0F 495 | 496 | bt.build.f_cpu=16000000L 497 | bt.build.board=AVR_BT 498 | bt.build.core=arduino 499 | bt.build.variant=eightanaloginputs 500 | 501 | ## Arduino BT w/ ATmega328 502 | ## ----------------------- 503 | bt.menu.cpu.atmega328=ATmega328 504 | bt.menu.cpu.atmega328.upload.maximum_size=28672 505 | bt.menu.cpu.atmega328.upload.maximum_data_size=2048 506 | 507 | bt.menu.cpu.atmega328.bootloader.high_fuses=0xd8 508 | bt.menu.cpu.atmega328.bootloader.extended_fuses=0x05 509 | bt.menu.cpu.atmega328.bootloader.file=bt/ATmegaBOOT_168_atmega328_bt.hex 510 | 511 | bt.menu.cpu.atmega328.build.mcu=atmega328p 512 | 513 | ## Arduino BT w/ ATmega168 514 | ## ----------------------- 515 | bt.menu.cpu.atmega168=ATmega168 516 | bt.menu.cpu.atmega168.upload.maximum_size=14336 517 | bt.menu.cpu.atmega168.upload.maximum_data_size=1024 518 | 519 | bt.menu.cpu.atmega168.bootloader.high_fuses=0xdd 520 | bt.menu.cpu.atmega168.bootloader.extended_fuses=0x00 521 | bt.menu.cpu.atmega168.bootloader.file=bt/ATmegaBOOT_168.hex 522 | 523 | bt.menu.cpu.atmega168.build.mcu=atmega168 524 | 525 | ############################################################## 526 | 527 | LilyPadUSB.name=LilyPad Arduino USB 528 | LilyPadUSB.vid.0=0x1B4F 529 | LilyPadUSB.pid.0=0x9207 530 | LilyPadUSB.vid.1=0x1B4F 531 | LilyPadUSB.pid.1=0x9208 532 | 533 | LilyPadUSB.upload.tool=avrdude 534 | LilyPadUSB.upload.protocol=avr109 535 | LilyPadUSB.upload.maximum_size=28672 536 | LilyPadUSB.upload.maximum_data_size=2560 537 | LilyPadUSB.upload.speed=57600 538 | LilyPadUSB.upload.disable_flushing=true 539 | LilyPadUSB.upload.use_1200bps_touch=true 540 | LilyPadUSB.upload.wait_for_upload_port=true 541 | 542 | LilyPadUSB.bootloader.tool=avrdude 543 | LilyPadUSB.bootloader.low_fuses=0xff 544 | LilyPadUSB.bootloader.high_fuses=0xd8 545 | LilyPadUSB.bootloader.extended_fuses=0xce 546 | LilyPadUSB.bootloader.file=caterina-LilyPadUSB/Caterina-LilyPadUSB.hex 547 | LilyPadUSB.bootloader.unlock_bits=0x3F 548 | LilyPadUSB.bootloader.lock_bits=0x2F 549 | 550 | LilyPadUSB.build.mcu=atmega32u4 551 | LilyPadUSB.build.f_cpu=8000000L 552 | LilyPadUSB.build.vid=0x1B4F 553 | LilyPadUSB.build.pid=0x9208 554 | LilyPadUSB.build.usb_product="LilyPad USB" 555 | LilyPadUSB.build.board=AVR_LILYPAD_USB 556 | LilyPadUSB.build.core=arduino 557 | LilyPadUSB.build.variant=leonardo 558 | LilyPadUSB.build.extra_flags={build.usb_flags} 559 | 560 | ############################################################## 561 | 562 | lilypad.name=LilyPad Arduino 563 | 564 | lilypad.upload.tool=avrdude 565 | lilypad.upload.protocol=arduino 566 | 567 | lilypad.bootloader.tool=avrdude 568 | lilypad.bootloader.unlock_bits=0x3F 569 | lilypad.bootloader.lock_bits=0x0F 570 | 571 | lilypad.build.f_cpu=8000000L 572 | lilypad.build.board=AVR_LILYPAD 573 | lilypad.build.core=arduino 574 | lilypad.build.variant=standard 575 | 576 | ## LilyPad Arduino w/ ATmega328 577 | ## ---------------------------- 578 | lilypad.menu.cpu.atmega328=ATmega328 579 | 580 | lilypad.menu.cpu.atmega328.upload.maximum_size=30720 581 | lilypad.menu.cpu.atmega328.upload.maximum_data_size=2048 582 | lilypad.menu.cpu.atmega328.upload.speed=57600 583 | 584 | lilypad.menu.cpu.atmega328.bootloader.low_fuses=0xFF 585 | lilypad.menu.cpu.atmega328.bootloader.high_fuses=0xDA 586 | lilypad.menu.cpu.atmega328.bootloader.extended_fuses=0x05 587 | lilypad.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex 588 | 589 | lilypad.menu.cpu.atmega328.build.mcu=atmega328p 590 | 591 | ## LilyPad Arduino w/ ATmega168 592 | ## ---------------------------- 593 | lilypad.menu.cpu.atmega168=ATmega168 594 | 595 | lilypad.menu.cpu.atmega168.upload.maximum_size=14336 596 | lilypad.menu.cpu.atmega168.upload.maximum_data_size=1024 597 | lilypad.menu.cpu.atmega168.upload.speed=19200 598 | 599 | lilypad.menu.cpu.atmega168.bootloader.low_fuses=0xe2 600 | lilypad.menu.cpu.atmega168.bootloader.high_fuses=0xdd 601 | lilypad.menu.cpu.atmega168.bootloader.extended_fuses=0x00 602 | lilypad.menu.cpu.atmega168.bootloader.file=lilypad/LilyPadBOOT_168.hex 603 | 604 | lilypad.menu.cpu.atmega168.build.mcu=atmega168 605 | 606 | ############################################################## 607 | 608 | pro.name=Arduino Pro or Pro Mini 609 | 610 | pro.upload.tool=avrdude 611 | pro.upload.protocol=arduino 612 | 613 | pro.bootloader.tool=avrdude 614 | pro.bootloader.unlock_bits=0x3F 615 | pro.bootloader.lock_bits=0x0F 616 | 617 | pro.build.board=AVR_PRO 618 | pro.build.core=arduino 619 | pro.build.variant=eightanaloginputs 620 | 621 | ## Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328 622 | ## ------------------------------------------------- 623 | pro.menu.cpu.16MHzatmega328=ATmega328 (5V, 16 MHz) 624 | 625 | pro.menu.cpu.16MHzatmega328.upload.maximum_size=30720 626 | pro.menu.cpu.16MHzatmega328.upload.maximum_data_size=2048 627 | pro.menu.cpu.16MHzatmega328.upload.speed=57600 628 | 629 | pro.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF 630 | pro.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA 631 | pro.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x05 632 | pro.menu.cpu.16MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex 633 | 634 | pro.menu.cpu.16MHzatmega328.build.mcu=atmega328p 635 | pro.menu.cpu.16MHzatmega328.build.f_cpu=16000000L 636 | 637 | ## Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328 638 | ## -------------------------------------------------- 639 | pro.menu.cpu.8MHzatmega328=ATmega328 (3.3V, 8 MHz) 640 | 641 | pro.menu.cpu.8MHzatmega328.upload.maximum_size=30720 642 | pro.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048 643 | pro.menu.cpu.8MHzatmega328.upload.speed=57600 644 | 645 | pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF 646 | pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA 647 | pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x05 648 | pro.menu.cpu.8MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex 649 | 650 | pro.menu.cpu.8MHzatmega328.build.mcu=atmega328p 651 | pro.menu.cpu.8MHzatmega328.build.f_cpu=8000000L 652 | 653 | ## Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168 654 | ## ------------------------------------------------- 655 | pro.menu.cpu.16MHzatmega168=ATmega168 (5V, 16 MHz) 656 | 657 | pro.menu.cpu.16MHzatmega168.upload.maximum_size=14336 658 | pro.menu.cpu.16MHzatmega168.upload.maximum_data_size=1024 659 | pro.menu.cpu.16MHzatmega168.upload.speed=19200 660 | 661 | pro.menu.cpu.16MHzatmega168.bootloader.low_fuses=0xff 662 | pro.menu.cpu.16MHzatmega168.bootloader.high_fuses=0xdd 663 | pro.menu.cpu.16MHzatmega168.bootloader.extended_fuses=0x00 664 | pro.menu.cpu.16MHzatmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex 665 | 666 | pro.menu.cpu.16MHzatmega168.build.mcu=atmega168 667 | pro.menu.cpu.16MHzatmega168.build.f_cpu=16000000L 668 | 669 | ## Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168 670 | ## -------------------------------------------------- 671 | pro.menu.cpu.8MHzatmega168=ATmega168 (3.3V, 8 MHz) 672 | 673 | pro.menu.cpu.8MHzatmega168.upload.maximum_size=14336 674 | pro.menu.cpu.8MHzatmega168.upload.maximum_data_size=1024 675 | pro.menu.cpu.8MHzatmega168.upload.speed=19200 676 | 677 | pro.menu.cpu.8MHzatmega168.bootloader.low_fuses=0xc6 678 | pro.menu.cpu.8MHzatmega168.bootloader.high_fuses=0xdd 679 | pro.menu.cpu.8MHzatmega168.bootloader.extended_fuses=0x00 680 | pro.menu.cpu.8MHzatmega168.bootloader.file=atmega/ATmegaBOOT_168_pro_8MHz.hex 681 | 682 | pro.menu.cpu.8MHzatmega168.build.mcu=atmega168 683 | pro.menu.cpu.8MHzatmega168.build.f_cpu=8000000L 684 | 685 | ############################################################## 686 | 687 | atmegang.name=Arduino NG or older 688 | 689 | atmegang.upload.tool=avrdude 690 | atmegang.upload.protocol=arduino 691 | atmegang.upload.speed=19200 692 | 693 | atmegang.bootloader.tool=avrdude 694 | atmegang.bootloader.unlock_bits=0x3F 695 | atmegang.bootloader.lock_bits=0x0F 696 | 697 | atmegang.build.mcu=atmegang 698 | atmegang.build.f_cpu=16000000L 699 | atmegang.build.board=AVR_NG 700 | atmegang.build.core=arduino 701 | atmegang.build.variant=standard 702 | 703 | ## Arduino NG or older w/ ATmega168 704 | ## -------------------------------- 705 | atmegang.menu.cpu.atmega168=ATmega168 706 | 707 | atmegang.menu.cpu.atmega168.upload.maximum_size=14336 708 | atmegang.menu.cpu.atmega168.upload.maximum_data_size=1024 709 | 710 | atmegang.menu.cpu.atmega168.bootloader.low_fuses=0xff 711 | atmegang.menu.cpu.atmega168.bootloader.high_fuses=0xdd 712 | atmegang.menu.cpu.atmega168.bootloader.extended_fuses=0x00 713 | atmegang.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_ng.hex 714 | 715 | atmegang.menu.cpu.atmega168.build.mcu=atmega168 716 | 717 | ## Arduino NG or older w/ ATmega8 718 | ## ------------------------------ 719 | atmegang.menu.cpu.atmega8=ATmega8 720 | 721 | atmegang.menu.cpu.atmega8.upload.maximum_size=7168 722 | atmegang.menu.cpu.atmega8.upload.maximum_data_size=1024 723 | 724 | atmegang.menu.cpu.atmega8.bootloader.low_fuses=0xdf 725 | atmegang.menu.cpu.atmega8.bootloader.high_fuses=0xca 726 | atmegang.menu.cpu.atmega8.bootloader.file=atmega8/ATmegaBOOT-prod-firmware-2009-11-07.hex 727 | 728 | atmegang.menu.cpu.atmega8.build.mcu=atmega8 729 | 730 | ############################################################## 731 | 732 | robotControl.name=Arduino Robot Control 733 | robotControl.vid.0=0x2341 734 | robotControl.pid.0=0x0038 735 | robotControl.vid.1=0x2341 736 | robotControl.pid.1=0x8038 737 | robotControl.vid.2=0x2A03 738 | robotControl.pid.2=0x0038 739 | robotControl.vid.3=0x2A03 740 | robotControl.pid.3=0x8038 741 | 742 | robotControl.vid.0x2A03.warning=Uncertified 743 | 744 | robotControl.upload.tool=avrdude 745 | robotControl.upload.protocol=avr109 746 | robotControl.upload.maximum_size=28672 747 | robotControl.upload.maximum_data_size=2560 748 | robotControl.upload.speed=57600 749 | robotControl.upload.disable_flushing=true 750 | robotControl.upload.use_1200bps_touch=true 751 | robotControl.upload.wait_for_upload_port=true 752 | 753 | robotControl.bootloader.tool=avrdude 754 | robotControl.bootloader.low_fuses=0xff 755 | robotControl.bootloader.high_fuses=0xd8 756 | robotControl.bootloader.extended_fuses=0xcb 757 | robotControl.bootloader.file=caterina-Arduino_Robot/Caterina-Robot-Control.hex 758 | robotControl.bootloader.unlock_bits=0x3F 759 | robotControl.bootloader.lock_bits=0x2F 760 | 761 | robotControl.build.mcu=atmega32u4 762 | robotControl.build.f_cpu=16000000L 763 | robotControl.build.vid=0x2341 764 | robotControl.build.pid=0x8038 765 | robotControl.build.usb_product="Robot Control" 766 | robotControl.build.board=AVR_ROBOT_CONTROL 767 | robotControl.build.core=arduino 768 | robotControl.build.variant=robot_control 769 | robotControl.build.extra_flags={build.usb_flags} 770 | 771 | ############################################################## 772 | 773 | robotMotor.name=Arduino Robot Motor 774 | robotMotor.vid.0=0x2341 775 | robotMotor.pid.0=0x0039 776 | robotMotor.vid.1=0x2341 777 | robotMotor.pid.1=0x8039 778 | robotMotor.vid.2=0x2A03 779 | robotMotor.pid.2=0x0039 780 | robotMotor.vid.3=0x2A03 781 | robotMotor.pid.3=0x8039 782 | 783 | robotMotor.vid.0x2A03.warning=Uncertified 784 | 785 | robotMotor.upload.tool=avrdude 786 | robotMotor.upload.protocol=avr109 787 | robotMotor.upload.maximum_size=28672 788 | robotMotor.upload.maximum_data_size=2560 789 | robotMotor.upload.speed=57600 790 | robotMotor.upload.disable_flushing=true 791 | robotMotor.upload.use_1200bps_touch=true 792 | robotMotor.upload.wait_for_upload_port=true 793 | 794 | robotMotor.bootloader.tool=avrdude 795 | robotMotor.bootloader.low_fuses=0xff 796 | robotMotor.bootloader.high_fuses=0xd8 797 | robotMotor.bootloader.extended_fuses=0xcb 798 | robotMotor.bootloader.file=caterina-Arduino_Robot/Caterina-Robot-Motor.hex 799 | robotMotor.bootloader.unlock_bits=0x3F 800 | robotMotor.bootloader.lock_bits=0x2F 801 | 802 | robotMotor.build.mcu=atmega32u4 803 | robotMotor.build.f_cpu=16000000L 804 | robotMotor.build.vid=0x2341 805 | robotMotor.build.pid=0x8039 806 | robotMotor.build.usb_product="Robot Motor" 807 | robotMotor.build.board=AVR_ROBOT_MOTOR 808 | robotMotor.build.core=arduino 809 | robotMotor.build.variant=robot_motor 810 | robotMotor.build.extra_flags={build.usb_flags} 811 | 812 | -------------------------------------------------------------------------------- /tools_linux_64/avrdude/include/libusb-1.0/libusb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Public libusb header file 3 | * Copyright © 2001 Johannes Erdfelt 4 | * Copyright © 2007-2008 Daniel Drake 5 | * Copyright © 2012 Pete Batard 6 | * Copyright © 2012 Nathan Hjelm 7 | * For more information, please visit: http://libusb.info 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef LIBUSB_H 25 | #define LIBUSB_H 26 | 27 | #ifdef _MSC_VER 28 | /* on MS environments, the inline keyword is available in C++ only */ 29 | #if !defined(__cplusplus) 30 | #define inline __inline 31 | #endif 32 | /* ssize_t is also not available (copy/paste from MinGW) */ 33 | #ifndef _SSIZE_T_DEFINED 34 | #define _SSIZE_T_DEFINED 35 | #undef ssize_t 36 | #ifdef _WIN64 37 | typedef __int64 ssize_t; 38 | #else 39 | typedef int ssize_t; 40 | #endif /* _WIN64 */ 41 | #endif /* _SSIZE_T_DEFINED */ 42 | #endif /* _MSC_VER */ 43 | 44 | /* stdint.h is not available on older MSVC */ 45 | #if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) 46 | typedef unsigned __int8 uint8_t; 47 | typedef unsigned __int16 uint16_t; 48 | typedef unsigned __int32 uint32_t; 49 | #else 50 | #include 51 | #endif 52 | 53 | #if !defined(_WIN32_WCE) 54 | #include 55 | #endif 56 | 57 | #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) 58 | #include 59 | #endif 60 | 61 | #include 62 | #include 63 | 64 | /* 'interface' might be defined as a macro on Windows, so we need to 65 | * undefine it so as not to break the current libusb API, because 66 | * libusb_config_descriptor has an 'interface' member 67 | * As this can be problematic if you include windows.h after libusb.h 68 | * in your sources, we force windows.h to be included first. */ 69 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 70 | #include 71 | #if defined(interface) 72 | #undef interface 73 | #endif 74 | #if !defined(__CYGWIN__) 75 | #include 76 | #endif 77 | #endif 78 | 79 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 80 | #define LIBUSB_DEPRECATED_FOR(f) \ 81 | __attribute__((deprecated("Use " #f " instead"))) 82 | #else 83 | #define LIBUSB_DEPRECATED_FOR(f) 84 | #endif /* __GNUC__ */ 85 | 86 | /** \def LIBUSB_CALL 87 | * \ingroup misc 88 | * libusb's Windows calling convention. 89 | * 90 | * Under Windows, the selection of available compilers and configurations 91 | * means that, unlike other platforms, there is not one true calling 92 | * convention (calling convention: the manner in which parameters are 93 | * passed to funcions in the generated assembly code). 94 | * 95 | * Matching the Windows API itself, libusb uses the WINAPI convention (which 96 | * translates to the stdcall convention) and guarantees that the 97 | * library is compiled in this way. The public header file also includes 98 | * appropriate annotations so that your own software will use the right 99 | * convention, even if another convention is being used by default within 100 | * your codebase. 101 | * 102 | * The one consideration that you must apply in your software is to mark 103 | * all functions which you use as libusb callbacks with this LIBUSB_CALL 104 | * annotation, so that they too get compiled for the correct calling 105 | * convention. 106 | * 107 | * On non-Windows operating systems, this macro is defined as nothing. This 108 | * means that you can apply it to your code without worrying about 109 | * cross-platform compatibility. 110 | */ 111 | /* LIBUSB_CALL must be defined on both definition and declaration of libusb 112 | * functions. You'd think that declaration would be enough, but cygwin will 113 | * complain about conflicting types unless both are marked this way. 114 | * The placement of this macro is important too; it must appear after the 115 | * return type, before the function name. See internal documentation for 116 | * API_EXPORTED. 117 | */ 118 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 119 | #define LIBUSB_CALL WINAPI 120 | #else 121 | #define LIBUSB_CALL 122 | #endif 123 | 124 | /** \def LIBUSB_API_VERSION 125 | * \ingroup misc 126 | * libusb's API version. 127 | * 128 | * Since version 1.0.13, to help with feature detection, libusb defines 129 | * a LIBUSB_API_VERSION macro that gets increased every time there is a 130 | * significant change to the API, such as the introduction of a new call, 131 | * the definition of a new macro/enum member, or any other element that 132 | * libusb applications may want to detect at compilation time. 133 | * 134 | * The macro is typically used in an application as follows: 135 | * \code 136 | * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234) 137 | * // Use one of the newer features from the libusb API 138 | * #endif 139 | * \endcode 140 | * 141 | * Another feature of LIBUSB_API_VERSION is that it can be used to detect 142 | * whether you are compiling against the libusb or the libusb library. 143 | * 144 | * Internally, LIBUSB_API_VERSION is defined as follows: 145 | * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental) 146 | */ 147 | #define LIBUSB_API_VERSION 0x01000102 148 | 149 | /* The following is kept for compatibility, but will be deprecated in the future */ 150 | #define LIBUSBX_API_VERSION LIBUSB_API_VERSION 151 | 152 | #ifdef __cplusplus 153 | extern "C" { 154 | #endif 155 | 156 | /** 157 | * \ingroup misc 158 | * Convert a 16-bit value from host-endian to little-endian format. On 159 | * little endian systems, this function does nothing. On big endian systems, 160 | * the bytes are swapped. 161 | * \param x the host-endian value to convert 162 | * \returns the value in little-endian byte order 163 | */ 164 | static inline uint16_t libusb_cpu_to_le16(const uint16_t x) 165 | { 166 | union { 167 | uint8_t b8[2]; 168 | uint16_t b16; 169 | } _tmp; 170 | _tmp.b8[1] = (uint8_t) (x >> 8); 171 | _tmp.b8[0] = (uint8_t) (x & 0xff); 172 | return _tmp.b16; 173 | } 174 | 175 | /** \def libusb_le16_to_cpu 176 | * \ingroup misc 177 | * Convert a 16-bit value from little-endian to host-endian format. On 178 | * little endian systems, this function does nothing. On big endian systems, 179 | * the bytes are swapped. 180 | * \param x the little-endian value to convert 181 | * \returns the value in host-endian byte order 182 | */ 183 | #define libusb_le16_to_cpu libusb_cpu_to_le16 184 | 185 | /* standard USB stuff */ 186 | 187 | /** \ingroup desc 188 | * Device and/or Interface Class codes */ 189 | enum libusb_class_code { 190 | /** In the context of a \ref libusb_device_descriptor "device descriptor", 191 | * this bDeviceClass value indicates that each interface specifies its 192 | * own class information and all interfaces operate independently. 193 | */ 194 | LIBUSB_CLASS_PER_INTERFACE = 0, 195 | 196 | /** Audio class */ 197 | LIBUSB_CLASS_AUDIO = 1, 198 | 199 | /** Communications class */ 200 | LIBUSB_CLASS_COMM = 2, 201 | 202 | /** Human Interface Device class */ 203 | LIBUSB_CLASS_HID = 3, 204 | 205 | /** Physical */ 206 | LIBUSB_CLASS_PHYSICAL = 5, 207 | 208 | /** Printer class */ 209 | LIBUSB_CLASS_PRINTER = 7, 210 | 211 | /** Image class */ 212 | LIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */ 213 | LIBUSB_CLASS_IMAGE = 6, 214 | 215 | /** Mass storage class */ 216 | LIBUSB_CLASS_MASS_STORAGE = 8, 217 | 218 | /** Hub class */ 219 | LIBUSB_CLASS_HUB = 9, 220 | 221 | /** Data class */ 222 | LIBUSB_CLASS_DATA = 10, 223 | 224 | /** Smart Card */ 225 | LIBUSB_CLASS_SMART_CARD = 0x0b, 226 | 227 | /** Content Security */ 228 | LIBUSB_CLASS_CONTENT_SECURITY = 0x0d, 229 | 230 | /** Video */ 231 | LIBUSB_CLASS_VIDEO = 0x0e, 232 | 233 | /** Personal Healthcare */ 234 | LIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f, 235 | 236 | /** Diagnostic Device */ 237 | LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc, 238 | 239 | /** Wireless class */ 240 | LIBUSB_CLASS_WIRELESS = 0xe0, 241 | 242 | /** Application class */ 243 | LIBUSB_CLASS_APPLICATION = 0xfe, 244 | 245 | /** Class is vendor-specific */ 246 | LIBUSB_CLASS_VENDOR_SPEC = 0xff 247 | }; 248 | 249 | /** \ingroup desc 250 | * Descriptor types as defined by the USB specification. */ 251 | enum libusb_descriptor_type { 252 | /** Device descriptor. See libusb_device_descriptor. */ 253 | LIBUSB_DT_DEVICE = 0x01, 254 | 255 | /** Configuration descriptor. See libusb_config_descriptor. */ 256 | LIBUSB_DT_CONFIG = 0x02, 257 | 258 | /** String descriptor */ 259 | LIBUSB_DT_STRING = 0x03, 260 | 261 | /** Interface descriptor. See libusb_interface_descriptor. */ 262 | LIBUSB_DT_INTERFACE = 0x04, 263 | 264 | /** Endpoint descriptor. See libusb_endpoint_descriptor. */ 265 | LIBUSB_DT_ENDPOINT = 0x05, 266 | 267 | /** BOS descriptor */ 268 | LIBUSB_DT_BOS = 0x0f, 269 | 270 | /** Device Capability descriptor */ 271 | LIBUSB_DT_DEVICE_CAPABILITY = 0x10, 272 | 273 | /** HID descriptor */ 274 | LIBUSB_DT_HID = 0x21, 275 | 276 | /** HID report descriptor */ 277 | LIBUSB_DT_REPORT = 0x22, 278 | 279 | /** Physical descriptor */ 280 | LIBUSB_DT_PHYSICAL = 0x23, 281 | 282 | /** Hub descriptor */ 283 | LIBUSB_DT_HUB = 0x29, 284 | 285 | /** SuperSpeed Hub descriptor */ 286 | LIBUSB_DT_SUPERSPEED_HUB = 0x2a, 287 | 288 | /** SuperSpeed Endpoint Companion descriptor */ 289 | LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30 290 | }; 291 | 292 | /* Descriptor sizes per descriptor type */ 293 | #define LIBUSB_DT_DEVICE_SIZE 18 294 | #define LIBUSB_DT_CONFIG_SIZE 9 295 | #define LIBUSB_DT_INTERFACE_SIZE 9 296 | #define LIBUSB_DT_ENDPOINT_SIZE 7 297 | #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ 298 | #define LIBUSB_DT_HUB_NONVAR_SIZE 7 299 | #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 300 | #define LIBUSB_DT_BOS_SIZE 5 301 | #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3 302 | 303 | /* BOS descriptor sizes */ 304 | #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7 305 | #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10 306 | #define LIBUSB_BT_CONTAINER_ID_SIZE 20 307 | 308 | /* We unwrap the BOS => define its max size */ 309 | #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\ 310 | (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\ 311 | (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\ 312 | (LIBUSB_BT_CONTAINER_ID_SIZE)) 313 | 314 | #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ 315 | #define LIBUSB_ENDPOINT_DIR_MASK 0x80 316 | 317 | /** \ingroup desc 318 | * Endpoint direction. Values for bit 7 of the 319 | * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme. 320 | */ 321 | enum libusb_endpoint_direction { 322 | /** In: device-to-host */ 323 | LIBUSB_ENDPOINT_IN = 0x80, 324 | 325 | /** Out: host-to-device */ 326 | LIBUSB_ENDPOINT_OUT = 0x00 327 | }; 328 | 329 | #define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */ 330 | 331 | /** \ingroup desc 332 | * Endpoint transfer type. Values for bits 0:1 of the 333 | * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field. 334 | */ 335 | enum libusb_transfer_type { 336 | /** Control endpoint */ 337 | LIBUSB_TRANSFER_TYPE_CONTROL = 0, 338 | 339 | /** Isochronous endpoint */ 340 | LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1, 341 | 342 | /** Bulk endpoint */ 343 | LIBUSB_TRANSFER_TYPE_BULK = 2, 344 | 345 | /** Interrupt endpoint */ 346 | LIBUSB_TRANSFER_TYPE_INTERRUPT = 3 347 | }; 348 | 349 | /** \ingroup misc 350 | * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */ 351 | enum libusb_standard_request { 352 | /** Request status of the specific recipient */ 353 | LIBUSB_REQUEST_GET_STATUS = 0x00, 354 | 355 | /** Clear or disable a specific feature */ 356 | LIBUSB_REQUEST_CLEAR_FEATURE = 0x01, 357 | 358 | /* 0x02 is reserved */ 359 | 360 | /** Set or enable a specific feature */ 361 | LIBUSB_REQUEST_SET_FEATURE = 0x03, 362 | 363 | /* 0x04 is reserved */ 364 | 365 | /** Set device address for all future accesses */ 366 | LIBUSB_REQUEST_SET_ADDRESS = 0x05, 367 | 368 | /** Get the specified descriptor */ 369 | LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06, 370 | 371 | /** Used to update existing descriptors or add new descriptors */ 372 | LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07, 373 | 374 | /** Get the current device configuration value */ 375 | LIBUSB_REQUEST_GET_CONFIGURATION = 0x08, 376 | 377 | /** Set device configuration */ 378 | LIBUSB_REQUEST_SET_CONFIGURATION = 0x09, 379 | 380 | /** Return the selected alternate setting for the specified interface */ 381 | LIBUSB_REQUEST_GET_INTERFACE = 0x0A, 382 | 383 | /** Select an alternate interface for the specified interface */ 384 | LIBUSB_REQUEST_SET_INTERFACE = 0x0B, 385 | 386 | /** Set then report an endpoint's synchronization frame */ 387 | LIBUSB_REQUEST_SYNCH_FRAME = 0x0C, 388 | 389 | /** Sets both the U1 and U2 Exit Latency */ 390 | LIBUSB_REQUEST_SET_SEL = 0x30, 391 | 392 | /** Delay from the time a host transmits a packet to the time it is 393 | * received by the device. */ 394 | LIBUSB_SET_ISOCH_DELAY = 0x31, 395 | }; 396 | 397 | /** \ingroup misc 398 | * Request type bits of the 399 | * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control 400 | * transfers. */ 401 | enum libusb_request_type { 402 | /** Standard */ 403 | LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5), 404 | 405 | /** Class */ 406 | LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5), 407 | 408 | /** Vendor */ 409 | LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5), 410 | 411 | /** Reserved */ 412 | LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5) 413 | }; 414 | 415 | /** \ingroup misc 416 | * Recipient bits of the 417 | * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control 418 | * transfers. Values 4 through 31 are reserved. */ 419 | enum libusb_request_recipient { 420 | /** Device */ 421 | LIBUSB_RECIPIENT_DEVICE = 0x00, 422 | 423 | /** Interface */ 424 | LIBUSB_RECIPIENT_INTERFACE = 0x01, 425 | 426 | /** Endpoint */ 427 | LIBUSB_RECIPIENT_ENDPOINT = 0x02, 428 | 429 | /** Other */ 430 | LIBUSB_RECIPIENT_OTHER = 0x03, 431 | }; 432 | 433 | #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C 434 | 435 | /** \ingroup desc 436 | * Synchronization type for isochronous endpoints. Values for bits 2:3 of the 437 | * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in 438 | * libusb_endpoint_descriptor. 439 | */ 440 | enum libusb_iso_sync_type { 441 | /** No synchronization */ 442 | LIBUSB_ISO_SYNC_TYPE_NONE = 0, 443 | 444 | /** Asynchronous */ 445 | LIBUSB_ISO_SYNC_TYPE_ASYNC = 1, 446 | 447 | /** Adaptive */ 448 | LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2, 449 | 450 | /** Synchronous */ 451 | LIBUSB_ISO_SYNC_TYPE_SYNC = 3 452 | }; 453 | 454 | #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30 455 | 456 | /** \ingroup desc 457 | * Usage type for isochronous endpoints. Values for bits 4:5 of the 458 | * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in 459 | * libusb_endpoint_descriptor. 460 | */ 461 | enum libusb_iso_usage_type { 462 | /** Data endpoint */ 463 | LIBUSB_ISO_USAGE_TYPE_DATA = 0, 464 | 465 | /** Feedback endpoint */ 466 | LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1, 467 | 468 | /** Implicit feedback Data endpoint */ 469 | LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2, 470 | }; 471 | 472 | /** \ingroup desc 473 | * A structure representing the standard USB device descriptor. This 474 | * descriptor is documented in section 9.6.1 of the USB 3.0 specification. 475 | * All multiple-byte fields are represented in host-endian format. 476 | */ 477 | struct libusb_device_descriptor { 478 | /** Size of this descriptor (in bytes) */ 479 | uint8_t bLength; 480 | 481 | /** Descriptor type. Will have value 482 | * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this 483 | * context. */ 484 | uint8_t bDescriptorType; 485 | 486 | /** USB specification release number in binary-coded decimal. A value of 487 | * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */ 488 | uint16_t bcdUSB; 489 | 490 | /** USB-IF class code for the device. See \ref libusb_class_code. */ 491 | uint8_t bDeviceClass; 492 | 493 | /** USB-IF subclass code for the device, qualified by the bDeviceClass 494 | * value */ 495 | uint8_t bDeviceSubClass; 496 | 497 | /** USB-IF protocol code for the device, qualified by the bDeviceClass and 498 | * bDeviceSubClass values */ 499 | uint8_t bDeviceProtocol; 500 | 501 | /** Maximum packet size for endpoint 0 */ 502 | uint8_t bMaxPacketSize0; 503 | 504 | /** USB-IF vendor ID */ 505 | uint16_t idVendor; 506 | 507 | /** USB-IF product ID */ 508 | uint16_t idProduct; 509 | 510 | /** Device release number in binary-coded decimal */ 511 | uint16_t bcdDevice; 512 | 513 | /** Index of string descriptor describing manufacturer */ 514 | uint8_t iManufacturer; 515 | 516 | /** Index of string descriptor describing product */ 517 | uint8_t iProduct; 518 | 519 | /** Index of string descriptor containing device serial number */ 520 | uint8_t iSerialNumber; 521 | 522 | /** Number of possible configurations */ 523 | uint8_t bNumConfigurations; 524 | }; 525 | 526 | /** \ingroup desc 527 | * A structure representing the standard USB endpoint descriptor. This 528 | * descriptor is documented in section 9.6.6 of the USB 3.0 specification. 529 | * All multiple-byte fields are represented in host-endian format. 530 | */ 531 | struct libusb_endpoint_descriptor { 532 | /** Size of this descriptor (in bytes) */ 533 | uint8_t bLength; 534 | 535 | /** Descriptor type. Will have value 536 | * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in 537 | * this context. */ 538 | uint8_t bDescriptorType; 539 | 540 | /** The address of the endpoint described by this descriptor. Bits 0:3 are 541 | * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction, 542 | * see \ref libusb_endpoint_direction. 543 | */ 544 | uint8_t bEndpointAddress; 545 | 546 | /** Attributes which apply to the endpoint when it is configured using 547 | * the bConfigurationValue. Bits 0:1 determine the transfer type and 548 | * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for 549 | * isochronous endpoints and correspond to \ref libusb_iso_sync_type. 550 | * Bits 4:5 are also only used for isochronous endpoints and correspond to 551 | * \ref libusb_iso_usage_type. Bits 6:7 are reserved. 552 | */ 553 | uint8_t bmAttributes; 554 | 555 | /** Maximum packet size this endpoint is capable of sending/receiving. */ 556 | uint16_t wMaxPacketSize; 557 | 558 | /** Interval for polling endpoint for data transfers. */ 559 | uint8_t bInterval; 560 | 561 | /** For audio devices only: the rate at which synchronization feedback 562 | * is provided. */ 563 | uint8_t bRefresh; 564 | 565 | /** For audio devices only: the address if the synch endpoint */ 566 | uint8_t bSynchAddress; 567 | 568 | /** Extra descriptors. If libusb encounters unknown endpoint descriptors, 569 | * it will store them here, should you wish to parse them. */ 570 | const unsigned char *extra; 571 | 572 | /** Length of the extra descriptors, in bytes. */ 573 | int extra_length; 574 | }; 575 | 576 | /** \ingroup desc 577 | * A structure representing the standard USB interface descriptor. This 578 | * descriptor is documented in section 9.6.5 of the USB 3.0 specification. 579 | * All multiple-byte fields are represented in host-endian format. 580 | */ 581 | struct libusb_interface_descriptor { 582 | /** Size of this descriptor (in bytes) */ 583 | uint8_t bLength; 584 | 585 | /** Descriptor type. Will have value 586 | * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE 587 | * in this context. */ 588 | uint8_t bDescriptorType; 589 | 590 | /** Number of this interface */ 591 | uint8_t bInterfaceNumber; 592 | 593 | /** Value used to select this alternate setting for this interface */ 594 | uint8_t bAlternateSetting; 595 | 596 | /** Number of endpoints used by this interface (excluding the control 597 | * endpoint). */ 598 | uint8_t bNumEndpoints; 599 | 600 | /** USB-IF class code for this interface. See \ref libusb_class_code. */ 601 | uint8_t bInterfaceClass; 602 | 603 | /** USB-IF subclass code for this interface, qualified by the 604 | * bInterfaceClass value */ 605 | uint8_t bInterfaceSubClass; 606 | 607 | /** USB-IF protocol code for this interface, qualified by the 608 | * bInterfaceClass and bInterfaceSubClass values */ 609 | uint8_t bInterfaceProtocol; 610 | 611 | /** Index of string descriptor describing this interface */ 612 | uint8_t iInterface; 613 | 614 | /** Array of endpoint descriptors. This length of this array is determined 615 | * by the bNumEndpoints field. */ 616 | const struct libusb_endpoint_descriptor *endpoint; 617 | 618 | /** Extra descriptors. If libusb encounters unknown interface descriptors, 619 | * it will store them here, should you wish to parse them. */ 620 | const unsigned char *extra; 621 | 622 | /** Length of the extra descriptors, in bytes. */ 623 | int extra_length; 624 | }; 625 | 626 | /** \ingroup desc 627 | * A collection of alternate settings for a particular USB interface. 628 | */ 629 | struct libusb_interface { 630 | /** Array of interface descriptors. The length of this array is determined 631 | * by the num_altsetting field. */ 632 | const struct libusb_interface_descriptor *altsetting; 633 | 634 | /** The number of alternate settings that belong to this interface */ 635 | int num_altsetting; 636 | }; 637 | 638 | /** \ingroup desc 639 | * A structure representing the standard USB configuration descriptor. This 640 | * descriptor is documented in section 9.6.3 of the USB 3.0 specification. 641 | * All multiple-byte fields are represented in host-endian format. 642 | */ 643 | struct libusb_config_descriptor { 644 | /** Size of this descriptor (in bytes) */ 645 | uint8_t bLength; 646 | 647 | /** Descriptor type. Will have value 648 | * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG 649 | * in this context. */ 650 | uint8_t bDescriptorType; 651 | 652 | /** Total length of data returned for this configuration */ 653 | uint16_t wTotalLength; 654 | 655 | /** Number of interfaces supported by this configuration */ 656 | uint8_t bNumInterfaces; 657 | 658 | /** Identifier value for this configuration */ 659 | uint8_t bConfigurationValue; 660 | 661 | /** Index of string descriptor describing this configuration */ 662 | uint8_t iConfiguration; 663 | 664 | /** Configuration characteristics */ 665 | uint8_t bmAttributes; 666 | 667 | /** Maximum power consumption of the USB device from this bus in this 668 | * configuration when the device is fully opreation. Expressed in units 669 | * of 2 mA. */ 670 | uint8_t MaxPower; 671 | 672 | /** Array of interfaces supported by this configuration. The length of 673 | * this array is determined by the bNumInterfaces field. */ 674 | const struct libusb_interface *interface; 675 | 676 | /** Extra descriptors. If libusb encounters unknown configuration 677 | * descriptors, it will store them here, should you wish to parse them. */ 678 | const unsigned char *extra; 679 | 680 | /** Length of the extra descriptors, in bytes. */ 681 | int extra_length; 682 | }; 683 | 684 | /** \ingroup desc 685 | * A structure representing the superspeed endpoint companion 686 | * descriptor. This descriptor is documented in section 9.6.7 of 687 | * the USB 3.0 specification. All multiple-byte fields are represented in 688 | * host-endian format. 689 | */ 690 | struct libusb_ss_endpoint_companion_descriptor { 691 | 692 | /** Size of this descriptor (in bytes) */ 693 | uint8_t bLength; 694 | 695 | /** Descriptor type. Will have value 696 | * \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in 697 | * this context. */ 698 | uint8_t bDescriptorType; 699 | 700 | 701 | /** The maximum number of packets the endpoint can send or 702 | * recieve as part of a burst. */ 703 | uint8_t bMaxBurst; 704 | 705 | /** In bulk EP: bits 4:0 represents the maximum number of 706 | * streams the EP supports. In isochronous EP: bits 1:0 707 | * represents the Mult - a zero based value that determines 708 | * the maximum number of packets within a service interval */ 709 | uint8_t bmAttributes; 710 | 711 | /** The total number of bytes this EP will transfer every 712 | * service interval. valid only for periodic EPs. */ 713 | uint16_t wBytesPerInterval; 714 | }; 715 | 716 | /** \ingroup desc 717 | * A generic representation of a BOS Device Capability descriptor. It is 718 | * advised to check bDevCapabilityType and call the matching 719 | * libusb_get_*_descriptor function to get a structure fully matching the type. 720 | */ 721 | struct libusb_bos_dev_capability_descriptor { 722 | /** Size of this descriptor (in bytes) */ 723 | uint8_t bLength; 724 | /** Descriptor type. Will have value 725 | * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 726 | * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 727 | uint8_t bDescriptorType; 728 | /** Device Capability type */ 729 | uint8_t bDevCapabilityType; 730 | /** Device Capability data (bLength - 3 bytes) */ 731 | uint8_t dev_capability_data 732 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 733 | [] /* valid C99 code */ 734 | #else 735 | [0] /* non-standard, but usually working code */ 736 | #endif 737 | ; 738 | }; 739 | 740 | /** \ingroup desc 741 | * A structure representing the Binary Device Object Store (BOS) descriptor. 742 | * This descriptor is documented in section 9.6.2 of the USB 3.0 specification. 743 | * All multiple-byte fields are represented in host-endian format. 744 | */ 745 | struct libusb_bos_descriptor { 746 | /** Size of this descriptor (in bytes) */ 747 | uint8_t bLength; 748 | 749 | /** Descriptor type. Will have value 750 | * \ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS 751 | * in this context. */ 752 | uint8_t bDescriptorType; 753 | 754 | /** Length of this descriptor and all of its sub descriptors */ 755 | uint16_t wTotalLength; 756 | 757 | /** The number of separate device capability descriptors in 758 | * the BOS */ 759 | uint8_t bNumDeviceCaps; 760 | 761 | /** bNumDeviceCap Device Capability Descriptors */ 762 | struct libusb_bos_dev_capability_descriptor *dev_capability 763 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 764 | [] /* valid C99 code */ 765 | #else 766 | [0] /* non-standard, but usually working code */ 767 | #endif 768 | ; 769 | }; 770 | 771 | /** \ingroup desc 772 | * A structure representing the USB 2.0 Extension descriptor 773 | * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification. 774 | * All multiple-byte fields are represented in host-endian format. 775 | */ 776 | struct libusb_usb_2_0_extension_descriptor { 777 | /** Size of this descriptor (in bytes) */ 778 | uint8_t bLength; 779 | 780 | /** Descriptor type. Will have value 781 | * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 782 | * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 783 | uint8_t bDescriptorType; 784 | 785 | /** Capability type. Will have value 786 | * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION 787 | * LIBUSB_BT_USB_2_0_EXTENSION in this context. */ 788 | uint8_t bDevCapabilityType; 789 | 790 | /** Bitmap encoding of supported device level features. 791 | * A value of one in a bit location indicates a feature is 792 | * supported; a value of zero indicates it is not supported. 793 | * See \ref libusb_usb_2_0_extension_attributes. */ 794 | uint32_t bmAttributes; 795 | }; 796 | 797 | /** \ingroup desc 798 | * A structure representing the SuperSpeed USB Device Capability descriptor 799 | * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification. 800 | * All multiple-byte fields are represented in host-endian format. 801 | */ 802 | struct libusb_ss_usb_device_capability_descriptor { 803 | /** Size of this descriptor (in bytes) */ 804 | uint8_t bLength; 805 | 806 | /** Descriptor type. Will have value 807 | * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 808 | * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 809 | uint8_t bDescriptorType; 810 | 811 | /** Capability type. Will have value 812 | * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 813 | * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */ 814 | uint8_t bDevCapabilityType; 815 | 816 | /** Bitmap encoding of supported device level features. 817 | * A value of one in a bit location indicates a feature is 818 | * supported; a value of zero indicates it is not supported. 819 | * See \ref libusb_ss_usb_device_capability_attributes. */ 820 | uint8_t bmAttributes; 821 | 822 | /** Bitmap encoding of the speed supported by this device when 823 | * operating in SuperSpeed mode. See \ref libusb_supported_speed. */ 824 | uint16_t wSpeedSupported; 825 | 826 | /** The lowest speed at which all the functionality supported 827 | * by the device is available to the user. For example if the 828 | * device supports all its functionality when connected at 829 | * full speed and above then it sets this value to 1. */ 830 | uint8_t bFunctionalitySupport; 831 | 832 | /** U1 Device Exit Latency. */ 833 | uint8_t bU1DevExitLat; 834 | 835 | /** U2 Device Exit Latency. */ 836 | uint16_t bU2DevExitLat; 837 | }; 838 | 839 | /** \ingroup desc 840 | * A structure representing the Container ID descriptor. 841 | * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification. 842 | * All multiple-byte fields, except UUIDs, are represented in host-endian format. 843 | */ 844 | struct libusb_container_id_descriptor { 845 | /** Size of this descriptor (in bytes) */ 846 | uint8_t bLength; 847 | 848 | /** Descriptor type. Will have value 849 | * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 850 | * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 851 | uint8_t bDescriptorType; 852 | 853 | /** Capability type. Will have value 854 | * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID 855 | * LIBUSB_BT_CONTAINER_ID in this context. */ 856 | uint8_t bDevCapabilityType; 857 | 858 | /** Reserved field */ 859 | uint8_t bReserved; 860 | 861 | /** 128 bit UUID */ 862 | uint8_t ContainerID[16]; 863 | }; 864 | 865 | /** \ingroup asyncio 866 | * Setup packet for control transfers. */ 867 | struct libusb_control_setup { 868 | /** Request type. Bits 0:4 determine recipient, see 869 | * \ref libusb_request_recipient. Bits 5:6 determine type, see 870 | * \ref libusb_request_type. Bit 7 determines data transfer direction, see 871 | * \ref libusb_endpoint_direction. 872 | */ 873 | uint8_t bmRequestType; 874 | 875 | /** Request. If the type bits of bmRequestType are equal to 876 | * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD 877 | * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to 878 | * \ref libusb_standard_request. For other cases, use of this field is 879 | * application-specific. */ 880 | uint8_t bRequest; 881 | 882 | /** Value. Varies according to request */ 883 | uint16_t wValue; 884 | 885 | /** Index. Varies according to request, typically used to pass an index 886 | * or offset */ 887 | uint16_t wIndex; 888 | 889 | /** Number of bytes to transfer */ 890 | uint16_t wLength; 891 | }; 892 | 893 | #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup)) 894 | 895 | /* libusb */ 896 | 897 | struct libusb_context; 898 | struct libusb_device; 899 | struct libusb_device_handle; 900 | struct libusb_hotplug_callback; 901 | 902 | /** \ingroup lib 903 | * Structure providing the version of the libusb runtime 904 | */ 905 | struct libusb_version { 906 | /** Library major version. */ 907 | const uint16_t major; 908 | 909 | /** Library minor version. */ 910 | const uint16_t minor; 911 | 912 | /** Library micro version. */ 913 | const uint16_t micro; 914 | 915 | /** Library nano version. */ 916 | const uint16_t nano; 917 | 918 | /** Library release candidate suffix string, e.g. "-rc4". */ 919 | const char *rc; 920 | 921 | /** For ABI compatibility only. */ 922 | const char* describe; 923 | }; 924 | 925 | /** \ingroup lib 926 | * Structure representing a libusb session. The concept of individual libusb 927 | * sessions allows for your program to use two libraries (or dynamically 928 | * load two modules) which both independently use libusb. This will prevent 929 | * interference between the individual libusb users - for example 930 | * libusb_set_debug() will not affect the other user of the library, and 931 | * libusb_exit() will not destroy resources that the other user is still 932 | * using. 933 | * 934 | * Sessions are created by libusb_init() and destroyed through libusb_exit(). 935 | * If your application is guaranteed to only ever include a single libusb 936 | * user (i.e. you), you do not have to worry about contexts: pass NULL in 937 | * every function call where a context is required. The default context 938 | * will be used. 939 | * 940 | * For more information, see \ref contexts. 941 | */ 942 | typedef struct libusb_context libusb_context; 943 | 944 | /** \ingroup dev 945 | * Structure representing a USB device detected on the system. This is an 946 | * opaque type for which you are only ever provided with a pointer, usually 947 | * originating from libusb_get_device_list(). 948 | * 949 | * Certain operations can be performed on a device, but in order to do any 950 | * I/O you will have to first obtain a device handle using libusb_open(). 951 | * 952 | * Devices are reference counted with libusb_ref_device() and 953 | * libusb_unref_device(), and are freed when the reference count reaches 0. 954 | * New devices presented by libusb_get_device_list() have a reference count of 955 | * 1, and libusb_free_device_list() can optionally decrease the reference count 956 | * on all devices in the list. libusb_open() adds another reference which is 957 | * later destroyed by libusb_close(). 958 | */ 959 | typedef struct libusb_device libusb_device; 960 | 961 | 962 | /** \ingroup dev 963 | * Structure representing a handle on a USB device. This is an opaque type for 964 | * which you are only ever provided with a pointer, usually originating from 965 | * libusb_open(). 966 | * 967 | * A device handle is used to perform I/O and other operations. When finished 968 | * with a device handle, you should call libusb_close(). 969 | */ 970 | typedef struct libusb_device_handle libusb_device_handle; 971 | 972 | /** \ingroup dev 973 | * Speed codes. Indicates the speed at which the device is operating. 974 | */ 975 | enum libusb_speed { 976 | /** The OS doesn't report or know the device speed. */ 977 | LIBUSB_SPEED_UNKNOWN = 0, 978 | 979 | /** The device is operating at low speed (1.5MBit/s). */ 980 | LIBUSB_SPEED_LOW = 1, 981 | 982 | /** The device is operating at full speed (12MBit/s). */ 983 | LIBUSB_SPEED_FULL = 2, 984 | 985 | /** The device is operating at high speed (480MBit/s). */ 986 | LIBUSB_SPEED_HIGH = 3, 987 | 988 | /** The device is operating at super speed (5000MBit/s). */ 989 | LIBUSB_SPEED_SUPER = 4, 990 | }; 991 | 992 | /** \ingroup dev 993 | * Supported speeds (wSpeedSupported) bitfield. Indicates what 994 | * speeds the device supports. 995 | */ 996 | enum libusb_supported_speed { 997 | /** Low speed operation supported (1.5MBit/s). */ 998 | LIBUSB_LOW_SPEED_OPERATION = 1, 999 | 1000 | /** Full speed operation supported (12MBit/s). */ 1001 | LIBUSB_FULL_SPEED_OPERATION = 2, 1002 | 1003 | /** High speed operation supported (480MBit/s). */ 1004 | LIBUSB_HIGH_SPEED_OPERATION = 4, 1005 | 1006 | /** Superspeed operation supported (5000MBit/s). */ 1007 | LIBUSB_SUPER_SPEED_OPERATION = 8, 1008 | }; 1009 | 1010 | /** \ingroup dev 1011 | * Masks for the bits of the 1012 | * \ref libusb_usb_2_0_extension_descriptor::bmAttributes "bmAttributes" field 1013 | * of the USB 2.0 Extension descriptor. 1014 | */ 1015 | enum libusb_usb_2_0_extension_attributes { 1016 | /** Supports Link Power Management (LPM) */ 1017 | LIBUSB_BM_LPM_SUPPORT = 2, 1018 | }; 1019 | 1020 | /** \ingroup dev 1021 | * Masks for the bits of the 1022 | * \ref libusb_ss_usb_device_capability_descriptor::bmAttributes "bmAttributes" field 1023 | * field of the SuperSpeed USB Device Capability descriptor. 1024 | */ 1025 | enum libusb_ss_usb_device_capability_attributes { 1026 | /** Supports Latency Tolerance Messages (LTM) */ 1027 | LIBUSB_BM_LTM_SUPPORT = 2, 1028 | }; 1029 | 1030 | /** \ingroup dev 1031 | * USB capability types 1032 | */ 1033 | enum libusb_bos_type { 1034 | /** Wireless USB device capability */ 1035 | LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1, 1036 | 1037 | /** USB 2.0 extensions */ 1038 | LIBUSB_BT_USB_2_0_EXTENSION = 2, 1039 | 1040 | /** SuperSpeed USB device capability */ 1041 | LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3, 1042 | 1043 | /** Container ID type */ 1044 | LIBUSB_BT_CONTAINER_ID = 4, 1045 | }; 1046 | 1047 | /** \ingroup misc 1048 | * Error codes. Most libusb functions return 0 on success or one of these 1049 | * codes on failure. 1050 | * You can call libusb_error_name() to retrieve a string representation of an 1051 | * error code or libusb_strerror() to get an end-user suitable description of 1052 | * an error code. 1053 | */ 1054 | enum libusb_error { 1055 | /** Success (no error) */ 1056 | LIBUSB_SUCCESS = 0, 1057 | 1058 | /** Input/output error */ 1059 | LIBUSB_ERROR_IO = -1, 1060 | 1061 | /** Invalid parameter */ 1062 | LIBUSB_ERROR_INVALID_PARAM = -2, 1063 | 1064 | /** Access denied (insufficient permissions) */ 1065 | LIBUSB_ERROR_ACCESS = -3, 1066 | 1067 | /** No such device (it may have been disconnected) */ 1068 | LIBUSB_ERROR_NO_DEVICE = -4, 1069 | 1070 | /** Entity not found */ 1071 | LIBUSB_ERROR_NOT_FOUND = -5, 1072 | 1073 | /** Resource busy */ 1074 | LIBUSB_ERROR_BUSY = -6, 1075 | 1076 | /** Operation timed out */ 1077 | LIBUSB_ERROR_TIMEOUT = -7, 1078 | 1079 | /** Overflow */ 1080 | LIBUSB_ERROR_OVERFLOW = -8, 1081 | 1082 | /** Pipe error */ 1083 | LIBUSB_ERROR_PIPE = -9, 1084 | 1085 | /** System call interrupted (perhaps due to signal) */ 1086 | LIBUSB_ERROR_INTERRUPTED = -10, 1087 | 1088 | /** Insufficient memory */ 1089 | LIBUSB_ERROR_NO_MEM = -11, 1090 | 1091 | /** Operation not supported or unimplemented on this platform */ 1092 | LIBUSB_ERROR_NOT_SUPPORTED = -12, 1093 | 1094 | /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the 1095 | message strings in strerror.c when adding new error codes here. */ 1096 | 1097 | /** Other error */ 1098 | LIBUSB_ERROR_OTHER = -99, 1099 | }; 1100 | 1101 | /* Total number of error codes in enum libusb_error */ 1102 | #define LIBUSB_ERROR_COUNT 14 1103 | 1104 | /** \ingroup asyncio 1105 | * Transfer status codes */ 1106 | enum libusb_transfer_status { 1107 | /** Transfer completed without error. Note that this does not indicate 1108 | * that the entire amount of requested data was transferred. */ 1109 | LIBUSB_TRANSFER_COMPLETED, 1110 | 1111 | /** Transfer failed */ 1112 | LIBUSB_TRANSFER_ERROR, 1113 | 1114 | /** Transfer timed out */ 1115 | LIBUSB_TRANSFER_TIMED_OUT, 1116 | 1117 | /** Transfer was cancelled */ 1118 | LIBUSB_TRANSFER_CANCELLED, 1119 | 1120 | /** For bulk/interrupt endpoints: halt condition detected (endpoint 1121 | * stalled). For control endpoints: control request not supported. */ 1122 | LIBUSB_TRANSFER_STALL, 1123 | 1124 | /** Device was disconnected */ 1125 | LIBUSB_TRANSFER_NO_DEVICE, 1126 | 1127 | /** Device sent more data than requested */ 1128 | LIBUSB_TRANSFER_OVERFLOW, 1129 | 1130 | /* NB! Remember to update libusb_error_name() 1131 | when adding new status codes here. */ 1132 | }; 1133 | 1134 | /** \ingroup asyncio 1135 | * libusb_transfer.flags values */ 1136 | enum libusb_transfer_flags { 1137 | /** Report short frames as errors */ 1138 | LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0, 1139 | 1140 | /** Automatically free() transfer buffer during libusb_free_transfer() */ 1141 | LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, 1142 | 1143 | /** Automatically call libusb_free_transfer() after callback returns. 1144 | * If this flag is set, it is illegal to call libusb_free_transfer() 1145 | * from your transfer callback, as this will result in a double-free 1146 | * when this flag is acted upon. */ 1147 | LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2, 1148 | 1149 | /** Terminate transfers that are a multiple of the endpoint's 1150 | * wMaxPacketSize with an extra zero length packet. This is useful 1151 | * when a device protocol mandates that each logical request is 1152 | * terminated by an incomplete packet (i.e. the logical requests are 1153 | * not separated by other means). 1154 | * 1155 | * This flag only affects host-to-device transfers to bulk and interrupt 1156 | * endpoints. In other situations, it is ignored. 1157 | * 1158 | * This flag only affects transfers with a length that is a multiple of 1159 | * the endpoint's wMaxPacketSize. On transfers of other lengths, this 1160 | * flag has no effect. Therefore, if you are working with a device that 1161 | * needs a ZLP whenever the end of the logical request falls on a packet 1162 | * boundary, then it is sensible to set this flag on every 1163 | * transfer (you do not have to worry about only setting it on transfers 1164 | * that end on the boundary). 1165 | * 1166 | * This flag is currently only supported on Linux. 1167 | * On other systems, libusb_submit_transfer() will return 1168 | * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set. 1169 | * 1170 | * Available since libusb-1.0.9. 1171 | */ 1172 | LIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3, 1173 | }; 1174 | 1175 | /** \ingroup asyncio 1176 | * Isochronous packet descriptor. */ 1177 | struct libusb_iso_packet_descriptor { 1178 | /** Length of data to request in this packet */ 1179 | unsigned int length; 1180 | 1181 | /** Amount of data that was actually transferred */ 1182 | unsigned int actual_length; 1183 | 1184 | /** Status code for this packet */ 1185 | enum libusb_transfer_status status; 1186 | }; 1187 | 1188 | struct libusb_transfer; 1189 | 1190 | /** \ingroup asyncio 1191 | * Asynchronous transfer callback function type. When submitting asynchronous 1192 | * transfers, you pass a pointer to a callback function of this type via the 1193 | * \ref libusb_transfer::callback "callback" member of the libusb_transfer 1194 | * structure. libusb will call this function later, when the transfer has 1195 | * completed or failed. See \ref asyncio for more information. 1196 | * \param transfer The libusb_transfer struct the callback function is being 1197 | * notified about. 1198 | */ 1199 | typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer); 1200 | 1201 | /** \ingroup asyncio 1202 | * The generic USB transfer structure. The user populates this structure and 1203 | * then submits it in order to request a transfer. After the transfer has 1204 | * completed, the library populates the transfer with the results and passes 1205 | * it back to the user. 1206 | */ 1207 | struct libusb_transfer { 1208 | /** Handle of the device that this transfer will be submitted to */ 1209 | libusb_device_handle *dev_handle; 1210 | 1211 | /** A bitwise OR combination of \ref libusb_transfer_flags. */ 1212 | uint8_t flags; 1213 | 1214 | /** Address of the endpoint where this transfer will be sent. */ 1215 | unsigned char endpoint; 1216 | 1217 | /** Type of the endpoint from \ref libusb_transfer_type */ 1218 | unsigned char type; 1219 | 1220 | /** Timeout for this transfer in millseconds. A value of 0 indicates no 1221 | * timeout. */ 1222 | unsigned int timeout; 1223 | 1224 | /** The status of the transfer. Read-only, and only for use within 1225 | * transfer callback function. 1226 | * 1227 | * If this is an isochronous transfer, this field may read COMPLETED even 1228 | * if there were errors in the frames. Use the 1229 | * \ref libusb_iso_packet_descriptor::status "status" field in each packet 1230 | * to determine if errors occurred. */ 1231 | enum libusb_transfer_status status; 1232 | 1233 | /** Length of the data buffer */ 1234 | int length; 1235 | 1236 | /** Actual length of data that was transferred. Read-only, and only for 1237 | * use within transfer callback function. Not valid for isochronous 1238 | * endpoint transfers. */ 1239 | int actual_length; 1240 | 1241 | /** Callback function. This will be invoked when the transfer completes, 1242 | * fails, or is cancelled. */ 1243 | libusb_transfer_cb_fn callback; 1244 | 1245 | /** User context data to pass to the callback function. */ 1246 | void *user_data; 1247 | 1248 | /** Data buffer */ 1249 | unsigned char *buffer; 1250 | 1251 | /** Number of isochronous packets. Only used for I/O with isochronous 1252 | * endpoints. */ 1253 | int num_iso_packets; 1254 | 1255 | /** Isochronous packet descriptors, for isochronous transfers only. */ 1256 | struct libusb_iso_packet_descriptor iso_packet_desc 1257 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 1258 | [] /* valid C99 code */ 1259 | #else 1260 | [0] /* non-standard, but usually working code */ 1261 | #endif 1262 | ; 1263 | }; 1264 | 1265 | /** \ingroup misc 1266 | * Capabilities supported by an instance of libusb on the current running 1267 | * platform. Test if the loaded library supports a given capability by calling 1268 | * \ref libusb_has_capability(). 1269 | */ 1270 | enum libusb_capability { 1271 | /** The libusb_has_capability() API is available. */ 1272 | LIBUSB_CAP_HAS_CAPABILITY = 0x0000, 1273 | /** Hotplug support is available on this platform. */ 1274 | LIBUSB_CAP_HAS_HOTPLUG = 0x0001, 1275 | /** The library can access HID devices without requiring user intervention. 1276 | * Note that before being able to actually access an HID device, you may 1277 | * still have to call additional libusb functions such as 1278 | * \ref libusb_detach_kernel_driver(). */ 1279 | LIBUSB_CAP_HAS_HID_ACCESS = 0x0100, 1280 | /** The library supports detaching of the default USB driver, using 1281 | * \ref libusb_detach_kernel_driver(), if one is set by the OS kernel */ 1282 | LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101 1283 | }; 1284 | 1285 | /** \ingroup lib 1286 | * Log message levels. 1287 | * - LIBUSB_LOG_LEVEL_NONE (0) : no messages ever printed by the library (default) 1288 | * - LIBUSB_LOG_LEVEL_ERROR (1) : error messages are printed to stderr 1289 | * - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr 1290 | * - LIBUSB_LOG_LEVEL_INFO (3) : informational messages are printed to stdout, warning 1291 | * and error messages are printed to stderr 1292 | * - LIBUSB_LOG_LEVEL_DEBUG (4) : debug and informational messages are printed to stdout, 1293 | * warnings and errors to stderr 1294 | */ 1295 | enum libusb_log_level { 1296 | LIBUSB_LOG_LEVEL_NONE = 0, 1297 | LIBUSB_LOG_LEVEL_ERROR, 1298 | LIBUSB_LOG_LEVEL_WARNING, 1299 | LIBUSB_LOG_LEVEL_INFO, 1300 | LIBUSB_LOG_LEVEL_DEBUG, 1301 | }; 1302 | 1303 | int LIBUSB_CALL libusb_init(libusb_context **ctx); 1304 | void LIBUSB_CALL libusb_exit(libusb_context *ctx); 1305 | void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); 1306 | const struct libusb_version * LIBUSB_CALL libusb_get_version(void); 1307 | int LIBUSB_CALL libusb_has_capability(uint32_t capability); 1308 | const char * LIBUSB_CALL libusb_error_name(int errcode); 1309 | int LIBUSB_CALL libusb_setlocale(const char *locale); 1310 | const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode); 1311 | 1312 | ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, 1313 | libusb_device ***list); 1314 | void LIBUSB_CALL libusb_free_device_list(libusb_device **list, 1315 | int unref_devices); 1316 | libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev); 1317 | void LIBUSB_CALL libusb_unref_device(libusb_device *dev); 1318 | 1319 | int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev, 1320 | int *config); 1321 | int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev, 1322 | struct libusb_device_descriptor *desc); 1323 | int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev, 1324 | struct libusb_config_descriptor **config); 1325 | int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev, 1326 | uint8_t config_index, struct libusb_config_descriptor **config); 1327 | int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev, 1328 | uint8_t bConfigurationValue, struct libusb_config_descriptor **config); 1329 | void LIBUSB_CALL libusb_free_config_descriptor( 1330 | struct libusb_config_descriptor *config); 1331 | int LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor( 1332 | struct libusb_context *ctx, 1333 | const struct libusb_endpoint_descriptor *endpoint, 1334 | struct libusb_ss_endpoint_companion_descriptor **ep_comp); 1335 | void LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor( 1336 | struct libusb_ss_endpoint_companion_descriptor *ep_comp); 1337 | int LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *handle, 1338 | struct libusb_bos_descriptor **bos); 1339 | void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); 1340 | int LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor( 1341 | struct libusb_context *ctx, 1342 | struct libusb_bos_dev_capability_descriptor *dev_cap, 1343 | struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension); 1344 | void LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor( 1345 | struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension); 1346 | int LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor( 1347 | struct libusb_context *ctx, 1348 | struct libusb_bos_dev_capability_descriptor *dev_cap, 1349 | struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap); 1350 | void LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor( 1351 | struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap); 1352 | int LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx, 1353 | struct libusb_bos_dev_capability_descriptor *dev_cap, 1354 | struct libusb_container_id_descriptor **container_id); 1355 | void LIBUSB_CALL libusb_free_container_id_descriptor( 1356 | struct libusb_container_id_descriptor *container_id); 1357 | uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); 1358 | uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev); 1359 | int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len); 1360 | LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers) 1361 | int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length); 1362 | libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev); 1363 | uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); 1364 | int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev); 1365 | int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, 1366 | unsigned char endpoint); 1367 | int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev, 1368 | unsigned char endpoint); 1369 | 1370 | int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle); 1371 | void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle); 1372 | libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle); 1373 | 1374 | int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev, 1375 | int configuration); 1376 | int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev, 1377 | int interface_number); 1378 | int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev, 1379 | int interface_number); 1380 | 1381 | libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( 1382 | libusb_context *ctx, uint16_t vendor_id, uint16_t product_id); 1383 | 1384 | int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev, 1385 | int interface_number, int alternate_setting); 1386 | int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev, 1387 | unsigned char endpoint); 1388 | int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); 1389 | 1390 | int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, 1391 | int interface_number); 1392 | int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev, 1393 | int interface_number); 1394 | int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev, 1395 | int interface_number); 1396 | int LIBUSB_CALL libusb_set_auto_detach_kernel_driver( 1397 | libusb_device_handle *dev, int enable); 1398 | 1399 | /* async I/O */ 1400 | 1401 | /** \ingroup asyncio 1402 | * Get the data section of a control transfer. This convenience function is here 1403 | * to remind you that the data does not start until 8 bytes into the actual 1404 | * buffer, as the setup packet comes first. 1405 | * 1406 | * Calling this function only makes sense from a transfer callback function, 1407 | * or situations where you have already allocated a suitably sized buffer at 1408 | * transfer->buffer. 1409 | * 1410 | * \param transfer a transfer 1411 | * \returns pointer to the first byte of the data section 1412 | */ 1413 | static inline unsigned char *libusb_control_transfer_get_data( 1414 | struct libusb_transfer *transfer) 1415 | { 1416 | return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; 1417 | } 1418 | 1419 | /** \ingroup asyncio 1420 | * Get the control setup packet of a control transfer. This convenience 1421 | * function is here to remind you that the control setup occupies the first 1422 | * 8 bytes of the transfer data buffer. 1423 | * 1424 | * Calling this function only makes sense from a transfer callback function, 1425 | * or situations where you have already allocated a suitably sized buffer at 1426 | * transfer->buffer. 1427 | * 1428 | * \param transfer a transfer 1429 | * \returns a casted pointer to the start of the transfer data buffer 1430 | */ 1431 | static inline struct libusb_control_setup *libusb_control_transfer_get_setup( 1432 | struct libusb_transfer *transfer) 1433 | { 1434 | return (struct libusb_control_setup *)(void *) transfer->buffer; 1435 | } 1436 | 1437 | /** \ingroup asyncio 1438 | * Helper function to populate the setup packet (first 8 bytes of the data 1439 | * buffer) for a control transfer. The wIndex, wValue and wLength values should 1440 | * be given in host-endian byte order. 1441 | * 1442 | * \param buffer buffer to output the setup packet into 1443 | * This pointer must be aligned to at least 2 bytes boundary. 1444 | * \param bmRequestType see the 1445 | * \ref libusb_control_setup::bmRequestType "bmRequestType" field of 1446 | * \ref libusb_control_setup 1447 | * \param bRequest see the 1448 | * \ref libusb_control_setup::bRequest "bRequest" field of 1449 | * \ref libusb_control_setup 1450 | * \param wValue see the 1451 | * \ref libusb_control_setup::wValue "wValue" field of 1452 | * \ref libusb_control_setup 1453 | * \param wIndex see the 1454 | * \ref libusb_control_setup::wIndex "wIndex" field of 1455 | * \ref libusb_control_setup 1456 | * \param wLength see the 1457 | * \ref libusb_control_setup::wLength "wLength" field of 1458 | * \ref libusb_control_setup 1459 | */ 1460 | static inline void libusb_fill_control_setup(unsigned char *buffer, 1461 | uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, 1462 | uint16_t wLength) 1463 | { 1464 | struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; 1465 | setup->bmRequestType = bmRequestType; 1466 | setup->bRequest = bRequest; 1467 | setup->wValue = libusb_cpu_to_le16(wValue); 1468 | setup->wIndex = libusb_cpu_to_le16(wIndex); 1469 | setup->wLength = libusb_cpu_to_le16(wLength); 1470 | } 1471 | 1472 | struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets); 1473 | int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer); 1474 | int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); 1475 | void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); 1476 | 1477 | /** \ingroup asyncio 1478 | * Helper function to populate the required \ref libusb_transfer fields 1479 | * for a control transfer. 1480 | * 1481 | * If you pass a transfer buffer to this function, the first 8 bytes will 1482 | * be interpreted as a control setup packet, and the wLength field will be 1483 | * used to automatically populate the \ref libusb_transfer::length "length" 1484 | * field of the transfer. Therefore the recommended approach is: 1485 | * -# Allocate a suitably sized data buffer (including space for control setup) 1486 | * -# Call libusb_fill_control_setup() 1487 | * -# If this is a host-to-device transfer with a data stage, put the data 1488 | * in place after the setup packet 1489 | * -# Call this function 1490 | * -# Call libusb_submit_transfer() 1491 | * 1492 | * It is also legal to pass a NULL buffer to this function, in which case this 1493 | * function will not attempt to populate the length field. Remember that you 1494 | * must then populate the buffer and length fields later. 1495 | * 1496 | * \param transfer the transfer to populate 1497 | * \param dev_handle handle of the device that will handle the transfer 1498 | * \param buffer data buffer. If provided, this function will interpret the 1499 | * first 8 bytes as a setup packet and infer the transfer length from that. 1500 | * This pointer must be aligned to at least 2 bytes boundary. 1501 | * \param callback callback function to be invoked on transfer completion 1502 | * \param user_data user data to pass to callback function 1503 | * \param timeout timeout for the transfer in milliseconds 1504 | */ 1505 | static inline void libusb_fill_control_transfer( 1506 | struct libusb_transfer *transfer, libusb_device_handle *dev_handle, 1507 | unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, 1508 | unsigned int timeout) 1509 | { 1510 | struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; 1511 | transfer->dev_handle = dev_handle; 1512 | transfer->endpoint = 0; 1513 | transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; 1514 | transfer->timeout = timeout; 1515 | transfer->buffer = buffer; 1516 | if (setup) 1517 | transfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE 1518 | + libusb_le16_to_cpu(setup->wLength)); 1519 | transfer->user_data = user_data; 1520 | transfer->callback = callback; 1521 | } 1522 | 1523 | /** \ingroup asyncio 1524 | * Helper function to populate the required \ref libusb_transfer fields 1525 | * for a bulk transfer. 1526 | * 1527 | * \param transfer the transfer to populate 1528 | * \param dev_handle handle of the device that will handle the transfer 1529 | * \param endpoint address of the endpoint where this transfer will be sent 1530 | * \param buffer data buffer 1531 | * \param length length of data buffer 1532 | * \param callback callback function to be invoked on transfer completion 1533 | * \param user_data user data to pass to callback function 1534 | * \param timeout timeout for the transfer in milliseconds 1535 | */ 1536 | static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, 1537 | libusb_device_handle *dev_handle, unsigned char endpoint, 1538 | unsigned char *buffer, int length, libusb_transfer_cb_fn callback, 1539 | void *user_data, unsigned int timeout) 1540 | { 1541 | transfer->dev_handle = dev_handle; 1542 | transfer->endpoint = endpoint; 1543 | transfer->type = LIBUSB_TRANSFER_TYPE_BULK; 1544 | transfer->timeout = timeout; 1545 | transfer->buffer = buffer; 1546 | transfer->length = length; 1547 | transfer->user_data = user_data; 1548 | transfer->callback = callback; 1549 | } 1550 | 1551 | /** \ingroup asyncio 1552 | * Helper function to populate the required \ref libusb_transfer fields 1553 | * for an interrupt transfer. 1554 | * 1555 | * \param transfer the transfer to populate 1556 | * \param dev_handle handle of the device that will handle the transfer 1557 | * \param endpoint address of the endpoint where this transfer will be sent 1558 | * \param buffer data buffer 1559 | * \param length length of data buffer 1560 | * \param callback callback function to be invoked on transfer completion 1561 | * \param user_data user data to pass to callback function 1562 | * \param timeout timeout for the transfer in milliseconds 1563 | */ 1564 | static inline void libusb_fill_interrupt_transfer( 1565 | struct libusb_transfer *transfer, libusb_device_handle *dev_handle, 1566 | unsigned char endpoint, unsigned char *buffer, int length, 1567 | libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) 1568 | { 1569 | transfer->dev_handle = dev_handle; 1570 | transfer->endpoint = endpoint; 1571 | transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; 1572 | transfer->timeout = timeout; 1573 | transfer->buffer = buffer; 1574 | transfer->length = length; 1575 | transfer->user_data = user_data; 1576 | transfer->callback = callback; 1577 | } 1578 | 1579 | /** \ingroup asyncio 1580 | * Helper function to populate the required \ref libusb_transfer fields 1581 | * for an isochronous transfer. 1582 | * 1583 | * \param transfer the transfer to populate 1584 | * \param dev_handle handle of the device that will handle the transfer 1585 | * \param endpoint address of the endpoint where this transfer will be sent 1586 | * \param buffer data buffer 1587 | * \param length length of data buffer 1588 | * \param num_iso_packets the number of isochronous packets 1589 | * \param callback callback function to be invoked on transfer completion 1590 | * \param user_data user data to pass to callback function 1591 | * \param timeout timeout for the transfer in milliseconds 1592 | */ 1593 | static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer, 1594 | libusb_device_handle *dev_handle, unsigned char endpoint, 1595 | unsigned char *buffer, int length, int num_iso_packets, 1596 | libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) 1597 | { 1598 | transfer->dev_handle = dev_handle; 1599 | transfer->endpoint = endpoint; 1600 | transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS; 1601 | transfer->timeout = timeout; 1602 | transfer->buffer = buffer; 1603 | transfer->length = length; 1604 | transfer->num_iso_packets = num_iso_packets; 1605 | transfer->user_data = user_data; 1606 | transfer->callback = callback; 1607 | } 1608 | 1609 | /** \ingroup asyncio 1610 | * Convenience function to set the length of all packets in an isochronous 1611 | * transfer, based on the num_iso_packets field in the transfer structure. 1612 | * 1613 | * \param transfer a transfer 1614 | * \param length the length to set in each isochronous packet descriptor 1615 | * \see libusb_get_max_packet_size() 1616 | */ 1617 | static inline void libusb_set_iso_packet_lengths( 1618 | struct libusb_transfer *transfer, unsigned int length) 1619 | { 1620 | int i; 1621 | for (i = 0; i < transfer->num_iso_packets; i++) 1622 | transfer->iso_packet_desc[i].length = length; 1623 | } 1624 | 1625 | /** \ingroup asyncio 1626 | * Convenience function to locate the position of an isochronous packet 1627 | * within the buffer of an isochronous transfer. 1628 | * 1629 | * This is a thorough function which loops through all preceding packets, 1630 | * accumulating their lengths to find the position of the specified packet. 1631 | * Typically you will assign equal lengths to each packet in the transfer, 1632 | * and hence the above method is sub-optimal. You may wish to use 1633 | * libusb_get_iso_packet_buffer_simple() instead. 1634 | * 1635 | * \param transfer a transfer 1636 | * \param packet the packet to return the address of 1637 | * \returns the base address of the packet buffer inside the transfer buffer, 1638 | * or NULL if the packet does not exist. 1639 | * \see libusb_get_iso_packet_buffer_simple() 1640 | */ 1641 | static inline unsigned char *libusb_get_iso_packet_buffer( 1642 | struct libusb_transfer *transfer, unsigned int packet) 1643 | { 1644 | int i; 1645 | size_t offset = 0; 1646 | int _packet; 1647 | 1648 | /* oops..slight bug in the API. packet is an unsigned int, but we use 1649 | * signed integers almost everywhere else. range-check and convert to 1650 | * signed to avoid compiler warnings. FIXME for libusb-2. */ 1651 | if (packet > INT_MAX) 1652 | return NULL; 1653 | _packet = (int) packet; 1654 | 1655 | if (_packet >= transfer->num_iso_packets) 1656 | return NULL; 1657 | 1658 | for (i = 0; i < _packet; i++) 1659 | offset += transfer->iso_packet_desc[i].length; 1660 | 1661 | return transfer->buffer + offset; 1662 | } 1663 | 1664 | /** \ingroup asyncio 1665 | * Convenience function to locate the position of an isochronous packet 1666 | * within the buffer of an isochronous transfer, for transfers where each 1667 | * packet is of identical size. 1668 | * 1669 | * This function relies on the assumption that every packet within the transfer 1670 | * is of identical size to the first packet. Calculating the location of 1671 | * the packet buffer is then just a simple calculation: 1672 | * buffer + (packet_size * packet) 1673 | * 1674 | * Do not use this function on transfers other than those that have identical 1675 | * packet lengths for each packet. 1676 | * 1677 | * \param transfer a transfer 1678 | * \param packet the packet to return the address of 1679 | * \returns the base address of the packet buffer inside the transfer buffer, 1680 | * or NULL if the packet does not exist. 1681 | * \see libusb_get_iso_packet_buffer() 1682 | */ 1683 | static inline unsigned char *libusb_get_iso_packet_buffer_simple( 1684 | struct libusb_transfer *transfer, unsigned int packet) 1685 | { 1686 | int _packet; 1687 | 1688 | /* oops..slight bug in the API. packet is an unsigned int, but we use 1689 | * signed integers almost everywhere else. range-check and convert to 1690 | * signed to avoid compiler warnings. FIXME for libusb-2. */ 1691 | if (packet > INT_MAX) 1692 | return NULL; 1693 | _packet = (int) packet; 1694 | 1695 | if (_packet >= transfer->num_iso_packets) 1696 | return NULL; 1697 | 1698 | return transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet); 1699 | } 1700 | 1701 | /* sync I/O */ 1702 | 1703 | int LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle, 1704 | uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, 1705 | unsigned char *data, uint16_t wLength, unsigned int timeout); 1706 | 1707 | int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle, 1708 | unsigned char endpoint, unsigned char *data, int length, 1709 | int *actual_length, unsigned int timeout); 1710 | 1711 | int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle, 1712 | unsigned char endpoint, unsigned char *data, int length, 1713 | int *actual_length, unsigned int timeout); 1714 | 1715 | /** \ingroup desc 1716 | * Retrieve a descriptor from the default control pipe. 1717 | * This is a convenience function which formulates the appropriate control 1718 | * message to retrieve the descriptor. 1719 | * 1720 | * \param dev a device handle 1721 | * \param desc_type the descriptor type, see \ref libusb_descriptor_type 1722 | * \param desc_index the index of the descriptor to retrieve 1723 | * \param data output buffer for descriptor 1724 | * \param length size of data buffer 1725 | * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure 1726 | */ 1727 | static inline int libusb_get_descriptor(libusb_device_handle *dev, 1728 | uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length) 1729 | { 1730 | return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, 1731 | LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index), 1732 | 0, data, (uint16_t) length, 1000); 1733 | } 1734 | 1735 | /** \ingroup desc 1736 | * Retrieve a descriptor from a device. 1737 | * This is a convenience function which formulates the appropriate control 1738 | * message to retrieve the descriptor. The string returned is Unicode, as 1739 | * detailed in the USB specifications. 1740 | * 1741 | * \param dev a device handle 1742 | * \param desc_index the index of the descriptor to retrieve 1743 | * \param langid the language ID for the string descriptor 1744 | * \param data output buffer for descriptor 1745 | * \param length size of data buffer 1746 | * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure 1747 | * \see libusb_get_string_descriptor_ascii() 1748 | */ 1749 | static inline int libusb_get_string_descriptor(libusb_device_handle *dev, 1750 | uint8_t desc_index, uint16_t langid, unsigned char *data, int length) 1751 | { 1752 | return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, 1753 | LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index), 1754 | langid, data, (uint16_t) length, 1000); 1755 | } 1756 | 1757 | int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev, 1758 | uint8_t desc_index, unsigned char *data, int length); 1759 | 1760 | /* polling and timeouts */ 1761 | 1762 | int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx); 1763 | void LIBUSB_CALL libusb_lock_events(libusb_context *ctx); 1764 | void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx); 1765 | int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx); 1766 | int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx); 1767 | void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx); 1768 | void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx); 1769 | int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv); 1770 | 1771 | int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx, 1772 | struct timeval *tv); 1773 | int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx, 1774 | struct timeval *tv, int *completed); 1775 | int LIBUSB_CALL libusb_handle_events(libusb_context *ctx); 1776 | int LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed); 1777 | int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx, 1778 | struct timeval *tv); 1779 | int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx); 1780 | int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx, 1781 | struct timeval *tv); 1782 | 1783 | /** \ingroup poll 1784 | * File descriptor for polling 1785 | */ 1786 | struct libusb_pollfd { 1787 | /** Numeric file descriptor */ 1788 | int fd; 1789 | 1790 | /** Event flags to poll for from . POLLIN indicates that you 1791 | * should monitor this file descriptor for becoming ready to read from, 1792 | * and POLLOUT indicates that you should monitor this file descriptor for 1793 | * nonblocking write readiness. */ 1794 | short events; 1795 | }; 1796 | 1797 | /** \ingroup poll 1798 | * Callback function, invoked when a new file descriptor should be added 1799 | * to the set of file descriptors monitored for events. 1800 | * \param fd the new file descriptor 1801 | * \param events events to monitor for, see \ref libusb_pollfd for a 1802 | * description 1803 | * \param user_data User data pointer specified in 1804 | * libusb_set_pollfd_notifiers() call 1805 | * \see libusb_set_pollfd_notifiers() 1806 | */ 1807 | typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events, 1808 | void *user_data); 1809 | 1810 | /** \ingroup poll 1811 | * Callback function, invoked when a file descriptor should be removed from 1812 | * the set of file descriptors being monitored for events. After returning 1813 | * from this callback, do not use that file descriptor again. 1814 | * \param fd the file descriptor to stop monitoring 1815 | * \param user_data User data pointer specified in 1816 | * libusb_set_pollfd_notifiers() call 1817 | * \see libusb_set_pollfd_notifiers() 1818 | */ 1819 | typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data); 1820 | 1821 | const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( 1822 | libusb_context *ctx); 1823 | void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, 1824 | libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, 1825 | void *user_data); 1826 | 1827 | /** \ingroup hotplug 1828 | * Callback handle. 1829 | * 1830 | * Callbacks handles are generated by libusb_hotplug_register_callback() 1831 | * and can be used to deregister callbacks. Callback handles are unique 1832 | * per libusb_context and it is safe to call libusb_hotplug_deregister_callback() 1833 | * on an already deregisted callback. 1834 | * 1835 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1836 | * 1837 | * For more information, see \ref hotplug. 1838 | */ 1839 | typedef int libusb_hotplug_callback_handle; 1840 | 1841 | /** \ingroup hotplug 1842 | * 1843 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1844 | * 1845 | * Flags for hotplug events */ 1846 | typedef enum { 1847 | /** Arm the callback and fire it for all matching currently attached devices. */ 1848 | LIBUSB_HOTPLUG_ENUMERATE = 1, 1849 | } libusb_hotplug_flag; 1850 | 1851 | /** \ingroup hotplug 1852 | * 1853 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1854 | * 1855 | * Hotplug events */ 1856 | typedef enum { 1857 | /** A device has been plugged in and is ready to use */ 1858 | LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 0x01, 1859 | 1860 | /** A device has left and is no longer available. 1861 | * It is the user's responsibility to call libusb_close on any handle associated with a disconnected device. 1862 | * It is safe to call libusb_get_device_descriptor on a device that has left */ 1863 | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 0x02, 1864 | } libusb_hotplug_event; 1865 | 1866 | /** \ingroup hotplug 1867 | * Wildcard matching for hotplug events */ 1868 | #define LIBUSB_HOTPLUG_MATCH_ANY -1 1869 | 1870 | /** \ingroup hotplug 1871 | * Hotplug callback function type. When requesting hotplug event notifications, 1872 | * you pass a pointer to a callback function of this type. 1873 | * 1874 | * This callback may be called by an internal event thread and as such it is 1875 | * recommended the callback do minimal processing before returning. 1876 | * 1877 | * libusb will call this function later, when a matching event had happened on 1878 | * a matching device. See \ref hotplug for more information. 1879 | * 1880 | * It is safe to call either libusb_hotplug_register_callback() or 1881 | * libusb_hotplug_deregister_callback() from within a callback function. 1882 | * 1883 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1884 | * 1885 | * \param ctx context of this notification 1886 | * \param device libusb_device this event occurred on 1887 | * \param event event that occurred 1888 | * \param user_data user data provided when this callback was registered 1889 | * \returns bool whether this callback is finished processing events. 1890 | * returning 1 will cause this callback to be deregistered 1891 | */ 1892 | typedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx, 1893 | libusb_device *device, 1894 | libusb_hotplug_event event, 1895 | void *user_data); 1896 | 1897 | /** \ingroup hotplug 1898 | * Register a hotplug callback function 1899 | * 1900 | * Register a callback with the libusb_context. The callback will fire 1901 | * when a matching event occurs on a matching device. The callback is 1902 | * armed until either it is deregistered with libusb_hotplug_deregister_callback() 1903 | * or the supplied callback returns 1 to indicate it is finished processing events. 1904 | * 1905 | * If the \ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be 1906 | * called with a \ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices 1907 | * already plugged into the machine. Note that libusb modifies its internal 1908 | * device list from a separate thread, while calling hotplug callbacks from 1909 | * libusb_handle_events(), so it is possible for a device to already be present 1910 | * on, or removed from, its internal device list, while the hotplug callbacks 1911 | * still need to be dispatched. This means that when using \ref 1912 | * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival 1913 | * of the same device, once from libusb_hotplug_register_callback() and once 1914 | * from libusb_handle_events(); and/or your callback may be called for the 1915 | * removal of a device for which an arrived call was never made. 1916 | * 1917 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1918 | * 1919 | * \param[in] ctx context to register this callback with 1920 | * \param[in] events bitwise or of events that will trigger this callback. See \ref 1921 | * libusb_hotplug_event 1922 | * \param[in] flags hotplug callback flags. See \ref libusb_hotplug_flag 1923 | * \param[in] vendor_id the vendor id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY 1924 | * \param[in] product_id the product id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY 1925 | * \param[in] dev_class the device class to match or \ref LIBUSB_HOTPLUG_MATCH_ANY 1926 | * \param[in] cb_fn the function to be invoked on a matching event/device 1927 | * \param[in] user_data user data to pass to the callback function 1928 | * \param[out] handle pointer to store the handle of the allocated callback (can be NULL) 1929 | * \returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure 1930 | */ 1931 | int LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx, 1932 | libusb_hotplug_event events, 1933 | libusb_hotplug_flag flags, 1934 | int vendor_id, int product_id, 1935 | int dev_class, 1936 | libusb_hotplug_callback_fn cb_fn, 1937 | void *user_data, 1938 | libusb_hotplug_callback_handle *handle); 1939 | 1940 | /** \ingroup hotplug 1941 | * Deregisters a hotplug callback. 1942 | * 1943 | * Deregister a callback from a libusb_context. This function is safe to call from within 1944 | * a hotplug callback. 1945 | * 1946 | * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1947 | * 1948 | * \param[in] ctx context this callback is registered with 1949 | * \param[in] handle the handle of the callback to deregister 1950 | */ 1951 | void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx, 1952 | libusb_hotplug_callback_handle handle); 1953 | 1954 | #ifdef __cplusplus 1955 | } 1956 | #endif 1957 | 1958 | #endif 1959 | --------------------------------------------------------------------------------